What is the primary protocol used by NFS for sharing files?

  • NFS
  • SMB
  • HTTP
  • FTP
The primary protocol used by NFS (Network File System) for sharing files is NFS itself. NFS is a network protocol specifically designed for sharing files and directories among networked computers. It is commonly used in Unix and Linux environments.

Which of the following is a valid way to declare a variable in Bash?

  • myVar=42
  • $myVar = 42
  • var myVar = 42
  • set myVar 42
A valid way to declare a variable in Bash is by using the format 'myVar=42'. This assigns the value 42 to the variable 'myVar'. The '$' symbol is used to reference the variable.

What is the purpose of the $? variable in a shell script?

  • It represents the process ID of the script.
  • It stores the script's exit status.
  • It contains the script's standard input.
  • It holds the current working directory of the script.
The purpose of the $? variable in a shell script is to store the script's exit status. A value of 0 typically indicates success, while non-zero values indicate different types of errors or failures. This is essential for error checking and script control flow.

To see the history of commands executed in the terminal, you would use the ________ command.

  • history
  • list
  • log
  • trace
To see the history of commands executed in the terminal, you would use the "history" command. This command displays a list of previously executed commands, making it easier to re-run or recall commands that were used in the past.

Which phase of the Linux boot process is responsible for hardware detection and initial setup?

  • Init
  • BIOS/UEFI
  • GRUB
  • Initrd
The Initrd (Initial RAM Disk) phase of the Linux boot process is responsible for hardware detection and initial setup. It loads essential modules and drivers needed to mount the root file system and continue the boot process.

Your organization is implementing a policy to disable root login via SSH. Which configuration file and parameter should you modify?

  • /etc/ssh/sshd_config, PermitRootLogin
  • /etc/ssh/sshd_config, AllowRoot
  • /etc/ssh/ssh_config, DenyRoot
  • /etc/ssh/ssh_config, RootLogin
To disable root login via SSH, you should modify the /etc/ssh/sshd_config file and set the PermitRootLogin parameter to no. This enhances security by preventing direct root logins, encouraging users to log in as a regular user and then use sudo for administrative tasks.

In Bash, the ________ construct allows you to execute a specific block of code repeatedly as long as a certain condition is true.

  • while
  • until
  • for
  • if
In Bash, the while construct allows you to execute a specific block of code repeatedly as long as a certain condition is true. It's commonly used for creating loops in Bash scripts.

In the context of networking, what does the acronym "NAT" stand for?

  • Network Address Translation
  • Network Access Token
  • Network Analysis Tool
  • Network Authentication Protocol
In the context of networking, "NAT" stands for Network Address Translation. NAT is a technique used to modify network address information in packet headers while in transit. It's commonly used to allow multiple devices on a local network to share a single public IP address for internet access.

To change the primary group of a user, the ________ command is utilized.

  • usermod -g
  • groupmod -g
  • chgrp -p
  • adduser -G
To change the primary group of a user, the "usermod -g" command is utilized. This command allows you to modify the primary group of an existing user. The "-g" option specifies the new primary group.

The iptables command that allows traffic only from a specific IP address, say 10.0.0.1, to a specific port, say 22, uses the ________ option.

  • -s
  • -p
  • -dport
  • -A
The iptables command that allows traffic only from a specific IP address, say 10.0.0.1, to a specific port, say 22, uses the -s (source) option. This option specifies the source IP address from which traffic is allowed.