Title: LPIC 102 Q/A / 10 Security

Q: You need to temporarily prevent users from logging in to the system using ssh or another means. Which of the following describes one method for accomplishing this task?
touch /etc/nologin
Disable sshd.
Remove /etc/login.
Add a shadow file.
A: A. If /etc/nologin exists, users will be prevented from logging in to the system. The root user can still log in, assuming that root logins are enabled within the ssh configuration.

Q: Which of the following commands searches the entire filesystem for files with the setuid bit set?
find ./ -perm suid
find / -perm 4000
find / -type suid
find / -type f -perm setuid
A: B. The find command will be used for this purpose, and the permission can be described as 4000 to indicate the presence of the setuid bit. The -type option can be used to change the type of object to be returned but is not relevant for the scenario described.

Q: Which of the following commands displays the currently open ports and the process that is using the port?
netstat -a
lsof -i
ps auwx
netlist
A: B. The lsof command can be used for this purpose and, with the -i option, will display the network ports along with their process. The netstat command, when run with the -a option, will display network ports but not the process. The ps command is used for processes but not network ports. Finally, there is no netlist command.

Q: You are attempting to unmount a filesystem using the umount command. However, when you do so you receive a message indicating that the filesystem is in use. Which of the following commands can be used determine which process is keeping a filesystem open?
fuser
ls
find
ps
A: A. The fuser command can be used to determine which process is using a given file. The ls command will show files and find can be used to find files but not specifically for this purpose. The ps command does show processes but not necessarily ones tied to a particular file.

Q: Which of the following commands displays account information such as expiration date, last password change, and other related details?
usermod -l
userinfo -a
chageuser -l
chage -l
A: D. The chage command is used for working with account aging information such as expiration date, password change, days between password changes, and so on. The -l command lists information for the given account. The usermod command is used to make changes to an account, and the other two commands are not valid.

Q: Which of the following commands scans the IP address 192.168.1.154 for open ports?
nmap 192.168.1.154
lsof 192.168.1.154
netstat 192.168.1.154
netmap 192.168.1.154
A: A. The nmap command is used to scan for open ports. By default, the nmap command will scan for open TCP ports to the address or addresses specified. The other commands shown do not scan for open ports to external (off-host) IP addresses.

Q: Which command is used to create a public/private key pair for use with ssh?
ssh -k
ssh-keygen
ssh-genkey
ssh -key
A: B. The ssh-keygen command is used to create a key pair for use with ssh instead of a password. Of the other options, the ssh command does exist but the -k option is used to disable Generic Security Service Application Program Interface (GSSAPI) credential forwarding and not for the purpose described.

Q: Which of the following configuration options sets a hard limit of 25 processes for a user called suehring in /etc/security/limits.conf?
suehring hard proc 25
suehring hard nproc 25
suehring proc 25 hard-limit
proc 25 suehring hard
A: B. The format is username (or other specifier) followed by hard or soft, depending on the limit type, then the keyword followed by the value for that given keyword.

Q: Within which file should you place public keys for servers from which you will accept key-based ssh authentication?
~/.ssh/authorized_keys
~/.ssh/keys
~/.ssh/keyauth
~/.sshd/authkeys
A: A. The authorized_keys file, stored in the .ssh directory in your home directory, contains public keys that are authorized to log in to the server using their corresponding private key.

Q: The system on which you are working does not have the lsof command installed, and you are not allowed to install software without going through four levels of approval and scheduling the installation weeks in advance. However, the netstat command is available. Which option to netstat will show the process ID to which a given network port is connected?
-a
-n
-p
-l
A: C. The -p option shows the process ID to which a given port is connected and is useful for displaying information about which process is listening on a given port. The -a option shows listening and nonlistening sockets whereas -n disables name lookups. The -l option shows listening sockets only.

Q: You need to look at information on logins beyond that which is captured by the current log file for the last command. Which option to the last command can be used to load information from an alternate file?
-a
-t
-e
-f
A: D. Loading alternate files is accomplished using the -f option. Doing so facilitates exactly the scenario described, being able to examine logins from old log files. The -a option controls the location of the display for the host, whereas -t controls the display to output the logins as of the specified date and time. There is no -e option.

Q: You need to examine who is currently logged in to the system. Which of the following commands will display this information?
listuser
fuser
ls -u
w
A: D. The w command shows currently logged-in users along with information such as uptime and load average. The fuser command is used to show open files, and the -u option to ls controls the display for file listings. There is no listuser command.

Q: You need to execute a command as a specific user. Which of the following commands enables this to occur?
sudo -u
sudo -U
sudo -s
sudo -H
A: A. The -u option is correct for this purpose. An uppercase -U option sets the user context for listing privileges. The -s option sets the shell, and the -H option sets the home directory.

Q: Which option in /etc/sudoers will cause the specified command to not prompt for a password?
PASSWORD=NO
NOPASSWD
NOPASSWORD
NOPROMPT
A: B. The NOPASSWD option causes sudo to not prompt for a password for a given sudo command. This is useful for scripted scenarios where a password prompt would cause problems.

Q: Which of the following commands will display the CPU time, memory, and other limits for the currently logged-in user?
reslimit
limitres -a
ulimit -a
proclimit -n
A: C. The ulimit command shows such limits, and the -a option shows all limits for the currently logged-in user. The other commands are not valid.

Q: Which line in the /etc/hosts.deny file will prevent any host within the 192.168.1.0/24 network from accessing services that operate from xinetd?
BLOCK: 192.168.1.0/24
REJECT: 192.168.1.0
ALL: 192.168.1.0/255.255.255.0
NONE: 192.168.1/255.255.255.0
A: C. The syntax to block access to every service uses the ALL keyword followed by the address or network to which the policy will apply.

Q: When expiring a user account with usermod -e, which of the following represents the correct date format?
YYYY-MM-DD
MM/DD/YYYY
DD/MM/YY
MM/DD/YY HH:MM:SS
A: A. The correct format is YYYY-MM-DD for the usermod command.

Q: Which of the following directives in a configuration file found within /etc/xinetd.d will prevent the service from starting?
enable no
start no
disable yes
boot no
A: C. The disable option is used for the purpose described, and can be set to yes or no. The other options are not valid for this scenario.

Q: You are using an RSA-based key pair for SSH. By default, what is the name of the private key file in ~/.ssh?
id_rsa
id_rsa.priv
id_rsa.key
rsa_key.priv
A: A. The file is named id_rsa by default, and the public key is named id_rsa.pub. For DSA keys, the names are id_dsa and id_dsa.pub. Other key names such as id_ecdsa, id_ecdsa.pub, id_ed25519, and id_ed25519.pub are also used depending on the algorithm. For client keys, these are typically stored in ~/.ssh/ by default.

Q: Which option to the su command will execute a single command with a noninteractive session?
-s
-u
-c
-e
A: C. The -c option executes a single command but does so without an interactive session. The -s option specifies the shell to be used. There is no -u or -e option for the su command.

Q: Which file is used to enable the setting of limits for things like logins, processes, memory, and the like for users?
/etc/security/limits.conf
/etc/userlimits.conf
/etc/security/userlimits.conf
/etc/security/procmem.conf
A: A. The /etc/security/limits.conf file (on some Linux distributions this file could be /etc/limits.conf) enables the setting of limits for user logins, processes, memory usage, and other resources. The other files shown do not exist by default.

Q: Which of the following best describes the method to use with ssh in order to execute a single command on a remote server?
Use the -e option followed by the command.
Send the command after the other options as part of the command line.
Use the --execute option followed by the command.
Use the -s option followed by the command.
A: B. There is no special option necessary in order to execute a single command on a remote host with ssh, although you might sometimes place the command in quotes if spaces are included. The -s option requests a subsystem and is not related to this scenario. The -e option specifies an escape character.

Q: When you’re using ssh-agent, which command and option lists the currently loaded keys?
ssh-agent -l
ssh -l
ssh-list-keys
ssh-add -l
A: D. The ssh-add command is used to list currently loaded keys and is used in conjunction with ssh-agent. There is no -l option to ssh-agent, and the -l option to ssh specifies the login name to use. There is no ssh-list-keys command.

Q: Which of the following commands should be used to edit the /etc/sudoers file?
Any text editor such as vi or emacs
editsudo
visudo
visudoers
A: C. While any text editor can be used, it is highly recommended that you use the visudo command to edit /etc/sudoers. Using visudo enables syntax checking, which will help to prevent issues with an invalid configuration, causing problems for those who rely on sudo.

Q: Which of the following commands can be used to stop a given service, such as httpd.service, from starting on boot with a systemd-based system?
systemctl disable httpdservice
systemctl stop httpd.service
systemd disable httpd.service
systemd enable httpd.service boot=no
A: A. The systemctl command will be used for this purpose, and the subcommand is disable. There is a stop subcommand, but it will only stop the given service rather than prevent it from starting on boot. The other options are invalid for various reasons, including that they use systemd as the command name rather than systemctl.

Q: Which of the following commands will set an account to expire based on the number of days elapsed since January 1, 1970?
passwd -e
chage -E
usermod -l
chguser
A: B. The chage command can be used for this purpose, and the -E option accepts days since 1/1/1970. There is no -e option to passwd, and -l for usermod will not perform the action described. There is no chguser command.

Q: You need to specify a list of known hosts for SSH for certain hosts within your organization rather than each user needing to accept those keys individually. Which option within a server-wide SSH client configuration file enables this scenario?
KnownHosts
PerMachineKnownHosts
GlobalKnownHostsFile
ServerKnownHostsFile
A: C. The GlobalKnownHostsFile configuration option enables the specification of a server-wide known hosts file, thus preventing users from needing to accept host keys for the hosts specified therein.

Q: Which option within /etc/security/limits.conf is used to control the number of times that a given account can log in simultaneously?
nlogins
loginmax
maxlogins
loginlimit
A: C. The maxlogins parameter is used to control the number of simultaneous logins for a given account.

Q: Which file can be used to store a server-wide cache of hosts whose keys are known for ssh?
/etc/sshd_known_hosts
/etc/ssh_known_hosts
~/.ssh/known_hosts
/root/ssh_known_hosts
A: B. The ssh_known_hosts file, typically kept in /etc/, is used for the purpose described. Note that on some systems, this file and other SSH-related configurations may be found in /etc/ssh/. The options that indicated ~ or within /root are incorrect because the question specified a server-wide list.

Q: Within the following entry in /etc/shadow, to what does the number 15853 refer?
mail:*:15853:0:99999:7:::
The UID of the mail user
The number of files owned by mail
The date of the last password change (since 1/1/1970)
The number of days until the account expires
A: C. The date of the last password change, as measured in days since January 1, 1970, is contained in the third field of a shadow entry. The expiration date would be the 8th field, as separated by colons.

Q: Which of the following commands sets up a local port-forwarding session on local port 5150 to remote port 80 of www.example.com?
ssh -L 5150:www.example.com:80
ssh 5150:www.example.com
ssh -p 5150 www.example.com
ssh -e 5150 www.example.com:80
A: A. The format for local forwarding uses the -L option followed by the local port and then the remote host:port combination. This is typically followed by the user@host credential and destination information for the SSH connection itself.

Q: Which option must be enabled in /etc/sshd_config on the destination server in order for X11 forwarding to work?
XForward yes
Xenable yes
X11Forwarding yes
Xconnection yes
A: C. The option is called X11Forwarding and it must be set to yes in order for the destination server to forward X-based windows to the local client computer. The other options shown are not valid.

Q: Which of the following commands generates a GnuPG key pair?
gpg --gen-key
gpg --key
gpg --send-key
gpg --create-key
A: A. The --gen-key subcommand is used for the purpose described. The other options shown do not exist.

Q: Signatures with gpg can be generated by using which option on the gpg command line?
--sign
--signature
--si
--dsign
A: A. The --sign option is used to sign files and documents with gpg. The other options shown are not valid for signatures.

Q: Which option to ssh is used to set the port for the remote host?
-p
-P
-l
@
A: A. The -p option sets the port for login and is useful for scenarios where you cannot use the host:port syntax. There is no -P or @ option with ssh, and the -l option specifies the login name.

Q: Which option to nmap sets the scan to use TCP SYN packets for finding open ports?
-sS
-sT
-sY
-type SYN
A: A. The -s option sets the type of scan and, when followed by an uppercase S, sets the option to SYN. The T option is a Connect() scan. There is no Y or -type option for nmap.

Q: Which of the following logs is used by the last command for detailing recent logins?
/var/log/last
/var/log/all.log
/var/log/wtmp
/var/log/logins
A: C. The wtmp file, stored in /var/log, is used to store recent login information and must be read with the last command due to its format. The other logs listed for this question are not default logs found on a Linux system.

Q: Which option to ssh enables the use of a key for authentication?
-i
-k
-f
--key
A: A. The -i option for ssh is followed by the private key to use for authentication. Doing so implies that the public key is in the authorized_keys file on the remote host. The -k option disables sending of GSSAPI credentials, whereas -f is used to request backgrounding of ssh. There is no --key option.

Q: In a scripting scenario, you need to prevent sudo from prompting for credentials or for any other reason. Which option to sudo is used to indicate this?
-n
--noprompt
-i
-q
A: A. The -n option facilitates the scenario described and will exit non-zero rather than prompting. The -i option sets the login name and is not valid for this scenario. The -q and the --noprompt options do not exist.

Q: Which of the following commands generates an RSA key for use with ssh?
ssh -key rsa
ssh --gen-key rsa
ssh-keygen -t rsa
ssh-keygen rsa
A: C. The ssh-keygen command will be used for this purpose, and the -t option specifies the type of key to generate. There are no key-related generation options for the ssh command.

Q: You need to disable a service found in /etc/inetd.conf. Which of the following is used as a comment character in that file?
-
/
%
A: B. Lines can be commented out of /etc/inetd.conf with a pound sign or hash mark (#). After making changes to /etc/inetd.conf, the service should be restarted.

Q: Which of the following commands can be used to lock an account?
usermod -L
usermod -l
passwdlock
lockacct
A: A. The -L option to usermod can be used to lock an account. The lowercase version, -l, is used to change a username. The other commands do not exist.

Q: Which file is used as the default storage for public keyrings for gpg?
publickeys.gpg
pubring.gpg
public.gpg
pubkeys.gpg
A: B. The pubring.gpg file, found in ~/.gnupg/, contains the public keyring.

Q: Which file in ~/.gnupg/, if present, indicates that files have been migrated to gpg version 2.1 or later?
.gpg-v21
.gpg-updated
.gpg-v21-migrated
.gpg-files-v21
A: C. The .gpg-v21-migrated file, when present, indicates that gpg version 2.1 or later is in use and that the files have been migrated for that version or a later one.

Q: Which of the following commands searches a server for files with the setgid bit enabled?
find / -perm 4000
find ./ -perm setgid
grep setgid *
find / -perm 2000
A: D. The find command will be used for this purpose, and the -perm option is needed, specifically as the 2000 permission to indicate setgid. Note the use of / to indicate that the entire server will be searched. The grep command shown cannot be used for this purpose because it looks for the presence of the string 'setgid' within files located in the current directory only.

Q: Which of the following commands creates links within /etc/rc.d/* for starting and stopping services on a Debian system?
createsym
startstop-service
update-rc.d
createconfig
A: C. The update-rc.d command creates symbolic links from a service file in /etc/init.d/ to the appropriate locations in /etc/rc.d/* for each runlevel. The other commands shown are not valid.

Q: Which runlevel is typically used for single-user mode, as indicated in /etc/inittab?
1
2
5
6
A: A. Single-user mode is typically runlevel 1. In runlevel 1, no network services are started. Runlevel 2 has networking but typically not services. Runlevel 5 is full multiuser with networking, and runlevel 6 is reboot.

Q: Which option to the su command is used to obtain the normal login environment?
-u
-U
-
-login
A: C. The - option is the typical option passed to su for login. There is no -u or -U option, and the -login option does not exist. There is a --login option with two dashes, but that is not what’s shown.

Q: Which of the following commands shows network services or sockets that are currently listening along with sockets that are not listening?
netstat -a
netlink -a
sockets -f
opensock -l
A: A. The netstat command is used for this purpose, and the -a option displays all sockets, listening and nonlistening. Note that it’s frequently helpful to add the -n option, or combine them as in netstat –an, in order to prevent name lookup. Doing so can significantly improve the performance of the command.

Q: Which of the following commands lists open files belonging to all processes except those owned by the user bind?
lsof -i
lsof -u bind
lsof -u ^bind
lsof | grep bind
A: C. This solution will require a way to filter out the bind user; therefore, options that grep for bind or specify bind as the user are incorrect. However, the lsof command allows for negation with the caret (^) character. Therefore, listing all files except bind requires the syntax shown.

Q: Which option to nmap will cause it to always perform name resolution?
-n
-R
-b
-a
A: B. The -R option requires an attempt at name resolution be performed. The -n option does the opposite; it disables name resolution. There is no -b or -a option.

Q: Which wildcard can be used in /etc/hosts.allow to specify a match for a host whose name does not match its IP address?
*
ALL
PARANOID
NAMEMATCH
A: C. The PARANOID wildcard specifies that the hostname and IP must match. The ALL keyword is also a valid wildcard in TCPWrappers for use in both /etc/hosts.allow and /etc/hosts.deny.

Q: Which of the following options within an OpenSSH server configuration is used to determine whether the root user can log in directly with an SSH client?
PermitRootLogin
AllowRoot
RootLogin
PermitDirectRootLogin
A: A. The PermitRootLogin directive, set to yes or no, determines whether the root user can log in directly. The other options shown are not valid.

Q: Which of the following commands executes a port scan using TCP connect to the host 192.168.2.3?
portscan 192.168.2.3
nmap -sT 192.168.2.3
maphost 192.168.2.3
tcpscan -C 192.168.2.3
A: B. The nmap command will be used for this purpose, and the -sT option performs a TCP connect to the specified host or network. The other commands are not valid.

Q: Which option to the ssh command is used for X11 application forwarding?
-X11
-A
-X
-F
A: C. The -X option enables X11 application forwarding through an SSH connection. The -A option is used for authentication agent forwarding, and -F indicates a per-user configuration file. There is no -X11 option.

Q: Which option to gpg should be used in order to specify the destination for the encrypted file?
--dest
--output
--destination
--out
A: B. The --output option is used with --encrypt to send the output to a specified file. The other options shown are not valid for gpg.

Q: Which command is used to add keys to the SSH agent?
ssh-keyadd
ssh-add
ssh-ed
ssh-cat
A: B. The ssh-add command adds keys to ssh-agent. The other commands shown are not valid.

Q: Which option to the passwd command sets the maximum password age until the password needs to be changed?
-a
-x
-l
-r
A: B. The -x option sets the maximum password age until the password needs to be changed again. The -l option locks the account, and the other options do not exist.

Q: Which option to the ulimit command enables setting of a limit on memory that can be locked?
-l
-x
-b
-t
A: A. The -l option sets the maximum amount of memory that can be locked. The -t option sets the maximum CPU time, and the -x and -b options do not exist.

Q: Which of the following commands prints a list of existing users from the password file?
passwd --list
cat /etc/passwd | cut -d':' -f1
grep "USERS" /etc/passwd
lookup --user
A: B. The command shown to display the password file and pipe the output into cut will display the usernames from the password file, /etc/passwd. The /etc/shadow file would also produce the same output.

Q: You are defining a service in /etc/xinetd.conf. Which option is used to configure the times that access to the service is allowed?
time_allowed
access_times
timed_access
access_when
A: B. The access_times configuration item sets the times in which access is allowed. The other configuration options shown are not valid.

Q: What file extension is used for interprocess communication service units that are controlled by systemd?
.socket
.ipc
.comm
.intercom
A: A. The .socket file extension is used for interprocess communication, network sockets, and first-in, first-out (FIFO) queues controlled by systemd. For more information, see systemd.socket.

Q: You are generating a host key for the SSH server with ssh-keygen and want to ensure that the key does not require a password when the SSH server starts. Which command-line option accomplishes this task?
-p
-P
-N
-d
A: C. The -N option provides the “new” passphrase, and when generating a key, it can be used to generate an empty password. The -p and -P options both work with passwords but would do so on an existing key. The -d option does not exist for ssh-keygen.

Q: When working with the /etc/shadow password file, you see passwords beginning with $1$. What algorithm does $1$ indicate has been used for password storage?
MD5
Blowfish
RIN
PIK
A: A. The MD5 algorithm has been used if the password in /etc/shadow begins with $1$. Of the other options, shadowed passwords beginning with $2a$ or $2y$ would indicate the Blowfish algorithm. There is no RIN or PIK algorithm for shadow passwords.

Q: Which option to gpg creates a detached signature?
--sig
--detach-sig
--det-sig
--sgn-det
A: B. The --detach-sig option creates a detached signature file so that the original file remains unchanged. Both the original file and detached signature file are needed in order to verify the signature. The other options do not exist.

Q: Which of the following best describes the role of server host keys for SSH?
The server host key is used to connect to remote servers.
The server host key is used for encrypting SSL communications.
The server host key is used for client connections and provides a means by which the client can verify that the server has not changed.
The server host key provides secure DNS resolution.
A: C. The server host key provides a means by which clients can verify that the server host key has not changed.

Q: When using a custom client configuration for SSH, which option specifies the key that will be used to connect to the host?
KeyFile
IdentityFile
Key
HostKey
A: B. The IdentityFile option specifies the key that will be used to connect to the host. The other options do not exist for client configurations in SSH.

Q: Which of the following commands is used as a daemon process to manage private keys for GnuPG?
gpgpkd
gpg_pkd
gpg-agent
gpg-pkagent
A: C. The gpg-agent command is a daemon process to manage private keys. The gpg program and other GnuPG-related utilities use gpg-agent. The other options shown for this question are not valid.

Q: You need to enable editing of certain files with root privileges but do not want to grant sudo access to an editor such as vim due to the possibility of a shell escaping. Which command can be used in place of vim to provide privileged editing of files?
suvim
nano
sudon
sudoedit
A: D. The sudoedit editor, part of the sudo package, can be used for the purpose described. Of the other commands, only nano is a real command, but it would also present the same possibility of shell escapes as vim would in this scenario. While there may be ways to prevent a shell escaping with both vim and nano, sudoedit is typically the preferred option.

Q: Which option to the ssh command enables changing the login name for a given host?
-l
-u
-a
-m
A: A. The -l option changes the login name for a connection with ssh. Among the other options, only -a and -m exist and are not used for the purpose described.

Q: Which option to the usermod command changes a username?
-l
-u
-a
-m
A: A. The -l option for usermod changes the username. It is worth noting that the user’s home directory and mail spool file do not change and would need to manually be changed following the usermod command. The other options are not used for the purpose described.

Q: After specifying the key server, which option to gpg is used to specify the key to send to the key server?
key-name
keyname
send-keys
sendkey
A: C. The send-keys option followed by the name of the key sends the key to the key server specified by the key server option. This is a typical scenario for sending a locally generated public key to a public server for others to use. The other options do not exist.

Q: Which of the following represents a group called admins within /etc/sudoers?
@admins
admins
-admins
%admins
A: D. The % is used to denote a group within /etc/sudoers and provides an excellent way to facilitate an administrative privileged group.

Q: Which limits-related option is used to control the maximum file size that a user can create?
filesize
maxfile
fsmax
fsize
A: D. The fsize option is used within the limits.conf file to control the maximum size of a file that can be created by a user for whom the limit applies.

Q: You are using an SSH server over a poor network connection but would like to maintain the connection in the event of keepalive messages being lost. Which client option can be set to set the number of keepalive messages that can be lost before the client will terminate the connection?
ServerTerminateCount
ServerAliveCountMax
ServerKeepAliveCount
ServerClientKeepAliveCount
A: B. The ServerAliveCountMax option is used to set the number of keepalive messages that can be sent by the client but not responded to before the client will terminate the connection.

Q: If the /etc/nologin file exists and is in use preventing users from logging in, which file can be used to provide a message to those users who are refused a login?
/etc/login.mesg
/etc/login.disabled
/etc/nologin
/etc/nologin.message
A: C. The /etc/nologin file prevents login when present and can also contain a message that is displayed to users when attempting to login.

Q: Which option to ssh-add specifies the lifetime that a key is held in the agent?
-t
-a
-l
-c
A: A. The -t option specifies the lifetime for the key and is usually given in seconds but can also be given in minutes, hours, days, and weeks with qualifiers. The other options shown do not fulfill the scenario described.

Q: Which option for an SSH connection sets up a remote forwarding scenario?
-R
-r
-e
-d
A: A. The -R option sets up a remote forward so that remote users can also connect to the tunnel being set up. The other options are not valid for the remote forwarding scenario.

Q: Which option to chage sets the number of days that a user will be warned before they need to change their password?
-w
-W
-t
-a
A: B. The -W option sets the number of days to warn a user before their password expires. The other options do not exist for chage.

Q: Another administrator made a change on the system that resulted in the /etc/shadow file becoming corrupted. Which of the following can be used to recover quickly?
The /etc/shadow.bak file
The /etc/shadow- file
The latest backup in /var/backups/
Single-user mode
A: B. The /etc/shadow- file contains the state of the shadow file before the last change and would likely be the first place to begin recovery. The next would likely be a backup, though /var/backups/ does not hold backups unless manually created.

Q: When examining the documentation for a service, you notice that it can use libwrap. What functionality does libwrap enable?
Start/stop from remote
TCP wrappers
DNS resolution
Shadow passwords
A: B. Integration with the libwrap library is an indicator that a given service or daemon will be able to utilize TCP wrappers for access control.

Q: Which option within /etc/sudoers enables the use of an alias for a group of users?
User_Alias
User_Group
User_List
User_Spec
A: A. The User_Alias option enables specification of a group of users for use elsewhere within the sudoers file.

Q: You are using nmap to scan a host for open ports. However, the server is blocking ICMP echo requests. Which option to nmap can you set in order to continue the scan?
-P0
-no-ping
-s0
-ping-0
A: A. Setting -P0 will allow no ping requests to precede the scan and is useful for the scenario described. There is an -s option, but it is not used for this purpose. The other options are not valid.

Q: Which option within a server-wide SSH client configuration specifies the name and location of the known hosts file to use?
KnownHosts
UserKnownHosts
UserKnownHostsFile
UserKnownHostsFilePath
A: C. The UserKnownHostsFile configuration option enables specification of the location and filename for the known hosts file for users.

Q: You need to generate a host key for SSH using ssh-keygen that has been generated with DSA rather than RSA. Which option and argument to that option will create a DSA key?
-k dsa
-a DSA
-t dsa
-h dsa
A: C. The -t argument sets the type of key to generate, and dsa creates a key with the dsa algorithm. Other types includes rsa and ecdsa. The files are normally placed in /etc/ssh and assigned names such as ssh_host_[algorithm]_key and ssh_host_[algorithm]_key.pub, where [algorithm] is one of rsa, dsa, ecdsa, or ed25519.

Q: The total number of users logged in can be found with which argument to the who command?
-t
-e
-q
-l
A: C. The -q option prints the users who are logged in along with a count of those users. The -l option prints the login processes, the -t option prints the last system time change, and the -e option does not exist.

Q: Which option to the passwd command unlocks an account?
-t
-u
-r
-l
A: B. The -u option unlocks an account while setting the password. The -l option locks the account, and the -t and -r options do not exist for the passwd command.

Q: Which option for user limits sets the maximum number of logins that a user can have on the system?
maxsyslogins
maxuserlogins
maxlogins
kennyloggins
A: C. The maxlogins option is used to control the number of times that a user can log in. The only other limit-related option shown is maxsyslogins, which sets the maximum number of logins for the entire system.