Appendix
Answers to Review Questions

Chapter 1: Topic 101: System Architecture

  1. D. The udevadm command is used to work with the udev interface of the kernel, and the monitor subcommand displays kernel uevents and other udev events in real time.

  2. B. Current IRQ assignments are contained in the file /proc/interrupts. Therefore, viewing the contents of the file with a command such as cat will work. There is no “view” command, making option A incorrect. Likewise, there is no /dev/irq file, making options C and D incorrect.

  3. D. Configuration files for udev are found in /etc/udev, which makes option D correct. The other options do not exist.

  4. A. The modprobe command loads the module and its dependencies, if applicable. The lsmod command is used to list currently loaded modules, making option B incorrect. The insmod command will load a given module but not its dependencies. Option D, rmmod, is used to remove a module from memory.

  5. B. The lsusb command is used to obtain a basic list of USB devices on a system. The other commands are not valid. In the case of option D, the ls command is valid, but there is no --usb option.

  6. B. The info command for udevadm enables querying for additional information about a hotplug device managed with udev.

  7. D. The dmesg command displays the contents of the kernel ring buffer. On many Linux distributions, this log is also saved to /var/log/dmesg. The other options shown for this question are not valid commands.

  8. C. Runlevel 1, sometimes displayed as runlevel s or S, is single-user mode in which many services are not started. Runlevels 5 and 6 are used for other purposes, and runlevel SU is not a valid option.

  9. D. Scripts are stored in /etc/init.d on a system using SysV init. You may sometimes find these linked from /etc/rc.d/init.d as well. The other options are not valid for this question.

  10. A. The init command can be used to access different runlevels. Runlevel 6 is used for rebooting the system. Option B will shut down the system entirely, not reboot it. Option C will place the system into single-user mode. Option D is not a valid option.

  11. C. The telinit command can be used to refresh the system after changes have been made to /etc/inittab. Notably, option B will reboot the system but that was not an option in the question. Options A and D are not valid commands.

  12. D. The runlevel command displays the current runlevel for a system. Option B is not a valid option to the init command, and adding sudo in front of the init command makes no difference. Option A is not a valid command.

  13. C. Unit configuration files are stored in /lib/systemd/system. The other directory options for this question are not relevant or do not exist by default.

  14. B. The systemctl command is used to work with services and targets. The list-units command is used to list targets. The other commands are not used for this purpose or do not exist with the required option.

  15. C. The -nn option displays both numbers and device names, making option C correct. The -n option (option B) displays only numbers. The other two options do not exist.

  16. D. The lsmod command is used to list currently loaded kernel modules, making option D correct for this question. The insmod command (option A) is used to load modules. Option C is a valid command but not a valid option for that command, and option B does not exist.

  17. C. The --show-depends option shows the modules that depend on the specified module. The other options do not exist.

  18. B. The wall command is used to send a message to all users, thereby making option B correct. The cat command is used as a means to concatenate or view files, and tee is used to send output to standard output and a file. Finally, ssh is the secure shell client command and is not used for the purpose specified.

  19. B. Checking to ensure that the disk is detected in the basic input/output system (BIOS) is a good first step in troubleshooting. Option A, unplugging the disk, won’t help it to be detected. Restarting the web server won’t help detect the disk, and the disk-detect command does not exist.

  20. D. The /sys/bus/usb/devices directory contains information about USB devices. The other directories are not valid for this purpose.

  21. D. The file /var/log/dmesg will typically contain historical messages from the current booting of the system. On some distributions of Linux, this information is also in /var/log/boot.log.

  22. C. Out of the options given, the systemctl status command and option is the most appropriate. The telinit and sysctl commands are not used for this purpose. Likewise, the --ls option is not valid for systemctl.

  23. B. The isolate option is used to move the system into the target specified, making option B the correct one. The other options do not exist.

  24. A. The initctl reload command causes Upstart to reread its configuration files.

  25. B. The --list option will show all services on a system along with their status for each runlevel.

  26. C. USB devices are generally considered to be hotplug devices. Hotplug devices describe those devices that can be inserted and removed while the system is “hot,” or powered on, whereas coldplug devices are those that must be inserted and removed when the system is powered off.

  27. B. The umount command is used to unmount drives within a running system. The other commands do not exist.

  28. D. Of the options presented, running dmesg is a common way to determine the location to which the kernel has assigned the drive. Rebooting the system is not a good option, though it would work. There is no such thing as /var/log/usb.log, and the location of the drive may change regardless of port, depending on how the drive may be detected in the system.

  29. B. From these options, only B will shut down the system immediately. Option A will cancel a shutdown.

  30. C. The ExecStart option indicates the command to be executed on startup of a systemd service.

  31. D. The systemctl get-default command will show the default target. The other commands and options are not valid.

  32. A. The enable option configures the service to start on boot. The start option, D, is used to start a service immediately. The other options are not valid for this command.

  33. C. The /proc filesystem contains information about currently running processes and additional information about the kernel and current boot of the system.

  34. C. The -t option to lsusb will print output in a tree-like format so that you can see which devices are connected to which bus. The other arguments to lsusb are not valid, and the usblist command is not real.

  35. D. If a working device does not appear in lsmod, it typically means that the kernel has a driver already loaded by virtue of being compiled into the kernel itself rather than loaded through a module. The use of systemd (option A) or initramfs (option B) has no effect.

  36. C. The -w option causes the module to wait until it’s no longer needed prior to unloading. The -f option forces immediate removal and should be used with caution. The other options are not valid for rmmod.

  37. B. The tune2fs command can be used for this purpose but should be used with care because it can result in data corruption.

  38. C. Rules related to udev are stored in /etc/udev/rules.d. The /etc/udev hierarchy contains the udev.conf configuration file along with other components related to the configuration of udev.

  39. B. The -k option shows the kernel driver associated with a given PCI device and can be helpful when planning a new kernel compile. The -t option displays information in a tree-like structure, and -n uses numbers instead of device names. There is no -a option.

  40. B. The /etc/modprobe.d directory is used for storing configuration information related to modules such as that used for blacklisting purposes but also for other configuration information, such as udev and module options.

  41. B. The dracut command is used to create the initial RAM disk for newer systems and has replaced the legacy mkinitrd command used for the same purpose.

  42. D. The file /proc/kallsyms provides a way to view the currently loaded kernel symbols. This can be helpful for resolving module dependencies. Note that on legacy systems, this file might be called /proc/ksyms.

  43. A. The systool utility can be used to show currently loaded options for a given module. The modinfo -r command is not valid, and though modinfo shows information about a module, it does not include core size and other settings. The lsmod command cannot be used for this purpose, and there is no infmod command.

  44. B. The /proc/sys/kernel hierarchy contains vital configuration information about a kernel. These settings can be changed on a running system.

  45. B. The /etc/systemd/system directory is where it is recommended to store unit files for systemd. The other locations are not valid.

  46. C. The systemctl command will be used for this purpose with the daemon-reload subcommand. The reboot option would work to reload the systemd configuration but is not correct because it requires the entire server to reboot, which is not what was asked in this question.

  47. B. The /etc/inittab file contains the various runlevels and what to run at the given runlevel. For example, runlevel 1 is single-user, runlevel 6 is reboot, and so on. The other files listed do not exist.

  48. B. The SYSLINUX boot loader is used for FAT filesystems to create rescue disks and to assist with installation of Linux in general. SYSLINUX also describes an overall project containing other specialty boot loaders. The other options listed for this question are not valid boot loaders, though.

  49. C. initrd is used for an initial root filesystem for early drivers. initrd is configured to load within the GRUB configuration file for a given operating system.

  50. B. The fsck command is used to diagnose and repair hard drive problems in Linux. The defrag command is not available in Linux.

  51. D. The telinit command can be used for this purpose, and passing 1 as the argument will switch the system into single-user mode. The other commands shown are not valid.

  52. D. The -n option changes the boot order for the next boot only and boots from the specified partition. The -b along with -B modifies and then deletes the option. The -o option sets the boot order. The -c option creates a boot number.

  53. A. ISOLINUX provides a means by which CD-ROMS formatted as ISO 9660 can be booted. It’s very common to have live CDs or rescue/recovery CDs that use ISOLINUX for boot. The other boot loaders are not valid for this purpose or don’t exist.

  54. A. The /usr/lib/systemd hierarchy contains files related to systemd configuration. The user directory within the hierarchy is used for user unit files, and the system files are stored in /usr/lib/systemd/system.

  55. B. Due to the decidedly insecure decisions made with the design of Microsoft’s UEFI, a shim is often needed to enable Linux to boot on a system with UEFI. The shim.efi file can be used as an initial boot loader for this purpose.

  56. D. Scripts for starting and stopping services are located in /etc/init.d on a SysV init-based system. The other directories listed within this question are not valid.

  57. C. The systemd-delta command is used to determine overridden configuration files. Of the other commands, diff is valid but not for this purpose. The systemctl command is also valid, but again, not for the purpose described.

  58. B. The chkconfig --list command displays all services that will be executed on boot along with the setting for each service for each runlevel. Of the other commands, the init command is valid but does not have a --bootlist option. The other commands are invalid.

  59. B. The bcfg command within the UEFI shell is used to configure boot loaders on a UEFI-based system. The command can accept various parameters to configure how the boot loader and kernel will load on boot. Of the other commands shown, grub-install is valid but not within the UEFI shell.

  60. D. The pxelinux.0 file must exist within /tftpboot on the TFTP server in order for a system to use PXELINUX for booting. The other files are not valid or necessary for PXELINUX.

  61. D. The update-rc.d utility can be used to manage SysV init scripts on Debian or Ubuntu and other distributions. When using update-rc.d, you supply the script name and the utility will take care of creating symlinks to the appropriate runlevels.

  62. B. The e key, when pressed at the right time during boot, will send you into the GRUB shell, where you can change parameters related to boot, such as the kernel options and other related parameters.

  63. D. The isolate subcommand followed by the desired target is used to switch between runlevels with a systemd-based system. The other subcommands shown are not valid for systemctl.

  64. C. The runlevel defined as initdefault is the default runlevel for the system. The other options shown do not exist.

  65. B. The initramfs system is used instead of initrd to create the filesystem-based loading process for key drivers that are needed for boot.

  66. A. The systemctl command will be used for this purpose, and the set-default subcommand is necessary to affect the desired behavior. The target file is simply called multi-user.target.

  67. C. The shim.efi boot loader loads another boot loader, which is grubx64.efi by default. The other options are not valid filenames for the purpose described.

  68. D. The /etc/rc.d hierarchy contains symbolic links to files found within /etc/init.d. These symlinks are then used for executing the scripts at the appropriate runlevel. For example, on boot the system will execute the scripts found in the runlevel directory for each runlevel executed at boot time.

  69. A. The default.target is the default target unit that is activated by systemd on boot. The default target then starts other services based on the dependencies.

  70. B. LUNs that contain the characters fc are found through Fibre Channel. Therein lies the difference between options B and C, where option C contains the letters scsi, which would usually represent a local disk. The other options are not valid.

  71. B. NVMe-capable drives are named /dev/nvme*. No special drivers are needed other than those found in the native kernel on a modern system. The other options do not exist as paths by default.

  72. D. The /proc/mdstat file contains information on RAID arrays, including RAID personalities found on the system, the devices that comprise the array, and other pertinent information. The other files shown are not valid.

  73. B. The /sys/class/fc_host directory contains other directories based on the Fibre Channel connections available. Within those host directories will be found the WWN in a file called port_name. The other directory hierarchies are not valid.

  74. C. The /dev/mapper directory contains information about multipath devices such as logical volumes. The other directories are not valid.

  75. C. The lspci command will be used for this purpose. NVMe devices are listed with the name nVME or NVMe; therefore, adding -i to grep will make the search case insensitive. You’d use this in order to ensure that the devices are detected. The other commands are not valid, with the exception of the lspci command, but you cannot grep for scsi in this scenario.

  76. D. Tape devices are found within /dev/st*, making st0 the first device.

  77. C. The /etc/issue file is used to provide a message to users, such as a login banner, prior to local login. The other files shown are not valid for the purpose described.

  78. C. The contents of the file motd, an abbreviation for Message of the Day, are displayed when a user logs in successfully. Among the other options, the contents of /etc/issue are displayed prior to local login. The other filenames are not valid for this purpose.

  79. B. The /etc/issue.net file is used to provide a message for remote logins such as telnet. The other files listed are not valid for the purpose described.

  80. D. The poweroff target of systemd, accessed using the systemctl command, is used for halting the system and then attempting to remove power on compatible systems. The halt target stops the system but does not attempt to remove power, whereas reboot simply restarts the system. There is no stop target.

  81. A. The -r option is needed to specify reboot, and the format for counting time from now is prefaced with a plus sign (+), making option A correct. Of the other commands, specifying +15 without the -r option simply shuts down the computer in 15 minutes, and specifying the time as 00:15, as in option D, will shut down the computer at 12:15 a.m.

  82. A. The service command is used to work with services, such as starting and stopping them. On newer systems, the systemctl command has replaced the service command.

  83. A. The journalctl command with the -b option displays boot messages.

  84. A. The -h option halts the system, including shutting down acpid-related hardware.

  85. C. The number 9 corresponds to SIGKILL and can be passed to the kill command to issue that signal. The number 1 is SIGHUP. Others can be found within the manual for the kill command.

  86. C. The /etc/init.d directory contains the startup and shutdown scripts for services on a Debian system that is not running systemd.

  87. A. Among the options, examining the boot messages would be a first logical step and would prevent having to reboot the system. Rebooting may be a next step in order to examine the status of the peripheral within the BIOS.

  88. C. The -n option prevents the banner from displaying when using wall. The other options shown are not used with the wall command.

Chapter 2: Topic 102: Linux Installation and Package Management

  1. C. SATA disks are addressed as /dev/sdX, just like a Small Computer System Interface (SCSI ) disk. /dev/hdX is a traditional ATA disk. The other options do not exist.

  2. C. The keyword single, given on the Linux kernel command line, will boot the system into single-user mode. The other options are not valid.

  3. A. The Shift key, if pressed when control has first been handed to GRUB, will cause the GRUB menu to be displayed.

  4. B. The root=/dev/sda2 option will cause the given kernel to load /dev/sda2 for its root partition. The rootpartition option is not valid, and the format of the root={hd0,3} is not valid in this context.

  5. C. You begin an editing session with an e when the boot option is highlighted. You can then make changes and, when done, press b to boot the system.

  6. D. The root partition is mounted after device initialization. System services, including multi-user mode, start after the root partition is mounted. The other two options, A and C, take place prior to the kernel-initializing device drivers. This process is essentially the same for virtual machines as it is for physical machines.

  7. D. The ESP is typically mounted at /boot/efi.

  8. D. The partition containing /var should be the largest for a mail server because mail spools are stored within this hierarchy. The /etc/ hierarchy is usually small, as is /usr/bin. The /mail directory does not exist by default.

  9. C. The rootnoverify option is used to specify a non-Linux kernel, one that GRUB should not attempt to load. The initrd option is used for specifying the initial RAM disk, making option A incorrect. The remaining options, B and D, are not valid options for GRUB.

  10. A. The update-grub command sends its output to STDOUT. Therefore, you must redirect using > and send that output to the correct file. The other options are not valid for this purpose. Options C and D are not valid commands, and option B contains invalid options as well as an invalid location for the destination file.

  11. B. MBR-based disks can be partitioned with up to four primary partitions, one of which can be further partitioned or extended into logical partitions.

  12. D. The ldconfig command updates the current shared library cache and list. ldconfig reads /etc/ld.so.conf and incorporates any changes found within it. The other commands listed as options for this question do not exist.

  13. B. The upgrade option for apt-get will upgrade the system to the latest version of software for packages already installed. The apt-update command does not exist, nor does the -U option to dpkg. The apt-cache command is used to work with the package cache.

  14. C. The yum install command will install a given package. The update option will update a package. The other options listed do not exist.

  15. C. Root’s home directory is /root on a Linux system. While the /home directory does exist, there is no root or su user within that hierarchy by default. The / directory is the root of the filesystem but not the root’s home directory.

  16. A. rpm2cpio sends its output to STDOUT by default, and therefore that output needs to be redirected to a file in most cases.

  17. B. The /usr hierarchy contains many of the programs that run on a Linux system. Other notable directories for programs are /bin and /sbin.

  18. B. GRUB begins its count at 0 and in this scenario there are two operating systems. Therefore, because Linux is first in the configuration file its number would be 0, which is then sent to the default= option.

  19. A. The /etc/default/grub file can be used for this purpose. You may also edit /boot/grub/grub.cfg, but this was not an option given for this question.

  20. B. The deplist option displays the dependencies for the given package. The list option displays information about a specific package while the other two options are not valid.

  21. A. The -ivh options will install a file using rpm, displaying both verbose output and hash marks for progress. The other options presented do not exist or do not accomplish the specified task.

  22. B. The export command is used to set environment variables in BASH. The other commands are not valid for this purpose.

  23. D. The yumdownloader utility will download an RPM package but not install it. The yumdownloader utility is part of the yum-utils package. The other options listed for this question do not exist.

  24. A. The apt-cache command is used to work with the package cache and the search option is used to search the cache for the supplied argument, in this case zsh. The apt-get command is used to work with packages themselves, and the apt search command does not exist.

  25. C. The GRUB_DEFAULT option, when in the /etc/default/grub file, is used to configure the operating system that will boot by default. The other options do not exist in this context.

  26. A. The ro option, which is the default for GRUB, will initially mount the root partition as read-only and then remount as read-write.

  27. D. Configuration files related to the repositories for yum are located in /etc/yum.repos.d. Of the other options, /etc/yum.conf is a file and not a directory, and the other directories do not exist.

  28. A. The -V or --verify option will check the files in a given package against versions (or checksums) in the package database. If no files have been altered, then no output is produced. Note that output may be produced for files that are changed during installation or for other reasons. Note also the use of an uppercase V for this option as opposed to the lowercase v for verbose.

  29. C. The -o option can be used to specify a destination file to which output will be sent instead of STDOUT. The other options listed in this question do not exist.

  30. A. The menu.lst and grub.conf files are used in GRUB Legacy, that is, prior to GRUB 2. This therefore makes option B incorrect.

  31. D. The ldd command will list the libraries on which the command’s argument depends.

  32. B. Swap space is used when there is insufficient RAM memory on a system.

  33. B. The /etc/lib directory is not typically associated with library files and does not usually exist on a Linux system unless manually created. The other options either contain system libraries or can be used for that purpose.

  34. C. The apt-get update command will cause the package cache to be updated by retrieving the latest package list from the package sources. There is no cache-update or update option to apt-cache. The upgrade option is used to update the system’s packages and not the cache.

  35. C. The sources.list file located in /etc/apt contains the list of repositories for Debian packages. The other file locations do not exist by default.

  36. A. The /boot partition will typically be much less than 500MB but should not be undersized. The used space within /boot will increase as more kernels are added, such as during an upgrade process. Therefore, even though the recommended size is up to 500MB, experience proves that a larger partition is helpful, possibly 1GB to 2GB.

  37. B. The pvcreate command initializes a physical partition for future use as a logical volume with LVM.

  38. D. The grub-install command is used to install GRUB onto a disk and the second SATA disk would be /dev/sdb, making option D correct.

  39. A. The dpkg-reconfigure program will cause an already installed package to be reconfigured or changed. The -r option for dpkg removes a package, making option B incorrect. There is no reconf option for dpkg or reinstall option for apt-get.

  40. C. The lvcreate command is used to create logical volumes with LVM. The pvcreate command initializes physical volumes prior to creating logical volumes. The commands in the other two options for this question do not exist.

  41. A. Physical volumes are initialized first, followed by volume group creation, and then logical volume creation.

  42. D. aptitude provides the terminal-based interface rather than the standard command-line interface of the other tools listed in this question.

  43. D. The search option performs a search of various fields such as the package name and description.

  44. B. The rpm -qa kernel command will show the kernel version. You can also use uname -r for the same purpose.

  45. C. The GRUB_DEFAULT option in /etc/default/grub will set the operating system to boot by default.

  46. A. The exclude option can be used to exclude certain packages. The argument accepts wildcards, and therefore excluding all kernel* updates will create the desired behavior.

  47. B. The grub-mkconfig command should be run after making a change to the /etc/default/grub file so that a new configuration file can be created with the changed option(s).

  48. B. The -s option to dpkg searches for the given package and provides information about its current status on the system. The apt-cache command is not used for this purpose, and the -i option for dpkg installs a package. The apt-info command does not exist.

  49. C. The lvmdiskscan command looks for physical volumes that have been initialized for use with LVM.

  50. B. The --resolve option will download the dependencies of the package being downloaded. The other options shown within this question are not valid for the yumdownloader command.

  51. A. The -i option to dpkg will install a previously downloaded package. The other commands don’t exist, and the -U option for dpkg does not exist.

  52. D. GRUB Legacy begins counting at 0 and separates disk letter and partition with a comma, making 0,0 the first partition on the first disk. Options A and C are not the first disk on the system, and option B contains a nonexistent partition.

  53. A. ESP uses the legacy FAT filesystem type for its underlying format. There is a specification for how the ESP partition must be created on top of the FAT format for boot loaders and kernel images. Note that the partition is typically FAT32 but can be FAT16 if only Linux systems will reside on the drive.

  54. A. The --install option is used followed by the partition to which extlinux will be installed for boot.

  55. C. The format for the mount command is [partition] [target], making option C correct. The other options are not valid because the arguments are in the wrong order.

  56. B. The master boot record (MBR) is the first sector on a disk and contains information about the structure of the disk. If the MBR becomes corrupt, all data on the disk may be lost. The other options shown for this question are not valid.

  57. D. The --boot-directory option enables you to specify an alternative location for GRUB images rather than the default /boot. The other options shown for this question are not valid.

  58. D. The /etc/mtab file lists the currently mounted filesystems. The /etc/fstab file lists overall filesystems for the computer but does not distinguish between mounted or unmounted filesystems. The other options listed for this question do not exist.

  59. B. The swapon command enables swap space, making it available for use as virtual memory. The mkswap command formats the space. The other two commands are not valid.

  60. C. The pvdisplay command shows information about a given physical volume. You can use pvdisplay to view the device on which the PV is built along with the extent size of the PV. The other commands shown are not valid.

  61. B. The lvcreate command is used to create a logical volume from previously created physical devices and volume groups. Using lvcreate is the final of three steps in the process for using LVM prior to actually using the logical volume.

  62. A. The vgscan command looks for both physical volumes and volume groups related to an LVM configuration. The vgscan command is run at system startup but can also be run manually. The other commands are not valid.

  63. C. The pvscan command displays a list of physical volumes on a given server. The PVs displayed are those that have been initialized with pvcreate for use with LVM.

  64. A. The -a or --activate option sets whether or not the logical volume can be used. There is no -b or -c option, and the -d option is used for debugging.

  65. C. The script is using a relative path to look for srv/vhosts rather than /srv/vhosts with an absolute path back to the root directory of the system.

  66. B. Application containers share kernel and other resources with the underlying OS and use a container daemon to communicate between the host OS and the application container. Virtual machines have their own kernel and are self-contained machines running on top of a host OS or host kernel. Linux containers also provide a containerized virtual machine–like experience but are distinct from application containers.

  67. D. The /etc/ld.so.conf directory is used in addition to /lib and /usr/lib to configure library locations. The other paths and files shown do not exist.

  68. A. Among these options, compute resources, such as adding more CPUs, would be the most likely option. Adding RAM might also be warranted, but that was not one of the available options for this question. There is no indication in the question that the network is slow, and there is no indication that adding disk space or block storage (which are essentially the same thing in this context) will help.

  69. A. GRUB 2 uses grub.cfg whereas GRUB uses menu.lst and grub.conf, making option A the correct choice.

  70. B. The MAC address will be unique for each virtual machine deployed using the image. Guest drivers would usually not be unique to an individual virtual machine but might be unique on a per-template or per-image basis. System directories are not unique per virtual machine, and there is no such thing as pilot homing in this context.

  71. B. The cloud-init program is available on Ubuntu and other distributions and can be used to deploy images to popular cloud providers.

  72. C. The yum package manager configuration file is /etc/yum.conf. The other files listed do not exist.

  73. B. The -L option to dpkg lists the files included with a given package. The -f option to dpkg shows a field from a package entry, and the other options do not exist.

  74. A. The public key is deployed to the authorized_keys file on each image, and the private key is used from the host to connect to each virtual machine. There is no reason to deploy the private key to the virtual machine in order to make a connection to it.

  75. A. The /boot/efi partition needs to exist for the EFI partition and is typically sized 100MB to 250MB, though that size can vary.

  76. A. The install option, or simply in, will install a package on a system that uses zypper for package management. Among the other options listed, the ref option refreshes the repository. The other options are not valid with zypper.

  77. D. A system running Fedora 22 will use the dnf package manager by default. The yum package manager is used on CentOS and Red Hat, and apt and dpkg are used on Debian.

  78. A. The repoquery command with the -l option is used for this purpose. The dpkg -L command is appropriate for this purpose on Debian systems. The other commands do not exist.

  79. C. Home directories for normal users are in /home and the home directory for root is at /root, making option C correct.

  80. A. The /etc/machine-id file contains the unique identifier for a given machine.

  81. A. The -n option tells ldconfig to process only the directories given on the command line. The -i option ignores the auxiliary cache file. The -v option is verbose, and -r changes the root directory from which to begin processing.

  82. C. The stats option shows total package names along with other information about the package cache. The other options are not valid for use with apt-cache.

  83. D. The --efi-directory option is used to specify the location of the EFI partition, typically /boot/efi.

  84. A. The /etc/fstab file contains a list of partitions for the system. The /etc/mtab file contains currently mounted partitions. The other files do not exist.

  85. B. The options qlp list the files in an rpm package. The other options are not valid for the purpose described in the question.

  86. B. Among the commands and options shown, the info option to yum is used for this purpose. The dpkg and apt package managers are used on Debian systems and thus would not be appropriate for a CentOS system.

  87. A. The presence of the string vmx in the flags section indicates that an Intel processor is capable of virtualization. This extension is called svm on an AMD architecture.

  88. A. The lvm.conf file is a primary configuration file for LVM. Within lvm.conf, typically found in /etc/ or /etc/lvm/, you can set things like filters for devices to include or exclude from the vgscan process. The other files shown are not valid.

  89. C. The --show option displays information about the swap spaces on the computer, including how much swap is currently being used. The -a option activates all swap spaces. There is no --list option, and -h displays help.

Chapter 3: Topic 103: GNU and UNIX Commands

  1. D. The set command can be used for a variety of purposes to change how the shell environment works. One such option is –C, which prevents output redirection such as that done with > from overwriting a file if the file already exists.

  2. B. The env command will print the current environment variables from Bash. The printenv command will perform the same operation. The other commands listed in this question do not exist.

  3. C. The man command displays documentation for the command given as the argument. The other options listed for this question do not exist.

  4. D. The uname command is used to print system information, and the -a option prints all information available to uname.

  5. A. The g option, also known as global or greedy, will apply the matched operation to the entire line rather than just the first instance of the match. The other options apply as they would for a Perl-Compatible Regular Expression. Note also the tr command that provides some of the same functionality as sed.

  6. C. The -l option provides the number of lines given as input. For example, wc -l /etc/passwd would print the number of lines in the /etc/passwd file. The other options given in this question are not valid for the wc command.

  7. C. Both head and tail print 10 lines of output by default.

  8. B. The -rf options to rm will recursively remove the contents of a directory, including other directories. The -f option alone will not work in this case because of the additional directories. The other options given for rmdir do not exist.

  9. D. The -type option causes find to limit its search to directories only, whereas the -name option limits the names of returned elements. Note the use of the wildcard due to the phrasing of the question. Also note the use of ./ to denote beginning the search in the current directory.

  10. A. The cat command will display the contents of file /etc/passwd and then pipe that output to the awk command. The awk command then parses its input, splitting along the specified separator for /etc/passwd, which is a colon (:). The output is then printed and piped to the sort command. The sort command in option B will not work because the cut command requires an argument. Likewise, the echo command in option C will only echo /etc/passwd to STDOUT.

  11. C. The -l option for ls produces long or listed output and -t sorts by time stamp. The -r option reverses the order, and -a is needed to include hidden (dot) files, making option C correct.

  12. A. The time stamp of the file will change when touch is run on a file that already exists.

  13. D. The -i option will cause both cp and mv to be interactive, that is, prompt before overwriting. The -f option will force the command to run, whereas -r is recursive.

  14. C. The tee command will send output both to STDOUT and to the specified file, making option C correct. Option A will redirect output to the correct file but not to STDOUT simultaneously. The other options will not work for this question.

  15. A. The -p option will cause mkdir to create additional levels of directories without error. Running mkdir without options will not work in this case. The -r and -f options to mkdir do not exist.

  16. B. The -R option will copy directories recursively. Note that if the -i option is not enabled, the recursive copy will overwrite files in the destination. The -v option adds verbosity but does not cause any recursion, and the -Z option does not exist.

  17. C. The file command can be used to determine which type of file is being used. This can be particularly helpful for files without extensions where you are unsure if you should view the contents of the file. Option A, grep, is used to look within files but would not be helpful in this case. The telnet and export commands are not used for this purpose.

  18. C. The dd command is used to create disk images, among other things. In this case, the input file is /dev/sda1 and the output file is output.img. It’s also common to add the blocksize option by using the bs argument, such as bs=1M.

  19. B. The cut command uses Tab as its default delimiter. This can be changed with the -d option.

  20. A. The -z option will unzip the file, -x will extract from the tar archive, and -f is used to indicate the file on which to perform the aforementioned operations. It’s typical to add -v for verbose output as well.

  21. D. The fg command will bring a command to the foreground if it has been backgrounded with either & or with the bg command.

  22. B. While the ps auwx command combined with grep will provide information on the running Apache instances, it will provide much more information than is required or useful for this problem. The pgrep command provides only the process IDs and therefore meets the criteria presented in the question.

  23. D. The top command is used to continuously monitor things like CPU and memory usage, and the -p option monitors a single process. By using the runquotes with the pidof command, the process ID is provided as input to the -p option.

  24. D. The free command displays overall memory usage for both RAM and swap and can be used to determine when additional memory might be needed.

  25. A. You need to write the changes to the file; therefore you’ll need :w. The addition of q will also quit. Note that you could use ZZ to write and quit as well. The dd command deletes a line, and x deletes a single character.

  26. D. The -n option changes the number of lines of output for both head and tail to the number specified. The other options listed in this question are not valid for head, and the -f option follows a file with tail as the file grows.

  27. A. The uptime command shows basic information such as that described along with the number of users logged into the system and the current time. The bash command is a shell environment, and the ls command will not display the required information.

  28. D. The screen command starts a new terminal that can be disconnected and reconnected as needed. Processes running from within the screen session do not know that they are running in a screen session and therefore meet the criteria needed to satisfy this question. The fg and bg commands will not meet the criteria, and the kill command will stop a process.

  29. C. The -9 option invokes SIGKILL, which will force the process to end. The 15 signal is the default, and the -f and -stop options do not exist.

  30. C. Within Bash, the number 1 represents STDOUT and 2 represents STDERR. Redirecting both means combining them in the manner shown in option C.

  31. B. The nice command, when run without arguments, will output the priority for the currently logged-in user, which is normally 0. The renice command can be used to change the priority of running processes. The other two commands shown as options for this question do not exist.

  32. D. Within a regular expression, * represents 0 or more characters. In this case, it doesn’t matter whether a person is using /bin/bash or /usr/bin/zsh. Likewise, a . matches a single character, but in the case of bash and zsh, we need to look at the first and then optionally a second character. The ? character makes the second . optional. Finally, the $ anchors the pattern at the end of the string and is also the key for this regular expression.

  33. A. The different levels of the manual are accessed by preceding the argument with the desired level. The other options, such as --list, do not exist in this context.

  34. C. The o command opens a new line below the current cursor location. The a command begins an insert mode session at the character after the cursor, not the line. The i command begins an insert mode session at the current cursor location.

  35. A. Sending -HUP as part of the kill command will restart a process. Of the other options, a -9 will kill the process completely. The other two options do not exist as valid means to kill a process.

  36. B. The history command will display your command history, including commands from the current session. You can specify how many lines of history to display, as shown in the answer for this question. Note that .bash_history will not show the current session’s history.

  37. C. The jobs built-in command shows the list of jobs running in the background. Its output includes a job number and the status of the job.

  38. B. The find command, beginning with the path and then the -name argument, will locate all of the files called .bash_history. The output from the find command should be piped to xargs, which can then build further commands from standard input. Note that this question and solution assumes that all users use the Bash shell and are keeping history.

  39. C. The tail command provides the end portion of the file given as an argument. Adding the -f option will cause the output to update as new lines are added to the file being tailed.

  40. D. The nl command will prepend line numbers onto the file given as its argument. The output is then sent to STDOUT. Of the other options, wc -l will print the number of lines in the file but not prepend those numbers onto each line, as was asked for in this question.

  41. A. The xz command can compress and decompress files in a variety of formats, one of which is lzma.

  42. A. The find command will be used for this purpose. Adding -type f will limit the search to only files and the -mtime option will limit to modification time in day format.

  43. C. The mv command is used to move files, and *.txt will look for all files with a .txt extension. Note the fully qualified destination with a / preceding the name tmp.

  44. D. The pwd command prints the current working directory. The cd command changes directory.

  45. A. The file needs to first be sorted to group common ZIP codes together. After that, piping the output to uniq will display the unique ZIP codes, and the -c option provides a count.

  46. A. Preceding the command with a ! will search history and execute the specified command. For example, !vi will start your last Vi session.

  47. C. The killall command is used to terminate processes using their name.

  48. C. The ? key will search backward in a file within Vi. The / is used for searching forward. The h key moves the cursor to the left one character, and the x key will delete a character.

  49. D. The export command makes an environment variable available to subsequent child processes. The other commands shown are not valid.

  50. B. The echo command sends output and $0 is the parameter that contains the current script name. Of the other options, $PS1 is the shell prompt and the other two options do not exist by default.

  51. B. The gunzip command is typically used for decompressing files with a .gz extension. The other options are not valid commands.

  52. C. The -i option causes rm to use interactive mode, where the command will prompt for confirmation prior to taking action. See the (1) rm man page for additional information on the other options.

  53. A. The find command can be used for this purpose. When used with the size option, various size-related options can be used. The option +1G searches for files greater than or equal to 1GB.

  54. B. The -v or verbose option lists files as cpio is working with them. Of the other options, -s is swap bytes and –l is used to link files. The -k option is included for compatibility purposes.

  55. B. The bzcat command sends output to STDOUT from a bzip2 archive.

  56. C. The jobs command is actually a shell built-in command, meaning that more information is available by using the man page for bash itself. The other options either are not valid or will not show information about the jobs command/built-in.

  57. B. The nohup command can preface another command when starting so that the process or command will not accept a SIGHUP.

  58. D. The watch command runs a command repeatedly and displays the output and errors from the command. The pgrep command does not fulfill the needs of this scenario. The mon and procmon commands are not real.

  59. B. The tmux command creates two (or more) sessions within the same physical terminal window and thus enables this scenario. The screen command can be used to create an additional session, but the screen command does not meet the criteria specified in this scenario, because the scrollback buffer does not capture enough lines by default. The other commands shown are not valid.

  60. A. The pkill command can be used for the scenario described. The other options are not valid commands.

  61. A. The -f option matches against the full path. The -d option is used to set the delimiter, the -o option matches the oldest process, and the -i option sets the search to be case insensitive.

  62. B. The which command is used to determine the command that will be run based on the current environment settings such as the path. The find and ls commands will not work for this purpose.

  63. B. The unset shell built-in is used for the purpose described. Both the reset and clear commands do not accomplish the task described, and there is no undo command.

  64. A. The type shell built-in displays information about a given executable. For example, the command type alias shows that alias is a shell built-in as well.

  65. C. Double quotes help to ensure that variables are interpolated within a shell script. Runquotes are not used for this purpose, and the other options are not valid types of quotes.

  66. C. The less pager fits the scenario described. The more pager does not have as much flexibility as less. The other options shown are not valid.

  67. C. The od command converts a file to octal format. The other options shown all have invalid commands.

  68. B. The -b option for sha256sum and sha512sum reads the file in binary mode as opposed to text mode, which is the default.

  69. B. The h, j, k, and l keys enable movement of the cursor in command mode Vi.

  70. C. The decompress and stdout options to xz are functionally equivalent to the xzcat program. There is also a related program called zcat for outputting files compressed with gzip to STDOUT.

  71. A. The EDITOR environment variable controls the editor that is used. Typical choices include nano, Emacs, Vi or enhanced Vi, known as Vim.

  72. D. The seventh manual section for regex is found by specifying the level after the command and prior to the manual page to examine.

  73. B. The renice command changes the priority of a running process. The nice command is not capable of altering running processes, and the other commands shown are not valid.

  74. B. The fgrep command is equivalent to running the grep command with an -F option. The -f option specifies a file, and the -E option utilizes an extended regular expression and is equivalent to the egrep command. The -a option is important in its own right and causes grep to process a binary file as if it were a text file.

  75. A. All of the options shown use regular expressions. In the correct answer, the strings Steve and steve will match due to the use of a character class. Option B would match only Steve but, due to the quantifier *, would also match strings like Siwejfiwjfheteve. Option C uses anchoring and thus would only match Steve or steve at the beginning of a line. Option D also uses an anchor to indicate end of line and thus does not make sense in this context.

  76. C. The top command shows running processes, typically sorted by CPU usage and updates every few seconds. The ps command shows processes but does not auto-update. The nice command sets priority, and there is no procs command.

  77. A. Files compressed with the gzip utility can typically be read by other operating systems, though it may require additional software for certain operating systems. Compression utilities like bzip2 and xz almost certainly require additional software. The tar command in option D is not a compression utility.

  78. A. The question mark can be used as a wildcard for such a scenario. An asterisk would also work for file globbing.

  79. B. The split command can break up a file into multiple pieces. The cut command would split an individual line but does not meet the criteria in this scenario. There is no dice or rem command.

  80. C. The scheduling priority of the process is shown in the PR column. The process ID is displayed in the PID column. The top command shows CPU utilization in the %CPU column and does not display information about the processor cores.

  81. A. The d key will be used for this and the number 7 used in order to cut or remove eight lines. Other keys to work with text for cut, copy, and paste in Vi include p, y, dd, and yy. The other options shown for this question are not valid.

  82. A. The unxz command decompress a file that has been compressed with xz.

  83. D. The md5sum command creates a 128-bit MD5 message digest. The sha256sum command produces 256-bit values, whereas sha512sum produces 512-bit values.

  84. A. The paste command fits the scenario described and separates the lines from each file by a tab. The other commands are not valid.

  85. A. Using a fully qualified path meets the scenario in the most typical manner. You could add the command path to the PATH environment variable, but that is unnecessary given the scenario. Restarting the shell or computer would not have any effect.

  86. B. The SIGTERM signal is used by default by the pkill command. This can be changed using the --signal option.

  87. D. Running jobs are listed with the -r option. The -s option displays only stopped jobs, whereas -l shows process IDs. There is no -a option to the jobs built-in command.

  88. C. The -c option outputs to STDOUT. See the bzip2(1) man page for additional details.

Chapter 4: Topic 104: Devices, Linux Filesystems, Filesystem Hierarchy Standard

  1. A. The listing shows a symbolic linked file located in the current directory, linked to .configs/fetchmail/.fetchmailrc. The file is owned by the root user and root group and was created on July 8, 2014.

  2. A. The mount command is used to mount drives in Linux. The source and destination mount points are expected as arguments. Drive partitions begin at the number 1, making the first partition number 1.

  3. C. The noexec option will prevent programs from being executed that reside on the partition. The noexec option is used frequently for mounting the /tmp partition.

  4. B. 0x82 is Linux swap, and 0x83 is Linux. NTFS is 0x07, and FAT is 0.0c.

  5. B. The partition type 0x83 should be created for a normal Linux partition. Type 82 is used for swap; 84 is an OS/2 partition. There is no L type.

  6. A. The which command returns the full path to the given command and is useful for determining both whether a given command is available and the location from which the command will run.

  7. A. The chgrp command can be used to change group ownership of a file. The order is chgrp <groupname> <target>.

  8. C. The file is almost certainly a hard link to the original script. Although ls won’t show this information, the stat command will show that it is a link and also show the inode to which the file is linked.

  9. A. The -i option to df produces information on inodes across all filesystems. The ls -i option will produce inode listings, but only for the current directory. The -i option is invalid for du, and dm does not exist as a command.

  10. C. The -y option will attempt to repair automatically, essentially answering y or yes instead of prompting. Of the other options, only -V is valid and will produce verbose output.

  11. B. The addition of journaling in ext3 increased filesystem reliability and performance.

  12. C. The -S option displays output in a format such as u=rwx,g=rx,o=rx. The other options listed do not perform the desired operation.

  13. B. The -s option to ln creates a symbolic link, or symlink.

  14. C. The whereis command displays pertinent information about the command given as its argument. For example, entering whereis apache2 on a Debian system will show the binary location, configuration file location, and other relevant details.

  15. A. The PRUNEPATHS option accepts a space-separated list of paths to remove from the results. The other options listed do not exist.

  16. D. The /srv hierarchy is used for data for server programs. The /etc hierarchy is configuration information; /var is also data files but variable, such as mail files. The /tmp directory is for temporary files.

  17. C. The chmod command is used for this purpose, and the u+s option sets the sticky bit for the user on the specified target.

  18. B. The -a option mounts all filesystems in /etc/fstab that are currently available. This option is typically used if the mount points are not mounted at boot time or another mount point is added to the system after it has been booted.

  19. B. The mkswap command formats a swap partition. The fdisk command is used to create the partition itself but not format it. The other two options do not exist.

  20. A. The tune2fs command displays a lot of information about filesystems, and when used with the -l option, the output includes the number of times that the filesystem has been mounted.

  21. A. The -g option displays progress of the dump. The other options listed do not exist.

  22. A. The du command will report on disk usage in a recursive manner, unlike the other commands shown here.

  23. C. The /etc/fstab file is used to store information about the filesystems to mount within the system.

  24. D. The /media mount point is used for removable media. See https://wiki .linuxfoundation.org/lsb/fhs-30 for more information on the FHS.

  25. A. The /etc/mtab file contains currently mounted filesystems. Note that /etc/fstab contains filesystem information but doesn’t report which filesystems are currently mounted.

  26. B. The -r option causes umount to attempt to remount in read-only mode. The -v option is verbose mode, and the -f option forces the operation. The -o option does not exist.

  27. A. The 022 umask will translate into 644 permissions on a new nonexecutable file.

  28. C. The updatedb command will update the database used by the locate command.

  29. A. The type built-in returns the location that the shell will use in order to run the given command. The find command cannot be used for this purpose, and the other commands do not exist.

  30. B. The -R option will perform the change ownership in a recursive manner.

  31. D. The proper order is the device (UUID or partition) or filesystem to mount, followed by the mount point or directory to mount that device, followed by its type and options, and then the dump and pass settings.

  32. A. The blkid command will show partition UUIDs. You can also get this information with the lsblk -no UUID <partition> command. The other commands shown in this question do not accomplish the required task.

  33. A. Priority order for systemd configuration files are those within the /etc/ hierarchy, followed by files in the /run/ hierarchy, followed by files in the /lib/ hierarchy.

  34. A. The -y option causes fsck to assume yes instead of prompting when repairing a filesystem. The -v option is verbosity. There is no -m or -x option for fsck.

  35. C. The -t option sets the filesystem type as ext2, ext3, or ext4. The mke2fs command is typically symlinked from /sbin/mkfs.ext2, /sbin/mkfs.ext3, and /sbin/mkfs.ext4. The -F option forces mke2fs to create a filesystem, and the -a and -e options do not exist.

  36. B. The file /etc/auto.master contains the configuration for autofs. The other files listed as options are not valid for this scenario.

  37. C. The mkisofs command creates an ISO filesystem, which can then be written to a CD or DVD. The other commands listed are not valid.

  38. B. The -c option sets the maximum mount count. The -C option sets the current number of mounts. The -b and -a options do not exist.

  39. D. The -f option, also known as fake, is helpful for situations where you need to debug the mount process or when you need to add an entry to /etc/mtab for a previously mounted filesystem. The -l option shows labels, and -v is verbose. There is no -q option.

  40. C. The letters ro indicate that the filesystem has been mounted read-only, meaning that it is not possible to perform a write to the filesystem. The other possible option is rw, indicating that the filesystem has been mounted read-write.

  41. C. Bad blocks are shown with the -b option. The -f option forces dumpe2fs to perform the requested operation, and the other command options do not exist.

  42. D. Btrfs is based on the copy-on-write principle and is generally considered more advanced than ext4 and its predecessors. FAT is a legacy filesystem primarily used for DOS and its follow-ons like Windows.

  43. B. The xfs_info command, which is functionally equivalent to xfs_grow -n, displays information about an XFS-formatted filesystem.

  44. A. The blkid command shows information about partitions including their type, their UUID, and other basic information. The other commands shown do not exist.

  45. C. The -t option, which can accept a comma-separated list of types, specifies that only filesystems of the listed type are to be unmounted. This is useful in conjunction with the -a option, which unmounts all filesystems except /proc. The -v option is verbose, and -f forces the operation to continue.

  46. D. The sync command writes unwritten data to the disk immediately and is useful to run just prior to attempting an unmount operation.

  47. C. The -f option specifies that xfs_check should check the contents of the named file for consistency. The -v option sets verbosity, and there is no -d or -a option.

  48. B. The -w option causes debugfs to open the filesystem in read-write mode. There is also a -c option to open in catastrophic mode for filesystems with significant damage. The -rw, -r, and -n options are not valid.

  49. D. The smartd daemon monitors SMART-compatible disks for notable events and can be configured to send alerts when events occur. The other commands listed are not valid for this scenario.

  50. A. The -f option forces fsck to run on an otherwise clean filesystem for ext3 filesystems. This can be helpful for times when you suspect there is an error on the filesystem and need to verify the integrity of the filesystem as part of the troubleshooting process. This can also be helpful to prepare the filesystem for conversion, such as might be the case with a tool like btrfs-convert.

  51. A. The block size for import or restore must match the block size used on export or dump. Block size is specified with the -b option, making option A correct. The other options are not valid for xfsrestore.

  52. B. A filesystem with the word defaults for its mount options will be mounted read-write (rw), suid, with the ability to have executables (exec). The filesystem will be auto-mounted (auto), but users will not be able to mount it (nouser). Character and block special devices will be interpreted (dev), and operations on the disk will be performed in an asynchronous manner (async).

  53. B. The btrfs subvolume create command creates a btrfs subvolume. The other commands are not valid.

  54. C. The -z option sets the maximum size for files to be included in the dump. The -b option sets the block size but is not related to what is being asked for in this scenario. The –s option sets the path for inclusion in the dump, and -p sets the interval for progress indicators.

  55. C. The -e option sets the behavior, such as continue, remount read-only, or panic, when an error occurs at the filesystem level. The -f option forces whatever operation you’re requesting to continue even if there are errors. The -d and -k options are not valid.

  56. D. The -n option causes mount to not write to /etc/mtab and is particularly useful for the scenario described. The -a option mounts all filesystems in /etc/fstab. There is no -b or -a option.

  57. A. The swapoff command deactivates swap space, thereby making it unavailable as virtual memory on the system. The other commands shown as options are not valid.

  58. A. The Where= directive specifies the location for the final mounted filesystem.

  59. A. The mkfs.fat or mkfs.vfat commands are valid for creation of FAT filesystems. There is no -f option to mkfs, and there is no mkfat command.

  60. D. The tune2fs command is used for working with ext2, ext3, and ext4 filesystems. The -j option adds a journal. The other commands are not valid.

  61. A. The snapshot subcommand of btrfs subvolume creates a snapshot. The other commands shown are not valid.

  62. A. The -L option forces the log to be cleared or zeroed out, which may cause a loss of data. The -v option sets verbose output; -V prints the version. The -d option performs a dangerous repair, which can be used on a read-only filesystem.

  63. C. The -o option enables the setting of one or more options for the mount command, and ro is read-only. Note that the -r option will also mount as read-only. The other options shown are not valid.

  64. B. The -E option signals that an extended option follows, such as stripe_width. The -f option forces an operation but should not be necessary for this solution, and the -e option sets the behavior on error. There is no -extend option.

  65. A. The gdisk utility is the equivalent of fdisk for working with GPT partitions. Later versions of fdisk can also be used to manage GPT partitions.

  66. A. The maximum size for a partition on an MBR disk is 2 terabytes. GPT has largely replaced MBR on newer Linux systems.

  67. C. The -m option with 0 will format the partition with no reserved blocks for superuser or system use. The -r option sets the filesystem revision.

  68. B. The default time for filesystem reorganization is two hours, or 7200 seconds.

  69. C. The file permissions are 640, meaning that the group owner can read the file. Therefore, changing group ownership should have the fewest side effects. Granting root access is not preferred, especially noting that the problem statement indicated that granting sudo wasn’t preferred. While using chown on the file to change the owner would also work, it’s likely to have additional side effects that could prevent the owner of the file from reading and writing, and there isn’t enough information in the problem for that. Finally, running chmod 777 is almost never the correct solution to any problem on Linux.

  70. B. The -a option shows all devices, even those that are empty. The -r option is for raw devices, and the other options do not exist.

  71. D. USB devices and others removable media can typically be found within the /media/ mount point.

  72. C. The mkfs-related commands are typically used for formatting filesystems on Linux. In this case, mkfs.exfat is the correct option for formatting exFAT filesystems.

  73. C. The xfs_db command is used for debugging XFS-formatted filesystems.

  74. C. The -b option is used to specify an alternate superblock and helps in the scenario described, where the superblock has been damaged. The -B option specifies the block size. There is no –s or -o option for e2fsck.

  75. A. The -h option is the flag for human-readable formatting and shows numerical output in larger size increments rather than bytes. The other options are not valid for df.

  76. B. The /etc/profile file is one of a few locations in which default options can be set for users of Bash. The other file locations shown do not exist.

  77. A. A symbolic link will not work. The users would be editing the same file and, without saving as a different filename, would not be able to keep their own edits.

  78. B. The find command will be used for this purpose, and the -uid option will need to be used because the user has already been deleted. If the user had not been deleted, then the -user option would still work.

  79. A. The updatedb command is used to update the locate database. The other commands are not valid.

  80. B. The -f option shows the UUIDs of the filesystems mounted on the system. The -a option shows all devices, the -o option enables specification of output columns, and the -u option does not exist.

  81. C. The -c option checks for bad blocks before formatting. The other options are not valid with mkswap.

  82. D. The sticky bit has been set on the file as denoted by an uppercase S.

  83. C. Using octal form, 4 is user, 2 is group, and 1 is sticky bit. Therefore, 2755 would have setgid for the file.

  84. C. The -name option is used for this purpose, and / indicates the root of the system. A * wildcard is used to indicate all filenames ending in .sql, as described in the scenario.

  85. B. The UUID=<UUID> syntax is correct for the /etc/fstab file.

  86. C. The --inodes option shows inode usage with du. The -h option is human-readable, and -d sets the maximum depth. There is no -i option for du.

  87. A. The -size option is used with find for this purpose, and the +1G argument will look for files greater than 1 gigabyte. Note that if the + is omitted, only files of the exact size are found.

  88. B. A symbolic link is the preferred method because it does not require additional maintenance that a script would or that copying would in order to keep the libraries current. Moving the libraries may have unintended consequences if another program is dependent on the libraries in that location.

Chapter 5: Topic 105: Shells and Shell Scripting

  1. B. The PS1 variable usually has its default set in /etc/profile and is used as the shell prompt. Users can customize the prompt to include hostname, working directory, and other elements.

  2. C. The source command is used to execute commands from a file. A typical use case is to create functions or variables that are then available for use within the current session. The other commands listed do not exist.

  3. B. While it’s true that every user has a .bash_logout in their home directory, that file can still be edited by the user. Therefore, to ensure that the required command is executed at logout, the /etc/bash.bash_logout file must be used.

  4. B. The env -u command will unset an environment variable for the current session. The unset command can also be used for this purpose.

  5. C. The -v option, which is the default, tells unset that the name given is a shell variable rather than a function. The other options shown do not exist.

  6. A. The alias command is used for this purpose and its format is name=value, making option A correct. The ln command cannot be used for this purpose because it will not accept command-line arguments for the target in such a format, as shown in the options.

  7. B. User-based configuration files are located in the order .bash_profile, .bash_login, and .profile. Only the first file found is executed and the others are ignored.

  8. C. The $1 variable is automatically available within Bash scripts and represents the first command-line argument. The other variables listed in this question do not exist by default.

  9. D. The fi construct is used to indicate the end of an if conditional within a Bash script. In many languages, if conditionals are scoped by braces such as { }, but in shell scripting, fi is used to denote the end of the condition.

  10. B. The seq command is used to print a sequence of numbers in a variety of formats. The answer for this question provides a starting point (0), and increment (1), and the final number (5), resulting in six numbers being displayed as output.

  11. B. The echo command is used to display its argument, regardless of whether the command is used inside a shell script or from the command line itself. The env command is used to display environment variables and therefore does not meet the need specified in the question. The var_dump command is used within PHP, and ls is used to display contents of directories.

  12. A. The suid bit enables the program to run as the user who owns the file regardless of who executes the program. Using SUID is typically not recommended for security reasons.

  13. D. The exec command executes the command given as its argument and will then exit the shell. The source command does not exit the shell.

  14. C. The double-ampersand sequence executes commands only if the previous command exited cleanly.

  15. C. The read command awaits user input and places that input into the specified variable. The exec command is used to execute commands, and the other options are not valid for the purpose described.

  16. A. Parentheses are used to denote a function, such as myFunction(). The parentheses are optional but are then followed by curly braces containing the commands to be executed when the function is called.

  17. C. The || sequence indicates an alternate command to run if the initial preceding command does not exit cleanly. The && sequence executes only when the preceding command exits cleanly, so it’s just the opposite of what the question was asking.

  18. C. The elif keyword is used to create an alternative execution path within a shell script. The other constructs, such as else if and elsif, are used in other languages.

  19. C. The unalias command is used to remove a previously defined alias. The rm command will remove regular files but not aliases. The other commands do not exist.

  20. D. At a minimum, you need to be able to read the file being sourced; therefore, chmod 400 will correctly set the permissions. Any chmod that gives additional permissions is not necessary.

  21. C. The for loop construct in this case will require the variable name LIST to be preceded with a dollar sign ($),making option C correct. The other options will not work for the purpose described.

  22. C. The -lt operator is used to test for “less than” conditions within a script. The other operators are not valid for use in a shell script.

  23. B. The -e test checks to ensure that a file exists and is typically used in the context of a conditional within a shell script. The other options may work within shell scripts but are not tests for file existence.

  24. C. The /etc/skel directory contains files to be copied to the user’s home directory. The other directories listed for this question do not exist by default.

  25. C. The --norc option causes bash to execute without reading the /etc/bash.bashrc file or the local ~/.bashrc file. The other options listed do not exist as options for bash.

  26. A. Array creation in a shell script involves parentheses when used in this manner. You can also use square brackets to define individual elements, as in ARRAY[0] = "val1".

  27. C. The -p option to declare displays fully qualified shell statements such that the statements could then be used as input for another command, either through piping or redirection to a script.

  28. A. The .bash_profile file, if it exists in your home directory, will be executed on login. Note that placing the function in /etc/profile would technically work but then the function would be available to all users, which is not what the question asked for.

  29. B. The readonly command displays the list of read-only variables that have been declared in the current session. The other commands listed for this question do not exist.

  30. C. Square brackets are used to denote the beginning and end of the test portion of a while loop in a shell script. Other languages generally use parentheses for this purpose.

  31. B. The test built-in will return true and can be used to test for the value existence of a variable not being null. Note that the behavior of the test built-in differs depending on the number of arguments.

  32. C. The HOME environment variable, set automatically to the user’s home directory, is consulted when the command cd ~ is entered. The other paths beginning with HOME do not exist by default, and the MAILPATH environment variable shown contains a list of locations where mail is checked when using the shell interactively.

  33. B. The TMOUT variable can be set in a given user’s shell and that user will be logged out after the value given (in seconds) of inactivity. The other environment variables listed here do not exist.

  34. B. Just as with an if statement where the statement is ended with fi, so too is a case statement ended with the word case spelled backward. The curly brace shown as option D is used to close case statements in many languages, but not for shell scripts.

  35. A. The provided answer performs command substitution and places the value from the resulting command into a variable. Note the use of +%s formatting on the date, which then formats the output as seconds since the epoch, as specified in the question. Option C will provide the date within the DATE variable but will not format it as specified.

  36. B. Wrapping a variable in curly braces, such as ${FILEPATH}, will ensure that the variable is interpolated or expanded correctly even when used in a place where it might not normally be expanded, such as within a quoted string.

  37. B. In shell scripts, the commands to execute begin at the do keyword and end at the done keyword. Other languages generally use either curly braces or tabs.

  38. D. The -r test determines whether a given file exists and can be read by the current user. The -e test only checks to see if the file exists.

  39. A. The -r option to declare will create or mark the variable as read-only. The -p option prints output in a format that can be reused. The -x option declares the variable for export.

  40. D. The *) sequence is used to denote a default set of statements that will be executed if no other case matches within the set.

  41. A. Backquotes can be used for command substitution within a Bash script. The other options shown are not valid for command substitution.

  42. B. The character sequence done denotes the end of a while loop in Bash.

  43. B. Greater than or equal to is tested with >=. Of the other operators shown, != tests for inequality.

  44. C. The execute bit is not set on the script, resulting in the permission denied error, making option C correct. The file extension does not matter, so option A is incorrect. Likewise, option B is not correct because the script isn’t even executing. Lowercase or uppercase letters do not matter, making option D incorrect.

  45. D. The -f option exports names as functions to child processes. The other options shown do not exist with the export command.

  46. D. The unset command removes a variable from being set. The other options shown do not exist.

  47. A. The /etc/bash.bashrc file is a systemwide configuration file for the Bash environment. Another systemwide file used for similar purposes is /etc/profile.

  48. D. The +x option enables debugging output and is frequently used when debugging shell scripts. The -x option is used to disable debugging. The -d and +d options do not exist.

  49. D. The .bashrc file in a given user’s home directory is executed for interactive logins. The other files shown do not exist.

  50. A. The function keyword declares a block of code to be a function in Bash. It’s worth noting that the function keyword can be omitted in most cases. The other options are not valid.

  51. B. The syntax shown in option B is the correct syntax to add a path to the current environment. Option A does not include the existing path (and will, in fact, overwrite the existing path). Option C contains spaces, and option D uses a semicolon as a delimiter.

  52. D. The $0 variable is automatically defined and contains the name of the script itself. The other options shown do not exist by default.

  53. A. The -s argument enables setting of a delimiter. When used, the numbers will be printed in a sequence rather than one per line. The -m and -d options do not exist.

  54. D. The -O option is used to determine if the user currently running the test is the owner of the file being tested. The -k option checks to see if the sticky bit has been set. There is no -m file test.

  55. A. A successful return from a command executed within a Bash script is 0. A 1 or higher typically indicates an error condition. There is no C condition.

  56. A. The file is not copied to directories for existing users, making option A correct. There is nothing in the question to indicate that the file is too big or that it already exists. File extensions don’t matter in Linux, so option D cannot be correct.

  57. C. The find command begins the search in the current directory, which is problematic in a scripted scenario like the one presented. The find command can find directories, and those directories can begin with a dot character.

  58. B. The -i option ignores the environment. The other options are not valid for use with env.

  59. A. The -x option enables debugging when passed on the interpreter line of a Bash script. The other options are not valid for this purpose.

  60. C. Doing math in Bash requires a special syntax. The bc command can also be used for such operations and is frequently used for math within Bash scripts.

  61. A. The read command will be used, and option A shows the correct syntax. Option C is incorrect because it does not prompt the user. There is no prompt command, making options B and D incorrect.

  62. D. The -n option removes a variable from being exported. The other options do not exist.

  63. A. The exit code from the previous command is captured automatically in the $? variable, thus ruling out any option that did not have this value. A test for the value is done with -eq in a Bash script, thus making option A correct.

  64. D. The source command is frequently used for the purpose described. The function command can be used to create functions but would not be used for the purpose described. The include and require commands are not valid.

  65. B. Adding the execute bit for the user can be done in a non-octal format, as shown in option B. The only other valid chmod option is 644, which does not grant execute permission.

  66. B. The problem statement specified files, making option B the best answer. Option A will also find directories.

  67. C. The -f option removes a function. The other options do not exist for the unset command.

  68. A. The env command, when used as #!/usr/bin/env bash, will determine the location of the Bash interpreter automatically. This makes the resulting script more portable for systems where Bash may not be located in /bin/.

  69. B. The front slash, or forward slash, is used for division. Of the other options, an asterisk is used for multiplication and the other options are not valid.

  70. B. The mailx command can be used to send mail from the command line. The other options shown are not valid commands.

  71. D. The -s operator tests if a file is not zero size. The -d operator looks for directories, whereas -e merely checks if the file exists.

  72. A. An alias exists only for the length of the current session, making option A correct. If the alias or command was invalid, you would have seen it immediately when you created or used the alias.

  73. D. The correct syntax is shown in option D for the scenario described.

  74. B. The user is most likely not using Bash but is rather using another shell like Tcsh. The user could be logging into a different system, but hopefully by having them log out and log in again that would have been noticed, as would their manual removal of the environment variables.

  75. A. The LOGNAME environment variable contains the currently logged-in user. The other variables do not exist by default.

  76. A. The -h test determines if the file is a symbolic link. The -p option tests if the file is a pipe, and -S returns true if the file is a socket. The -t test determines if the file is a terminal.

  77. C. The -f option marks a function as read-only. The -p option prints a list of read-only identifiers. The -a option assumes that the name is an array, and there is no -r option to the readonly command.

  78. B. Option B is the best answer because it will find files where the user permission includes the execute bit. It’s worth noting that options A and C will find the execute bit but only with the exact permissions specified.

  79. A. The /usr/local/bin directory is the location specified for local binaries according to the FHS. It’s also a typical place for scripts as well. The /usr/bin and /usr/sbin directories are for system binaries, and /home/scripts does not exist by default.

  80. D. Ctrl+c is used to terminate a script and is usually used for terminating programs as well.

  81. B. The -0 option follows each environment variable with a null byte rather than a newline. The other options shown are not valid for use with env.

  82. D. In all likelihood, the cp command has been aliased with the -i option. Running unalias cp will correct the issue. It is possible that the cp command has been recompiled to always ask for confirmation, but this is not the most likely cause.

  83. C. An exit code of 1 usually means error, but in the case of grep it means that the search pattern was not found.

  84. B. The -d test checks if a file is a directory. The -e option checks for existence, and the -a option is no longer used. The -w test checks to see if a file is writable by the current user.

  85. B. The command shown prepends /usr/local/bin on to the existing path. Option A uses $PATH, which is the incorrect identifier for the left side of the assignment. Option C appends /usr/local/bin rather than prepends, and option D uses a semicolon as a delimiter.

  86. C. The until loop construct will execute at least once before the condition is evaluated. The while and for loops both evaluate the condition first. The case statement is not a loop construct.

  87. B. The single dot, ., can be used as a means to source environment variables. The other characters and character sequences do not work for the purpose described.

  88. A. The -p option displays all exported variables. The other options shown do not exist.

  89. D. The word do indicates the beginning of a while loop in a Bash script. The other options shown are not valid for the purpose described.

Chapter 6: Topic 106: User Interfaces and Desktops

  1. A. The greeter is configured through /etc/lightdm/lightdm.conf using the greeter-session option. The other options provided here are not valid.

  2. B. The Screen section of xorg.conf is used to logically bind a given graphics card and monitor, each of which would be defined in its own respective section in the configuration file. The other options shown for this question do not exist.

  3. A. Frequency options are Hz, k, kHz, M, or MHz, making uHz an unavailable option.

  4. C. The systemctl set-default command will be used for this purpose, and the target of multi-user is used to boot to the command line. You will also need to remove the word splash from /etc/default/grub and run update-grub as well.

  5. A. The DISPLAY variable can be used to remotely send the windows of an X session to another computer when using protocols like SSH. There is no XTERMINAL or XDISP environment variable, and XTERM is typically a terminal window and not an environment variable.

  6. D. The Welcome option sets the message to be displayed to users within the display manager when they log in. For remote users, the RemoteWelcome message can be used for the same purpose.

  7. C. The Shift key can be used to enable and disable sticky keys within GNOME and other operating systems for accessibility purposes.

  8. A. The Disable keyword is used to ensure that a given module is not loaded. Note that a Load statement for the same module takes precedence over the Disable statement, but Disable can be used to unload modules that are loaded by default.

  9. A. The Orca project provides assistive screen reading capabilities within GNOME. Of the other options given, the screen program is valid but is not used for this purpose.

  10. C. The xrandr command can be used to change resolution, and changing the resolution to something like 800×600 would make icons and other items appear larger.

  11. D. The allow-guest option changes the behavior of guest login for LightDM, and disallowing guest login would generally make the computer somewhat more secure. However, if someone has physical access to the device, they might be able to get access in other ways.

  12. C. The XFree86 -configure command tells the XFree86 server to query for hardware and create a configuration for the recognized hardware. Note that you may still need to edit the resulting configuration file because of unrecognized hardware or to account for specific configuration items.

  13. B. The XkbModel configuration option is used to set the type of keyboard being used, such as pc105 for a 105-key keyboard. The XkbLayout option defines the layout of the keyboard such as US for United States–style keyboards.

  14. B. The VertRefresh option is used for this purpose and accepts a range of values in the manner shown. The other options given for this question are not valid for the purpose described.

  15. D. The file ~/.xsession can be used for commands that run X clients. The other files are not valid for the purpose described.

  16. C. The linear acceleration profile is enabled by setting AccelerationProfile to 6 within xorg.conf. The 0 setting is known as classic, whereas -1 provides constant acceleration (no profile) and 7 is known as limited, which performs the same as linear but with a maximum amount of speed and acceleration.

  17. A. The /usr/share/fonts hierarchy is used for storage of fonts. Another path that might contain font information is /usr/share/X11/fonts, but that was not among the choices given for this question.

  18. C. Kernel versions beginning with 2.6.26 include native support for Braille displays in Linux.

  19. A. The DontZoom option prevents the specified key combinations from changing the video mode. Of the other options, the DontZap option changes the behavior of the Ctrl+Alt+Backspace key combination. The other options don’t have any effect and are not valid in xorg.conf.

  20. C. The xauth program looks for the configuration file in the user’s home directory in the file .Xauthority. The other files do not exist by default.

  21. C. The Xaccess file is used to control access when using XDMCP. The other files are not valid for this purpose.

  22. D. The kmag program magnifies items on a desktop and is used as an assistive technology. In general, kmag can be used with other window managers as well.

  23. A. The SIGTERM signal causes the X server to exit cleanly. SIGKILL would not be a clean exit. The other signals shown as options are not valid signals.

  24. B. The Appearance section of GNOME Control Center is used to set many aspects of how the desktop appears and behaves, including the choice of a high-contrast theme.

  25. B. Mouse gestures are commonly associated with assistive technologies and help to facilitate uses of programs by moving the mouse in a certain way. Mouse gestures could be used for login and to capture screenshots, but those are not adequately or generally descriptive of their use.

  26. D. The Alt+Super+S keyboard shortcut activates the screen reader in GNOME 3.9 or later. The Super+S shortcut enters Overview, and the other shortcuts provided do not have a special meaning by default. Note that the Super key is also called the Windows key or the Command key.

  27. D. The startx command kicks off the display manager after login to a local terminal. The other commands shown do not exist or will not work for the purpose described.

  28. B. The BlankTime option, which is set to 10 minutes by default, causes the monitor to go blank but not actually go into standby or other power-saving modes.

  29. C. The xwininfo command displays information about a given window within an X session. The other commands listed for this question are not valid.

  30. A. The Mouse button displays keys to move the mouse. The Compose button shows a compose keyboard, and the other options are not valid.

  31. C. The xhost command is used to control access to the X server. A host is added with the + sign.

  32. B. The ForwardX11 option must be enabled on the client in order for X connections or windows generated from the X server to be sent over an SSH connection.

  33. D. The FontPath directive provides another location in which the server can find fonts. The other options do not exist within the context of an xorg.conf configuration file.

  34. D. With an on-screen keyboard, users can utilize a pointer such as a mouse to select keys on the keyboard.

  35. C. The XAUTHORITY environment variable can be used to specify the location of the xauth authority file.

  36. B. The Alt+Ctrl+F1 key combination is used to get to a terminal prompt and is helpful in situations where the X server won’t start properly.

  37. B. The autologin-user option is used to define a user who will be automatically logged in to the system. The other options given in this question do not exist.

  38. C. The AccessX utility is used on legacy or older systems to set many of the accessibility options. The functionality provided by AccessX can typically be found in one of the utilities provided by the native X window manager, dependent on the window manager in use.

  39. A. The export shell command sets an environment variable. In this case, the DISPLAY environment variable needs to be set. The env command shown will not set the variable.

  40. A. The Menus option displays the menu options for a given application so that those options can be manipulated with the keyboard. The Activate option helps to work with the desktop and other applications. The other options shown for this question are not valid.

  41. B. The /etc/lightdm/lightdm.conf.d directory contains individual *.conf configuration files for various settings and is typically parsed along with the /etc/lightdm/lightdm.conf file.

  42. B. The COLUMNS environment variable specifies the width in characters of a terminal device. The other environment variables are not valid.

  43. C. The VideoRam option, which can be expressed in bytes, configures the amount of RAM available to the video card.

  44. B. The Depth option sets the color depth for a given monitor display. A typical value might be 24 for this option.

  45. B. The Identifier option provides a unique description of each of the server layouts in an X configuration. The other options shown for this question do not exist.

  46. A. The mkfontscale command will create a fonts.scale file, which describes the outline fonts on the system and is used for configuration of fonts that are manually added to the system.

  47. A. Display Power Management Signaling (DPMS) enables additional power-saving modes, such as a full sleep mode, that enable further energy efficiency for the display.

  48. B. The emacspeak program provides another visual assistive technology as an alternative to Orca. The other technologies listed here are not related to visualization or assistive technologies.

  49. B. Weston is a reference implementation of the Wayland protocol.

  50. C. The SuspendTime sets the time, in minutes, for the monitor to go into standby mode. The other options shown are not valid.

  51. C. The files in /etc/X11/xorg.conf.d/ are included when X is starting.

  52. B. XDMCP, which is typically disabled by default, uses no compression or transport security. XDMCP is therefore not usually preferred for remote access. Of the other options, SSH offers encryption of the session, and XR and RD are not valid protocols.

  53. D. The Xfce desktop environment uses xfwm4 as its window manager. The other options are not desktop environments.

  54. B. The disable-ticketing option turns off simple authentication for clients with Spice.

  55. B. Simon is the speech recognition software that is part of the KDE project.

  56. D. The only valid panel listed in the options for this question is called Universal Access, making option D correct.

  57. A. The setxkbmap command can be used to enable Xkboptions when X is already running. The other commands shown do not exist.

  58. B. The xrdp program is an open source implementation of an RDP server. The other programs shown are not valid.

  59. A. Changing the VISUAL environment variable to an editor that can run over an SSH session will fix the issue. In this case, /bin/vim was used.

  60. B. The -passwd option is used to set the password on the server for x11vnc.

  61. D. The xauth utility is used for working with the X authority file. The other options shown are not valid.

  62. C. Bounce keys cause the interface to not react when keys are accidentally pressed in succession or held down.

  63. B. The TMPDIR environment variable is used if the normal home directory location, ~/.xsession-errors, cannot be opened. The other environment variables are not valid.

  64. D. The xdpyinfo command displays various elements about the current display(s) along with information about X itself.

  65. B. The Weston configuration file is called weston.ini and is located in ~/.config. The other files are not valid.

  66. A. The x11vnc program, an implementation of VNC, offers built-in SSL/TLS capabilities. The other programs shown are not valid.

  67. B. The brltty program enables a text-mode braille display. The other programs are not valid.

  68. B. The xzoom program is used for screen magnification. The other programs shown are not valid.

  69. D. The GRUB_INIT_TUNE variable can be used within the GRUB configuration in order to beep when GRUB is ready for input.

  70. B. The xhost command will be used for this purpose, and the minus sign removes a host from being able to connect.

  71. B. The Xsession script is executed as the user logging in, making option B correct. The Xstartup script is executed as root prior to the execution of Xsession. The other files are not valid as part of the xdm login process.

  72. A. The -nolisten tcp option disables listening for TCP connections for an X server. The other options are not valid.

  73. B. SIGHUP is used for the purpose described, typically when a user logs out. SIGKILL does not restart the server or prepare for a new connection. The other signal names given as options are not valid signals.

  74. C. The greeter-show-manual-login option, when set to true, will require the user to enter a username for login rather than select the username from a list.

  75. B. The -n option disables hostname lookups. The other options shown are not valid.

  76. C. In runlevel 3, accessed through the telinit command, the X server is not typically executed. Runlevel 6 will shut down the system. Runlevel 1 switches to single-user mode, and runlevel 5 is a multi-user mode in which X is usually running.

  77. C. According to the X server documentation at https://www.x.org/releases/X11R7.7/doc/man/man1/Xserver.1.xhtml, the default location is within the /usr/lib path, but it’s worth noting that Linux distributions may change this location to be within the /var/log/ hierarchy.

  78. B. The ~/.xinitrc file can be used for per-user initialization. The other files are not used by default for this purpose.

  79. C. The -nolisten local option can be added to prevent the X server from listening on abstract sockets.

  80. D. The -broadcast option for XDMCP enables sending of BroadcastQuery packets. The other options shown are not valid options with XDMCP.

  81. C. The gdmsetup program is used to configure various options for the login window and environment, including those for local and remote users. The other options are not used for this purpose or do not exist.

  82. C. Any host within the example.com domain can connect.

  83. C. The family inet6 enables the specified host to connect with IPv6. The other methods shown will not work.

  84. B. The ~/.xsession-errors file is the default log file for Xsession and X clients. The other files are not valid for this purpose.

  85. A. The gok command, short for GNOME On-screen Keyboard, is the program to start the on-screen keyboard. The Caribou program will be the successor to GOK.

  86. B. The -f option enables file specification for the X authority file. The -v option enables verbose output. The other options are not valid.

  87. B. Slow keys is the name used to describe this assistive technology.

  88. C. RDP listens on port 3389 by default. Port 389 is LDAP, and 3306 is usually MySQL.

Chapter 7: Topic 107: Administrative Tasks

  1. A. The best option among these choices is to change the group to www-data and change the permissions such that the group can write into the directory. Option B should never be used because it enables world-writing to the directory. The other options will not allow the web server group to write into the directory.

  2. B. The format for cron is [minute hour day-of-month month-of-year day-of-week], thereby making option B the correct option for this question.

  3. C. The /etc/localtime file, which can be an actual file or a symbolic link, is used to indicate the local time zone. The other files listed as options do not exist.

  4. D. The LDAP Data Interchange Format (LDIF) is an open format, defined in Request for Comments (RFC) 2849, that enables import and export of LDAP entries. The file formats TXT and CSV are valid but not for the purpose described; there is no specific file format known as LDAP.

  5. B. The chage command will be used for this purpose, specifically with the -E option. When provided with a date, chage will expire the account on that date. When provided with -1, the expiration will be removed.

  6. D. Within the /usr/share/zoneinfo hierarchy, you will find information on the various regions and time zones available. The files within this hierarchy can be symlinked to /etc/localtime. The file /etc/timezone is also sometimes used by Linux systems and, notably, by Java in certain situations.

  7. B. The at command is used to run a series of commands that you enter. Unlike with cron, you can schedule commands from the command line to be executed in the same order entered rather than having to create a specific script for the commands. The syntax shown in option B sets the time to be one hour from now.

  8. B. The userdel command is used for this purpose, and the -r option (lowercase) deletes both the home directory and mail spool files. The -R (uppercase) option tells the userdel command to use a chroot directory.

  9. B. The /etc/shadow file contains usernames, UIDs, and encrypted passwords and is not readable by any non-root user on the system due to the sensitive nature of the encrypted passwords. The /etc/passwd file contains usernames and UIDs but not encrypted passwords. The other two files listed for this question do not exist.

  10. C. Use anacron when you need to schedule a job on a computer that might be off when the job is scheduled. anacron will take care of running the job at its next available time.

  11. B. The +%s option will format the date as seconds since January 1, 1970. This option is used frequently in scripting and elsewhere for obtaining a unique time stamp that can be parsed easily as an integer. The other options will not work.

  12. C. The --list option shows the available character sets on the system. The other options given for this question do not exist.

  13. C. The LC_TIME environment variable is used to control the display and behavior of the date and time and can be changed to a different locale in order to achieve the desired display and behavior of date and time formatting. The other options shown for this question do not exist.

  14. D. Beginning with OpenLDAP version 2.3, slapd-config is used for configuration of OpenLDAP, as documented at http://www.openldap.org/doc/admin24/slapdconf2 .html. The other commands are not valid.

  15. A. The @daily shortcut schedules a job to run at midnight every day. The other options shown do not exist.

  16. B. UTF-8 provides multibyte character encoding and is generally accepted as the standard for encoding moving forward. ISO-8859 is single byte encoded. The other options are not valid.

  17. A. The groupmod command will be used for this purpose, and the -n option is used to change the group name. The other commands listed do not exist.

  18. D. The /etc/group file contains information on groups on a Linux system. The other files are not valid for the purpose described.

  19. C. The slapcat command dumps the slapd database in LDIF format to STDOUT. The output can then be redirected into a file. The other commands are not valid.

  20. C. The /etc/cron.d/ directory can contain scripts that have scheduling information within them along with jobs to run. The other locations given as options are not valid.

  21. B. The getent command is used to display entries based on the /etc/nsswitch.conf file. One use case for getent is when integrating with Microsoft Active Directory or another LDAP service to check if the connection can be made to the LDAP server. The usermod command is valid but is not used for this purpose, and the other commands shown for this question are not valid.

  22. B. The /etc/login.defs file contains various configuration items such as the minimum and maximum user and group IDs to be used on the system.

  23. C. The LC_MEASUREMENT environment variable is used to indicate the measurement units that should be used.

  24. D. The TZ environment variable is used for this purpose and the general format is as shown, making option D the correct answer.

  25. A. The /etc/cron.daily directory contains files such as scripts that are executed daily. There are corresponding cron.hourly, cron.weekly, and cron.monthly directories that run on their respective schedules, as indicated by the name of the directory.

  26. C. Setting LANG=C is an alias for Portable Operating System Interface (POSIX) compatibility and will cause programs to bypass locale translations. The other options shown for LANG are not valid.

  27. B. The -m option causes the user’s home directory to be created. By default, if this option isn’t specified and CREATE_HOME has not been set, the home directory won’t be created. The –h option displays help text, and the other options shown are not valid.

  28. A. The usermod -L command locks an account by placing a ! in the encrypted password. If the user has another means to log in, such as with an SSH key, using usermod -L will not prevent their login.

  29. C. The LC_ALL variable can be used to set environment variables to the current locale and will override others. This can be used when there is a need for a temporary change. The other variables listed here are not used for this purpose and are not created by default.

  30. A. The format when adding a username places the username between the schedule and the command to run, making option A correct. The other options shown for this question are invalid. In the case of option B, there is no schedule. In the case of options C and D, the schedule is incorrectly formatted.

  31. C. The passwd command will be used for this purpose. The -a option displays all users but requires the use of -S to indicate status. The -S option alone will not produce a report for all users, and the --all option is an alias for -a.

  32. D. The chage command is used for this purpose. The -d option sets the days since the last password change and is measured in days since January 1, 1970. The -W option is the days of warning for changing a password, and the -l option displays a list of the various settings related to the account.

  33. B. The /etc/anacrontab file contains information about the jobs such as the job name and delay, among other information. The other files listed do not contain anacron-related information about jobs.

  34. D. The ldapadd command is used to add entries to the OpenLDAP database.

  35. B. The /etc/cron.deny file contains a list of users who cannot create cron scheduled tasks. The other files do not exist by default.

  36. B. The system uses shadow passwords if an asterisk shows up in the password field of the /etc/passwd entries. There is no indication that the system has been compromised, making option C incorrect, and there is no password scheme called “forward password aging,” making option A incorrect as well.

  37. D. There is no direct relationship between the UIDs and GIDs on a system. UIDs represent users, whereas GIDs represent group IDs. On some systems, the UID and GID number will match for regular users, but this is not a requirement and is more of a coincidence.

  38. C. The slapindex command generates indexes based on slapd databases. The other commands are not valid.

  39. A. The usermod command is used for this purpose. The -d option changes the home directory, whereas -m moves the contents. The other commands shown for this question are not valid.

  40. D. The -G option is a list of supplemental groups to which the user will be added. A lowercase -g option provides the primary GID. The -l option causes the user to not be added to the lastlog and faillog databases. There is no -x option.

  41. A. The crontab command can be used for this purpose, and the -l option is used to list the crontab entries. The -u option is needed to specify a user other than the current user.

  42. A. The -r option creates a system user that will typically entail no expiration, no home directory, and a UID below 1000. The -s option defines the shell and is not typically used for this purpose. The -a and -S options do not exist.

  43. B. The /etc/gshadow file contains secure information such as an encrypted password for groups, where applicable. The /etc/group file contains general information on groups. The other two files listed as options do not exist.

  44. D. The slapd_db_recover command can be used to help recover an OpenLDAP database that has become corrupted or otherwise invalid. The remaining options for this question are not valid commands.

  45. B. The groupdel command cannot delete groups unless there are no users who have the given group as their primary GID. There is no -f or -r option.

  46. A. The id command shows the username, UID, primary group, and GID, along with supplemental groups. The passwd and chage commands are not used for this purpose. There is no getid command.

  47. D. The -c option changes the comment field in /etc/passwd. The comment field is typically associated with the real name of the account. The -R option indicates a chroot directory, whereas -d indicates a change of home directory. There is no -n option.

  48. D. The find command will be used for this purpose. The correct syntax is shown in option D. The group command will merely look in the specified files for the number 1501, and the -u option to grep includes byte offsets, which is not applicable for this question.

  49. A. The standard port for unencrypted LDAP is 389, and that is the port on which slapd listens for connections. Port 3389 is RDP, whereas 3306 is MySQL. Finally, 110 is POP3.

  50. A. The ln command is used for this purpose, and the -s option creates a symbolic link, and -f forces or overwrites the destination. The other options or order of commands are not valid.

  51. C. The LC_MONETARY variable is used by certain programs to determine the localization for currency.

  52. C. The --on-calendar option adds a timed event with systemd-run. The other options shown are not valid for use with systemd-run.

  53. B. The /etc/cron.allow file is a list of users who have permission to create and remove their own cron jobs. The /etc/crontab file is used to store cron jobs, and the other files do not exist.

  54. B. Debug level 64 provides configuration processing debug information. Debug level 1 traces function calls, whereas level 8 shows connection management. Debug level 0 is no debug.

  55. C. The atrm command removes jobs given their IDs. The ID can be obtained with the atq command. The at -l command shown will list jobs but not delete them. The rmat command is not valid.

  56. B. The dpkg-reconfigure command is used to cause the configuration questions to be asked again. The tzdata package is the name of the package on Debian-based systems. The two apt- commands shown are not valid.

  57. D. There are multiple ways to specify loglevels and debugging for slapd, including by keyword, by integer, or as shown in the question, by hex. All of the values shown are valid for loglevel. No debugging is 0, trace is 1, stats logging is 256 or 512 depending on type, and packets sent and received is integer 16, or hex 0x10.

  58. A. The /etc/skel directory contains files that are automatically copied to a user’s home directory when that user is created. The other directories listed for this question do not exist by default.

  59. B. The atq command shows a list of jobs that have been scheduled with the at command. The other commands don’t exist with the exception of option D, which shows the at command but with an invalid option, --jobs.

  60. C. The port for LDAPS or LDAP over SSL is 636. Port 389 is standard, non-SSL, LDAP. Port 443 is used for HTTPS, and 3128 is used for Squid proxies.

  61. A. The at command runs a command at a specified time. While cron can be used to run a command, it will run the command repeatedly according to the schedule set for the command. The other commands are not valid.

  62. D. The /etc/at.allow file is used to specify users who can create at jobs. The other files are not valid.

  63. B. Systemd timer files have the extension .timer and are used for scheduling service unit files or events. The other file extensions are not used for systemd timer units.

  64. A. The /var/spool/cron/crontabs directory contains a file for each user who currently has one or more cron jobs or entries. Note that the other files listed here are not valid for this purpose.

  65. D. The -j option enables specification of a line from which the import will be started. It is useful in the scenario described where the import needs to be restarted due to error. The -f option specifies an alternate location for the slapd configuration file. The -q option is quick mode, with less checking, and -l specifies the input file.

  66. B. The -a option shows all locales currently available on a system. The other options do not produce the output specified in this scenario.

  67. A. The --adjust-system-clock option sets the system clock when used with set-local-rtc. The other options are not valid.

  68. A. The -i option displays information that can help determine the character set such as ISO-8859, ASCII, or Unicode for the given file. The -m option specifies a list of magic files, -l shows a list of patterns, and -a is not a valid option with the file command.

  69. B. The LC_PAPER variable is used to set the paper size for printing. The other variables are not available by default.

  70. C. The /etc/crontab file is a plain-text file that is treated as a systemwide cron file. As such, the file is generally not associated with any single user and it’s not necessary to run a special command after editing this file.

  71. D. The tzselect command will, by default, display a step-by-step menu to select a time zone. The eventual output will include a region/time zone line, such as America/Chicago, as output.

  72. A. The OnBootSec option is used for this scenario and option A has the correct syntax. The other options shown do not exist.

  73. B. GECOS is the legacy name for information stored in /etc/passwd such as full name and other contact information.

  74. A. The -g option sets the group ID for the newly created group. The -h option is help, and neither -k nor -a exists as an option for groupadd.

  75. C. The list-timers option shows the currently active timers with systemd. The other options are not valid.

  76. B. The weekly shortcut means that systemd will execute the event once a week. The other shortcuts given as options are not valid.

  77. A. The -r option removes the current crontab. The -i option can be added so that the user is prompted prior to removal.

  78. B. The SKEL variable controls the location of the skeleton home directory, which is normally /etc/skel/ by default. The other options shown are not used for the purpose described.

  79. C. The passwd option is used to list the password database on a system. The other options do not exist.

  80. A. The directory /var/spool/cron/atjobs contains the jobs. The other directories shown do not exist.

  81. C. The GID_MIN variable contains the minimum GID to use on the system. The other variables are not used for the purpose described.

  82. D. The MAIL_DIR variable contains the directory where a user’s mail spool is located. The other options shown are not valid variables for this purpose.

  83. C. The /etc/passwd file contains various information about users on a system such as username and real name, along with user ID (UID) and login shell. The file is world-readable.

  84. C. The @reboot shortcut indicates that the cron job will be executed when the system starts up.

  85. A. The -r option specifies that the group being added will be a system group.

  86. A. The directory /var/lib/ldap stores database files related to the OpenLDAP deployment on a given server. The other directories shown are not valid for this purpose.

  87. A. Only active units are shown by default, so the --all option displays all units.

  88. B. The /etc/at.deny file contains a list of users who cannot create at jobs.

Chapter 8: Topic 108: Essential System Services

  1. C. The journalctl command is used to work with the systemd journal. On systemd-based systems, journalctl is a central command for debugging and troubleshooting.

  2. C. The kern facility receives messages from the kernel for logging purposes. Of the other options, syslog is used for logging messages about syslog itself. The other two options shown are not valid syslog facilities.

  3. D. ntp.org provides a free service for time synchronization. When you use pool.ntp.org as the target, you will typically receive an NTP server that is geographically close to your location, or at least as close as possible. Setting your address to 127.0.0.1 or 192.168.1.100 will use a local server but only if that server has an NTP service.

  4. A. The service used for logging on a computer managed by systemd is called systemd-journald. You use the journalctl command to view logged entries rather than the standard Linux toolset.

  5. B. The create option is used for this purpose and accepts arguments such as those shown to set the permissions and ownership. The other options shown are not valid within a logrotate configuration.

  6. D. Configuration files for CUPS are found in /etc/cups. However, it is also common to manage CUPS through its web interface. The other directories listed are not valid.

  7. A. The Allow directive is used for this purpose and the addresses 192.168.1.1 through .127 signify a /25 in Classless Inter-Domain Routing (CIDR) notation, making option A correct. Note that option B, with a /24 netmask, would allow the addresses too but would also allow 192.168.1.128 through .255, which is larger than should be allowed.

  8. B. The ntpdate command provides a command-line interface that immediately changes or sets the time according to the NTP server given as its argument. The ntpd option provided in option A will run the NTP daemon and would not be appropriate for a script. The other two commands are not valid. It is worth noting that ntpdate has been deprecated in favor of ntpd, but you will likely find ntpdate available on many systems.

  9. B. Typically, the Connection refused message from an NTP-related command means that the daemon is not running. There is no indication that the ntpq command is querying a different server; therefore, whether the network is up or down is irrelevant. The permission-based options are not valid based on the error message indicated.

  10. D. The hwclock command is used to both query and set the hardware clock, such as the one maintained by the system firmware or basic input/output system (BIOS). The ntpdate command is used to set the local system time but is not related to the hardware clock. The other commands are not valid.

  11. C. The /usr/share/zoneinfo directory and its child directories contain information on time zones on a Linux system. The other files and directories do not exist by default.

  12. D. The info severity level provides information messages for a given facility. Of the options given, emerg is used for emergency messages and not normally used by applications, whereas debug is the highest or most verbose level of logging available through syslog.

  13. B. The driftfile configuration option sets the location of the driftfile for ntpd. The drift file helps to maintain time accuracy. The location shown is the default for Red Hat Enterprise Linux.

  14. A. The mail option is used to send the log to the specified email address on completion of the logrotate process. The others shown do not exist as options in /etc/logrotate .conf.

  15. C. The journalctl command is used for this purpose, and the --disk-usage option displays the disk space used by journal log files, which are typically stored in /var/log/journal.

  16. D. The mailq command is used on Postfix servers in order to view a summary of the current mail queue. Details of the queue include the ID of the mail being sent along with one or more of the email addresses involved in the transaction. The mailq command may also work with newer versions of sendmail.

  17. C. The ntpq command provides an interactive, menu-like interface into the NTP server. You can use ntpq to check statistics on peers, for example. The ntpdate command shown as option B is used as a command-line means to set the time. The ntpd command shown as option A would execute the NTP daemon itself.

  18. D. The format is user: destination for the aliases file, making option D correct. The other options are not valid syntax for the aliases file.

  19. B. The -f option indicates the file to which messages will be logged. The -d option is used for debugging, whereas -v prints the version of klogd. There is no -l option for klogd.

  20. A. The chrony package is used for the scenario described and helps with systems that are frequently offline or disconnected from the network. The other packages listed as options are not valid for the purpose described.

  21. A. The lpr command places a file (or standard input) into the print queue for lpd to work with. The lpq command prints the current queue. There is no lpx command.

  22. C. The -bp option to the sendmail command prints information about the current queue. There is no -queue or -f option that is relevant for this question. The -bi option is used to work with the aliases database.

  23. A. The -w option sets the hardware clock to the current system time. The -s option does the opposite, setting the system time to the hardware clock. There is no -a or -m function for hwclock.

  24. D. TCP port 631 is used as the administrative interface into CUPS. Visiting an active CUPS server on that port will show the administration website for working with print queues and other configuration items related to CUPS.

  25. A. The -q option causes sendmail to attempt to deliver messages from the queue. Add the -v option to display verbose output.

  26. B. The requirements of multiple email addresses prevent the use of .forward; therefore, it will need to be accomplished in /etc/aliases. The format for multiple email addresses is to separate them with a comma, making option B correct.

  27. A. The --systohc command will set the hardware clock according to the current system time. The use of --utc is required in order to ensure that the time is set to UTC. If --utc is omitted, the time will default to whatever was used last time the command was run, which could be UTC but might also be localtime instead. Therefore, the best option is A.

  28. D. The postsuper -d command deletes messages from the queue. The ALL keyword causes all messages to be deleted from the queue. Care should be taken when performing this action because it is irreversible. There is no -remove option to postqueue, and the -f option for Postfix is not relevant. The rm -rf command shown is not specific enough, and it is generally not recommended to manually remove files from a mail queue.

  29. A. The URL shown will display the jobs area of the local CUPS server with a query string name of which_jobs and a value of completed. The other URLs shown are not valid.

  30. C. Just as the tail -f command will continuously update the display as new content is added, so too does the -f option display new entries for journalctl. The -t option shows messages for the given syslog identifier. There is no -tail or -l option.

  31. B. The $UDPServerRun option is used for the purpose described. The port on which the server should listen is then provided as the value for this option. The other options shown are not valid configuration items for rsyslogd.

  32. A. The postqueue -f command is used to flush the queue. The command will process all of the emails that are awaiting delivery. The other commands are not valid for this purpose.

  33. C. The -g option specifies the maximum offset or skew that can be adjusted for when synchronizing time. When set to 0, there is no offset check.

  34. A. The SystemMaxFileSize option controls the size of the journal log file to ensure that a log does not cause problems related to disk usage. The SystemMaxUse option controls overall size of journal files, and the default for SystemMaxFileSize is one-eighth of the SystemMaxUse setting to allow for rotation of files.

  35. C. The lpstat command is used for this purpose. The lpstat command displays information about printers, print jobs, and related information. The -W option specifies which jobs to display, complete, or not complete. The lpq command shown as an option is used to view the queue, and the other options are not valid.

  36. D. The postrotate option within a configuration for log rotation can be used for this purpose. After postrotate, a line typically follows with the script or commands to execute. The other options shown for this question are not valid.

  37. B. SMTP operates on TCP port 25, and if other servers are contacting your SMTP server, then you’ll need to listen on this port and allow traffic to it as well. Port 23 is used for telnet, port 110 is POP3, and port 143 is Internet Message Access Protocol (IMAP), none of which are necessary for SMTP traffic.

  38. A. The makemap command is used to create the hashed database in the correct format for sendmail to use. The other commands are not valid for sendmail.

  39. A. The configuration file for syslog-ng is stored in /etc/syslog-ng and is named syslog-ng.conf. There is not typically an /etc/syslog directory, even on systems without syslog-ng.

  40. C. The application could theoretically use any of the logging facilities, depending on the type of application being developed. However, the requirement to log to a custom log file means that the logs will have a different name and possibly location than the standard logs. Therefore, logging to any of the standard or system-level facilities is not appropriate for this scenario, making one of the local (local0 through local7) facilities appropriate.

  41. B. The usermod command with the -aG option is used to append a group onto the user’s list of groups. In this case, the user needs to be a member of the lpadmin group.

  42. D. The nocompress option is used to prevent the log file from being compressed or zipped as part of the rotation process. This might be needed on systems where compression negatively affects performance or where additional processing is necessary.

  43. C. The cupsctl command should be used with the --share-printers option to enable printing for remote clients within the same subnet. You would then also flag each printer for sharing with the lpadmin command, setting the printer-is-shared option to true.

  44. B. The mailstats command is used for the purpose described. Of the other options, the mailq command will display the current mail queue but not statistics on mail that has been processed. The other two options are not valid commands.

  45. B. The --disk-usage option shows the amount of space consumed by active and archived journals. The other options shown are not valid.

  46. A. The systemctl command is used for controlling services. In this case, restart should be sent to the CUPS service as denoted by the name cups.service.

  47. D. The -p option is used to filter based on priority and the loglevel given in the scenario is debug, making option D correct. The other options are not valid for the purpose described.

  48. A. The Port configuration option is used for this purpose and is used as an alternative to the Listen directive. With the Listen directive, you will specify address:port. However, option C, while valid syntactically, will listen only on the localhost IP of 127.0.0.1 and not all interfaces.

  49. A. The postsuper command is used for management of various items with Postfix, including deletion of individual messages from the mail queue. The other commands will not work for the purpose described.

  50. B. The --vacuum-time option will be used for this scenario. Time can be specified in seconds, minutes, hours, days, months, weeks, and years.

  51. B. The file .procmailrc, found in a user’s home directory, is used by Procmail for processing messages on a per-user basis. The other files are not used by Procmail in a default configuration.

  52. D. The format is local-address: destination-address. Each destination address is separated by a comma. The difference between options C and D is that the question specifically asked for addresses @example.com and since the question didn’t specify whether this server was the server for @example.com, the destination addresses needed to be fully qualified.

  53. D. The postcat command shows the contents of a message from the Postfix queue. The other commands shown are not valid.

  54. C. The /var/log/mail.err file contains errors related to mail delivery. However, on some systems, mail-related errors may go to a different log, such as /var/log/mail.log or /var/log/mail.info or similar.

  55. D. The EHLO command indicates Extended Hello syntax and is followed by the host from which communication has been initiated. Of the other options, the HELO option is valid but is not the Extended Hello syntax specified in the question.

  56. A. The list-timezones option to timedatectl shows the names of time zones and is useful for obtaining the correct time zone name. The other options are not valid with timedatectl.

  57. A. The /etc/localtime file is a symlink to /usr/share/zoneinfo/America/Chicago, making option A correct. Some systems also link /etc/timezone for the same purpose.

  58. A. The date command shows the current time zone. The other options shown will not work.

  59. C. The /etc/chrony.conf file is the configuration file used by the Chrony package. The other files do not exist by default.

  60. C. The -k option shows kernel messages only when used with journalctl. The other options shown do not query the journal.

  61. B. The newaliases command re-creates the aliases database on servers running Postfix, sendmail, and qmail. There is no need to restart the mail server after running newaliases. The alias command shown in option C will create an alias for the command shell but is not related to Postfix.

  62. D. The systemd-cat command logs to the systemd journal. When given a parameter such as a command, both STDOUT and STDERR are logged. The other commands shown as options are not valid.

  63. A. The lprm command is used to help manage printer queues by removing jobs. The other commands shown are not valid.

  64. D. The logger command is used to send messages to syslog and can be executed in a shell script context in order to take advantage of the robustness of syslog without having to write separate log management into the script.

  65. C. The mailq_path parameter contains the path to the mail queue for Postfix. You can use this to diagnose problems with the queue directories. The other parameters shown are not valid in Postfix.

  66. D. The _SYSTEMD_UNIT filter can be used to show messages related to a single service. Multiple _SYSTEMD_UNIT arguments can be given to show messages for multiple services. The other options shown for this question are not valid.

  67. C. The lp command, usually used with the -d option to specify the queue name, is used to add a job to the specified print queue. The other commands shown as options are not valid.

  68. B. When the .forward file is found within a user’s home directory, forwarding of email will typically occur when mail is destined for that user.

  69. B. The -s option sets the subject for the email to be sent. The -E option informs mail to not send messages that have an empty body. The -c option enables setting of carbon-copy (CC) addresses. The -f option specifies an alternate mailbox and would not be used for this scenario.

  70. D. The -s option sets the date and time as specified within the command. If there is another means to automatically set the date, it may override the change. For example, if ntpd is running, that process may alter the date even after it has been set with date -s.

  71. B. The --vacuum-size option to journalctl will trim the journal data files so that they consume the specified size. It is worth noting that the size may not be exactly that specified because journalctl deletes only archived files.

  72. A. The --since option filters journal messages based on the time elapsed since that specified. There is also a corresponding --until option that enables further time filtering.

  73. C. The use of - indicates that syslog does not need to sync to disk for every log entry. This can greatly improve performance for busy systems but may cause log entries to be lost if the sync process has not been run prior to a system crash or other issue.

  74. A. The -P option sends a print job to the specified destination. Of the other options shown, -h disables banner printing, and the remaining options do not exist for lpr.

  75. C. The qshape command displays information regarding the number and age of the messages in the Postfix incoming and active queues. Other queues can also be viewed using the command as well. The other commands shown as options for this question are not valid.

  76. D. The SystemMaxUse configuration option configures how much space journal files can take on the system. The other options shown are not valid, but it is worth noting that there are several options for controlling journal sizes and these options should be examined as part of preparation.

  77. C. The /var/spool/postfix directory contains directories and files related to the mail queue for Postfix. The other directories listed are not valid for this scenario.

  78. D. The --directory or -D option can be used to specify an alternate location for the journal data and would support the scenario described. The other options are not valid with journalctl for the scenario described.

  79. C. The /var/log/ directory is the normal location for system logs, and daemons will typically use this hierarchy for logs as well. For example, some Linux distributions use /var/log/journal/ for systemd journals. The other directories shown as options do not exist by default.

  80. C. The :blackhole: option can be used as a destination to prevent Exim from delivering the mail for that particular user or email account. The other options shown for this question are not valid.

  81. C. The <DefaultPrinter printerName> stanza, where printerName is the name of the printer, configures a printer for CUPS.

  82. C. The lprm command can be used for this purpose and, when given a single dash, will delete all jobs from the queue if run as root. The other options given for lprm are not valid.

  83. B. The -r option enables setting the From header of the email to be sent rather than the currently logged-in user. The -f option specifies a different mailbox and is not useful for this scenario. The -o and -m options do not exist.

  84. B. The @@ symbol specifies that TCP should be used rather than the default @ that normally precedes a host using UDP for remote logging.

  85. C. The Storage=Persistent key/value pair within the [Journal] stanza of the configuration file enables persistent storage for the journal. The other key/value pairs are not valid.

  86. A. The chronyc command can be used for monitoring the status of time updates. The other options shown are not valid commands.

  87. C. Individual configuration files for various log file rotation policies are found in /etc/logrotate.d. This directory is included in the primary configuration file /etc/logrotate.conf.

  88. A. The postqueue -p command and option view the pending queue. The postqueue -f command causes the queue to be flushed. The other commands shown are valid, but their options are not.

Chapter 9: Topic 109: Persistent Network Configuration

  1. A. The netstat command can be used for this purpose, and the -r option displays the current routes. The addition of -n prevents DNS lookups, which can help with performance.

  2. A. The ifconfig command will be used for this purpose and requires the addition of the -a option because the adapter is currently down. The ifup command can be used to bring up an interface but does not display information by default. The netstat command displays information about the network but not with the -n option.

  3. D. Private IP addresses are found within the 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 ranges, making an address in the 143 range a public IP.

  4. C. The route command is used for this purpose, and adding a route is done with the add option. The default gateway is added using the default gw keywords followed by the IP of the gateway and the adapter.

  5. A. The host command enables changing of the query type with the -t option. Using ns as the type will query for the name servers for a given domain. There is no all type, and the other options are also invalid.

  6. B. Traditionally, udp/53 is used for DNS queries, but with a primary and secondary server it is assumed that zone transfers may occur. DNS zone transfers typically take place over tcp/53.

  7. B. The -I option enables the choice of interface. A lowercase -i option sets the interval, whereas -a indicates an audible ping. Finally, -t enables a time-to-live (TTL)-based ping only.

  8. D. A /27, with a netmask of 255.255.255.224, splits a subnet into four segments of 32 addresses, thus enabling 30 usable addresses.

  9. A. The host or dig commands can be used for this purpose by setting the type to mx. The mx type will query for the mail exchanger for the given domain. There is no smtp type.

  10. B. The localhost address for IPv6 can be written as ::1. Addresses shown like 127 represent the IPv4 localhost range but are not written properly for IPv4 or IPv6.

  11. A. The -T option causes traceroute to use TCP packets. This option, which requires root privileges, can be helpful for situations where a firewall may be blocking traceroute traffic. The -i option chooses the interface, whereas -s chooses the source address. A lowercase -t option sets the Type of Service (ToS) flag.

  12. C. The ifup command is used to bring up network interfaces, and the -a option brings up those interfaces marked as auto. Likewise, ifdown can be used to turn off network interfaces. The ifconfig -a command displays information on all interfaces, and there is no ifstat command.

  13. D. The hostname command is used to return the hostname and domain. When given the -d option, just the domain name is returned to STDOUT, thereby making it appropriate for use in a script.

  14. A. The ip command with the monitor option/subcommand will display netlink messages as they arrive. There is no netlink subcommand for ip, and the route command will not work for this purpose.

  15. D. The -6 option, as in traceroute -6, executes an IPv6 traceroute. The other options shown for this question are not valid. It would be rare for the traceroute6 command to not be available and still have the traceroute -6 command available.

  16. A. The syntax is database: databasename with additional database names separated by spaces, as shown in the correct option for this question.

  17. A. The @ symbol is used to indicate a server to which the query will be sent directly. This can be quite useful for troubleshooting resolution problems by sending the query directly to an authoritative name server for the domain. Of the other options, -t sets the type and the others are not valid.

  18. D. SNMP traffic takes place on ports 161 and 162. Though the traffic is usually on UDP, the TCP ports are also reserved for SNMP. Ports 110 and 143 are used for POP3 and IMAP, respectively, whereas 23 and 25 are telnet and SMTP. Finally, ports 80 and 443 are HTTP and HTTPS.

  19. A. The getent command is used for working with NSS databases, and getent hosts will display the available hosts using the databases configured in /etc/nsswitch.conf.

  20. D. A /25 in CIDR notation represents half of a /24 in address space, therefore making 255.255.255.128 the masked bits. The 255.255.255.0 option is /24, whereas 255.255.255.192 is a /26. Finally, 255.255.0.0 is a /16.

  21. C. The configuration option is called nameserver, and the value for the option is the IP address of the desired name server. There are several options that affect how name resolution is performed, such as the number of attempts and timeout. Also, the order in which name servers appear affects in which order the name servers are queried. See resolv.conf(5)for more information.

  22. D. The /etc/services file contains standard port-to-protocol information based on the well-known and assigned ports from the Internet Assigned Numbers Authority (IANA). If you’d like to provide a custom name for the service, you can do so by editing this file. There is no /etc/ports or /etc/p2p file by default, and /etc/ppp is usually a directory for the Point-to-Point protocol daemon and related services.

  23. A. The route command can be used for this purpose, and the syntax includes the network range, denoted with the -net option, followed by the word netmask and the masked bits, followed by the lettersgw and the IP of the gateway. The other options shown are invalid for a variety of reasons, including missing keywords and options and order.

  24. C. The -a option displays statistics for each socket, both listening and non-listening. Included in this information is the send and receive queues. This information can be used to gauge performance and potential bottlenecks.

  25. A. The correct format is the IP address followed by canonical hostname followed by any aliases for the host. You can use entries in /etc/hosts to override DNS lookups, which can be useful to prevent those names from resolving or to provide a different resolution.

  26. C. The ifconfig command for configuring interfaces begins with the device followed by the IP address, which is then followed by the netmask keyword and the netmask you want to add. Because this is a /24, the netmask is 255.255.255.0.

  27. C. IPv4 addresses are 32 bits in length and IPv6 addresses are 128-bits. Both IPv4 and IPv6 can be used on internal and external networks alike, and subnetting is indeed necessary with IPv6.

  28. D. ICMP is a layer 3 protocol, meaning that it does not use ports for communication. TCP/43 is used for whois whereas port 111 is used for sunrpc. UDP/69 is used for the TFTP protocol.

  29. B. The ip route command can be used for this purpose, and its syntax uses a change command and the via keyword. The same operation could be completed with the route command but would require deleting the existing gateway first and then re-adding a new default gateway.

  30. C. Secure Shell (SSH) operates on TCP port 22 by default. TCP/23 is used for telnet, TCP/25 is used for SMTP, and TCP/2200 is not associated with a well-known service.

  31. B. The nc command is used to start netcat and the -l option causes it to listen. The -p option is used to specify the port on which netcat will listen. The -s option specifies the local source address and is not used for this scenario.

  32. A. The soa type is used to query for Start of Authority records for a domain. Note that in many cases, dig will attempt to look up the domain within a given command and may not appear to have had an error. For example, when running option D (dig -t auth example.com) you will receive information about example.com and there will be a line in the output that dig has ignored the invalid type of auth.

  33. A. The search option is used for this purpose and can be provided with multiple domain names, each separated by a space or tab. The domain option is valid within /etc/resolv.conf but does not allow for multiple domain names. On newer systems, systemd-resolved has taken over for the /etc/resolv.conf file.

  34. C. The ping6 command is used to ping IPv6 addresses. Unique local addresses are the IPv6 equivalent of RFC 1918 private addresses in IPv4. In IPv6, fc00::/7 is the unique local address space. Note that there is no -6 option to the normal ping command.

  35. A. The route command can be used for this purpose, and in the scenario described, a reject destination is used for the route. The other options shown are incorrect because they use invalid options to the route command.

  36. B. The tracepath command provides the maximum transmission unit (MTU) of the hops where possible. Both traceroute and tracepath can be used internally or externally, and both provide IPv6 capabilities, though traceroute6 and tracepath6 provide IPv6 capabilities as well. Certain options with the traceroute command can require root privileges, but not enough information was given in the question for that to have been the correct option.

  37. D. The -c option provides the count of the number of pings to send. The -n option specifies numeric output only, whereas -p specifies the pattern to use for the packet content. Finally, the -t option sets the TTL.

  38. A. The nmcli command provides a command-line interface suitable for working with NetworkManager through a terminal or SSH connection. The nmtui command provides a curses-based interface that also works through a terminal or SSH connection.

  39. A. The syntax for ifconfig uses the device—in this case followed by the protocol inet6—and then the keyword add to indicate that an additional IP address is being added, followed finally by the address itself.

  40. C. LDAP over SSL, or LDAPS, operates on port 636. Port 53 is used for DNS, port 389 is used for normal, non-SSL LDAP, and port 443 is used for HTTP over SSL.

  41. D. The best option for this question is to add an entry for the host in /etc/hosts. Doing so will always cause DNS queries to resolve to 127.0.0.1. The other options are not as robust because they rely on www.example.com always having the same IP address, or the solutions require additional maintenance to constantly add new IP addresses if www.example.com’s IP address changes.

  42. A. The ip route flush cache command should be executed after changing the routes. The other commands shown for this question are not valid.

  43. A. SPF records are stored in the txt record type in DNS, making -t txt the correct option for this. Of the other options, only -t mx is valid and returns the mail exchangers for the given domain.

  44. B. TCP is a connection-oriented protocol that uses a three-way handshake to establish a connection. ICMP does not use ports for communication, and UDP is connectionless. IP is the core Internet Protocol and does not use a handshake.

  45. D. There are 1,048,576 IP addresses in the 172.16.0.0 private range. There are 16,777,216 in the 10.0.0.0 range and 65,536 in the 192.168.0.0 range.

  46. C. The only viable possibility of those listed is that ICMP traffic is blocked. TCP traffic is obviously passing because of the ability to get there using HTTP, and DNS must also be working.

  47. C. The G signifies a gateway within the route table.

  48. A. The axfr type is a zone transfer, and the @ symbol signifies the server to which the query will be sent. There is no xfer type, and option B is just a normal query for the domain sent to the specified server.

  49. D. The netstat -s command displays aggregate statistical information for networking, including the total packets received and the number of packets forwarded. The ifconfig command does not show packets forwarded. The ls command is not used for networking, and the ipstat command does not exist.

  50. C. The ip command defaults to the inet family if not otherwise specified with the -f option. The command will attempt to guess the correct family and fall back to inet. The other families listed as options for this command are not valid for use with the ip command.

  51. B. The ifconfig command will be used for this purpose, followed by the interface. The hw keyword is used for the hardware address, which is then followed by the hardware class, in this case ether. That is followed by the new MAC address (not depicted in the options). The other commands are not valid.

  52. D. The -n option causes route to use numeric values only, performing no name resolution. This option is useful for the scenario described. The -e option causes the output to be in netstat format. There is no -d or -f option for the route command.

  53. A. Because we’re working with MAC addresses, the arp command will be used. The -d option removes or deletes an Address Resolution Protocol (ARP) entry, which would be appropriate here so that the MAC address resolution occurs again. The netstat command will not be used for this purpose. The hostname and dig commands work with name resolution but not for MAC addresses or the ARP table.

  54. A. The iw command will be used for this purpose. When using iw with a specific device, the dev keyword appears next, followed by the device name and then the command you want to execute on that device. In this case, the link command is used.

  55. B. The iwconfig command, which is similar to the ifconfig command, works with an individual wireless interface to set and display parameters. Of the other commands, the ifconfig command is valid but not used for wireless. The other commands are not valid.

  56. C. The iwlist command will be used for this purpose, and the scan subcommand is used to look for local access points and wireless networks. Superuser privileges are required for a full scan. The iwconfig command does not have a scan subcommand. Likewise, there is no subcommand called get for the iwlist command, and there is no iw-scan command.

  57. B. NTP listens on UDP port 123 by default. Ports 20 and 21 are used for FTP services, port 139 is used by NetBIOS, and port 5150 is not usually used.

  58. B. The mtu can be used to set the value for the maximum transmission unit (MTU) for a given interface. The metric option sets the interface metric. The other options are not valid.

  59. A. The -s option creates an ARP table entry. The -d option removes an entry. The -c and --add options do not exist.

  60. A. The ss command provides many of the same functions as netstat but can show some extended information, such as memory allocation for a given socket. The free command shows memory usage but not by socket, and the other two commands do not exist.

  61. D. The -f option is a flood ping. This will effectively cause the interface to send and receive large amounts of traffic, usually making it easier to find on a switch. The -a option is an audible ping, emitting a sound on ping. The -c option sends a certain count of pings, and there is no -e option.

  62. B. The netcat command provides a method for opening and communicating on both sides, server and client, for a TCP connection. The netcat command avoids some of the issues with telnet capturing characters specific to the Telnet protocol. The netstat command does not test connectivity, and ping does not do so at the TCP level. There is no nettest command.

  63. C. The -D option lists the interfaces on a given computer. The -d option dumps compiled matching code, and -i selects an interface. There is no -a option.

  64. A. The ping6 command performs the same as the IPv4 ping command but does so for IPv6. The other commands are not valid on Linux.

  65. B. The ip command can be used for this purpose. When using it with the addr object and the -6 option, only information about IPv6 addresses will be shown. The first option, simply ip addr, will show all addresses, including IPv4. The other commands are not valid.

  66. A. The ifconfig command will be used for this purpose, and ARP can be disabled by preceding the word arp with a minus sign, as shown. If no minus sign is present, then ARP will be enabled. The other commands will not work for this scenario.

  67. C. The dev option specifies the device to use for the route being specified. This is a typical use case for many routes to reduce the chance of the kernel guessing incorrectly. The other options shown for this question are not valid.

  68. C. The -p option shows the process IDs associated with a given socket within the ss output. The -a option is all sockets, whereas -l is listening sockets. The -f option is used to specify the protocol family.

  69. C. The -I option tells traceroute to use ICMP for requests. The -T option is TCP SYN. The -A option performs AS path lookups, and the -i option configures traceroute to use the specified interface.

  70. C. Internally, the hostname command uses gethostname. This can be useful to know when troubleshooting address resolution issues such as conflicting results for host naming. The other functions are not valid.

  71. A. The grep command used with the -i option makes the grep case insensitive. When used with the -v option, grep will exclude the argument, thus doing the opposite of what’s needed here. The kernel ring buffer will probably not contain information about DHCP, making dmesg an incorrect option.

  72. B. Only alphanumerics, minus/dash, and dot are valid for hosts in /etc/hosts.

  73. B. Options within /etc/resolv.conf are preceded with the options keyword followed by one or more options, such as debug.

  74. D. The journalctl command will be used for this purpose. Adding the -u option specifies the unit for which journal entries are desired.

  75. A. The /etc/hostname file typically contains only the hostname of the local computer rather than the hostname and domain name. This is then read at boot time to set the hostname for the computer. The /etc/hosts file contains information on various hosts for name resolution purposes. The other files do not exist.

  76. B. The traceroute6 command is used for tracing IPv6 routes. The other commands do not exist.

  77. D. The axfr type can be used with dig to request a zone transfer. The client from which you request the zone transfer will need to be authorized to initiate a transfer.

  78. A. Setting -a as an option to the host command sets the query type to ANY. The -c option sets the class, and -d turns on debugging. There is no -b option.

  79. C. The .digrc file, when created in a user’s home directory, can be used to set defaults for use of the dig command. There is no dig configuration file found in /etc.

  80. D. POP3 servers do not have a specific type in DNS. MX type indicates mail exchanger, or SMTP server.

  81. A. The ip addr add command is used to add IP addresses to interfaces using the syntax shown in option A. The other options do not have the correct syntax.

  82. B. The resolvectl command is used for assistance with resolution issues for systemd-resolved and, when given the status command, will return the DNS settings. The other options shown do not exist. The resolvectl command is somewhat new, and if it’s not yet available on a given systemd-based distribution, then systemd-resolve --status can be used.

  83. A. The nmcli command is the only valid NetworkManager command shown as an option, and when given the networking on command, NetworkManager will control the network interfaces. It is worth noting that if you disable NetworkManager control with networking off then all of the previously managed interfaces are disabled.

  84. B. NXDOMAIN is the status for a nonexistent domain or host, basically that the host for which the query was sent does not exist. A normal status when there has not been an error is NOERROR.

  85. C. The systemd-networkd daemon can be used to manage networking through systemd. The other options shown are not valid.

  86. B. The set-hostname command within hostnamectl sets the hostname of the device. The other commands shown are not valid for use with hostnamectl.

  87. A. IMAPS uses port 993 by default, as defined by IANA. Port 995 is POP3S, port 465 is SMTPS, and port 514 is used by syslog.

  88. B. The -o option removes newlines from the output, making the output more suitable for the grep command. The -l option specifies the number of loops for the ip addr flush command, the -f option specifies the protocol family, and there is no -n option.

Chapter 10: Topic 110: Security

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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.

  11. 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.

  12. 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.

  13. 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.

  14. 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.

  15. 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.

  16. 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.

  17. A. The correct format is YYYY-MM-DD for the usermod command.

  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. 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.

  23. 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.

  24. 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.

  25. 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.

  26. 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.

  27. 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.

  28. C. The maxlogins parameter is used to control the number of simultaneous logins for a given account.

  29. 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.

  30. 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.

  31. 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.

  32. 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.

  33. A. The --gen-key subcommand is used for the purpose described. The other options shown do not exist.

  34. A. The --sign option is used to sign files and documents with gpg. The other options shown are not valid for signatures.

  35. 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.

  36. 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.

  37. 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.

  38. 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.

  39. 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.

  40. 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.

  41. 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.

  42. 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.

  43. B. The pubring.gpg file, found in ~/.gnupg/, contains the public keyring.

  44. 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.

  45. 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.

  46. 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.

  47. 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.

  48. 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.

  49. 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.

  50. 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.

  51. 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.

  52. 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.

  53. 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.

  54. 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.

  55. 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.

  56. 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.

  57. B. The ssh-add command adds keys to ssh-agent. The other commands shown are not valid.

  58. 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.

  59. 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.

  60. 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.

  61. B. The access_times configuration item sets the times in which access is allowed. The other configuration options shown are not valid.

  62. 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.

  63. 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.

  64. 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.

  65. 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.

  66. C. The server host key provides a means by which clients can verify that the server host key has not changed.

  67. 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.

  68. 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.

  69. 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.

  70. 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.

  71. 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.

  72. 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.

  73. D. The % is used to denote a group within /etc/sudoers and provides an excellent way to facilitate an administrative privileged group.

  74. 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.

  75. 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.

  76. C. The /etc/nologin file prevents login when present and can also contain a message that is displayed to users when attempting to login.

  77. 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.

  78. 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.

  79. 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.

  80. 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.

  81. 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.

  82. A. The User_Alias option enables specification of a group of users for use elsewhere within the sudoers file.

  83. 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.

  84. C. The UserKnownHostsFile configuration option enables specification of the location and filename for the known hosts file for users.

  85. 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.

  86. 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.

  87. 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.

  88. 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.

Chapter 11: Practice Exam 1

  1. B. The /proc filesystem stores information about running processes on the system. The /etc filesystem is used for configuration information, and /dev is used for device information. The /environment filesystem does not exist on a default Linux system.

  2. C. The /etc/modprobe.d directory contains information related to the modprobe configuration. This can be overridden with the -C option on the command line.

  3. A. The -g option to wall sends the input to the specified group. Answer B will send the output to all users, whereas answers C and D will not work.

  4. B. The -e option to dmesg displays the time in a localtime and the delta in a format that is typically easier to work with. The -rel option does not exist. The -f option specifies the logging facility, and -t does not display time at all.

  5. B. The init process is typically associated with the initial process ID of 1 to indicate that it is the process from which others are spawned. Killing PID 1 will typically and immediately halt the system.

  6. C. The lspci command shows the PCI devices in the system, and the -k option shows the kernel driver being used by the given device. The lsusb command will not accomplish the task requested and the ls command with -pci will not display the correct information. There is no showpci command.

  7. C. The --no-wall option will cause telinit to not send a wall command to logged-in users about the state change. The other options listed in this question do not exist.

  8. A. The class/net hierarchy within /sys contains information on the network configuration for the computer. It is a symlink to the devices hierarchy, where the device will be listed by its address rather than the logical eth0 name.

  9. B. The SIGTERM signal is the default signal sent with the systemctl kill command.

  10. D. A logical location to begin troubleshooting is within the system BIOS to ensure that the drive is being detected by the computer.

  11. C. The dbus-monitor program, which requires an X display, can be used to monitor dbus. The other programs and options listed for this question do not exist.

  12. A. The udevd service is called systemd-udevd.service within a systemd environment.

  13. A. The system can be scheduled to shut down at a certain time, and that time should be entered in 24-hour format, as shown in the answer.

  14. C. The -s option changes the signal to be sent from its default of SIGTERM. The new signal must be one of the main signal types, such as SIGINT or SIGSTOP.

  15. D. The list-unit-files command will show the files available, whereas --type=service will limit those files to the services, in the same way that chkconfig --list returns a list of services.

  16. A. The -C option sets the location of the cache to be updated instead of the default /etc/ld.so.cache. The lowercase option, -c, changes the format of the cache, whereas -v sets verbose mode. The --f option does not exist.

  17. C. The -P option to dpkg will purge a package from the system, including the configuration files associated with the package. The apt-cache clean command cleans the package cache but not an individual package, and the apt-get remove command removes a package but not the associated configuration files.

  18. C. The deb-src prefix is used to indicate that a given repository contains source packages. The deb prefix in option A would indicate normal packages. The other options are not valid.

  19. B. The -U option is used to upgrade a package. Adding -v for verbose and -h for hash marks will print additional information and progress, as requested by the problem.

  20. A. The -y or --assumeyes option will do what it says: Assume that you will answer “yes” and therefore not prompt. The other options do not exist.

  21. A. The exclude option within /etc/yum.conf is a space-separated list of packages that accepts wildcards and is a list of packages that cannot be installed or upgraded. The other options listed in this question do not exist.

  22. C. The ldconfig command is used to work with the library cache, and the -p option prints the directories and libraries in the cache. The -C option tells ldconfig to use a different cache. The ldd command prints the library dependencies for a given command, but the options given don’t exist for ldd.

  23. D. The baseurl option is used to set the URL and must be fully qualified, meaning that it must include the protocol, such as http:// or file://.

  24. B. The apt-cache dump command will display a listing of the available packages and their respective dependencies. The other commands and options listed in this question do not exist.

  25. A. The /boot directory almost certainly exists but has not been partitioned into its own space. The /boot partition would not be hidden from lsblk if it was indeed a separate partition.

  26. B. The /var/cache hierarchy contains cached data for both package management tools—in the case of yum, in /var/cache/yum, and in the case of a Debian-based system, in /var/cache/apt.

  27. A. The master boot record (MBR) is the typical location for the boot loader to be stored on a BIOS-based system.

  28. D. The / filesystem is the root filesystem. If separate partitions have not been created, the / filesystem will be the beginning of the hierarchy and will contain all other directories in the same partition.

  29. A. The --output option configures the location for output of the command instead of STDOUT.

  30. A. The dd command is used for this purpose, and for this case it takes an input file with the if option and an output destination with the of option. The bs option signals that the block size for writing should be 1 megabyte.

  31. D. The history command displays history from the current session and can be used for the purpose described. The .bash_history file is written on session close, by default.

  32. C. The --boot-directory option will install the boot images into the directory specified. This might be helpful for nonstandard installs or at times when you need to mount the boot partition separately. The other options listed in this question do not exist.

  33. A. The update-grub command should be executed in order to make changes take effect in the menu and when changes have been made to the GRUB configuration. The other commands listed in this question do not exist.

  34. B. The export command is used for this purpose and accepts a name=value pair, as shown in the answer. The other commands are not valid with the exception of the echo command, which will simply echo the argument to the console.

  35. C. The HISTFILESIZE option configures the number of commands to keep in the history file. The other variables are not valid within Bash.

  36. D. The -b option configures the body numbering format for nl, which by default will not number blank lines. The a format option will number all lines, including blanks. The -a option is not valid for the nl command, and the -n option configures the numbering format and would require an additional argument in order to be valid.

  37. D. The od command is used to create octal output. The cat command will show the file as it exists on disk. The other two commands are not valid.

  38. A. The pr command formats text for printing, including the date and page numbers at the top of each page. Adding the -d option causes the output to be double-spaced. The cat command will display output but not paginated in such a way. The other two commands are not valid.

  39. A. The -n option is used to change the number of lines. Adding the +N after the -n option begins the tail process at the Nth line within the file.

  40. C. The -i option causes the unique test to be done while ignoring the case of the element to be matched.

  41. C. The awk command shown can be used for this purpose. The -F option sets the field separator, and the OFS option sets the output field separator.

  42. C. The -a option is equivalent to the -d and -R options, which preserve links and copy recursively, respectively. The -b option creates a backup, and -f forces the copy.

  43. A. When in command mode, typing a number followed by an uppercase G will immediately move the cursor to that line number. The /23 option will search for the number 23 in the file. The i23 option will insert the number 23, and finally ZZ will exit Vi.

  44. A. The -d option changes the update interval and can be helpful on a busy system where top may be affecting performance. The -n option sets the number of iterations to run. There is no -t or -f option for top.

  45. B. The ps -e command is used to display all processes, and the -o option configures the columns to display.

  46. A. The grep command will be used for this purpose. Note the difference between grep -r and grep -ri. The question did not ask for case insensitivity, and therefore the use of -i in option B makes it incorrect.

  47. B. The find command will be used for this purpose. Setting the directory from which to begin the find is required, along with the expression, which in this case, are files beginning with DB.

  48. B. Load average information is gathered from /proc/loadavg, whereas uptime information is stored on /proc/uptime.

  49. D. Interactive repair is the default, so no option is required. The -f option forces the operation, and -y and -a are both variations of noninteractive repair.

  50. D. The /etc/mtab file is updated dynamically as filesystems are mounted and unmounted. The /etc/fstab file is not dynamically updated.

  51. B. The -B option changes the format, and T sets the scale to terabytes. The -T option alone prints the filesystem type. The other options do not exist.

  52. A. The e2image program can be used to create an image of metadata that can help with drive recovery. The resulting image file can be used with programs like dumpe2fs and debugfs.

  53. C. The -c option checks for bad blocks. The -b option sets the block size. There is no -a or -d option.

  54. B. The chown command is used for this purpose and can be used to set both the user and group for ownership.

  55. A. The ssh-keyscan command can be used for the purpose described and can help with virtual machine deployment by obtaining the SSH host key and adding it to the known_hosts file.

  56. C. The GRUB_RECORDFAIL_TIMEOUT option is used to configure the behavior of the system in the event of a failed boot. Setting the value to -1 will display the GRUB menu and not continue booting. Setting the value to 0 will cause the menu to not display. Setting to a value greater than or equal to 1 will cause the menu to display for that many seconds.

  57. A. The -s option displays a summary, and -h displays it in a human-readable format.

  58. D. The -L option tells find to follow symlinks. The -H and -P options are both variations to tell find not to follow symlinks, and the -S option does not exist.

  59. A. The -a option appends to the file rather than overwriting when using tee. The other options do not fulfill the needs of the problem statement.

  60. C. The /etc directory and its subdirectories typically contain configuration files that would be necessary in order to re-create the system in a restoration scenario. The /var directory usually contains variable information, whereas /opt may be used for several other purposes. The /bin directory contains binaries that can usually be reinstalled.

Chapter 12: Practice Exam 2

  1. A. The /etc/hosts.deny file is part of TCP wrappers along with /etc/hosts.allow. Both provide a basic mechanism for configuration of access from remote hosts to network services.

  2. C. The alias command uses the alias name followed by an equal sign followed by the command to be aliased. In this case, because the command to be aliased contains spaces, it needs to be contained in quotation marks.

  3. C. Shell scripting syntax uses the format shown, with square brackets around the condition to the tested and double-equal signs for a string test. Variables are preceded by a dollar sign as shown.

  4. A. The export command is necessary so that any variables that are manually defined in your current session become available to child processes. The source command executes the file and can be used for the purpose described but requires an additional argument. The let and def commands are not valid.

  5. C. The source command is the functional equivalent of a single dot (.). The set command exists but is not used for this purpose. The other commands are not valid.

  6. A. The syntax for setting the PATH separates the new path with a colon, as shown in the correct option. A primary difference between the correct and incorrect options for this question was in how the actual specified path was shown.

  7. A. The correct syntax is as shown. Note that a semicolon is required when the commands are included on one line, as displayed in the answer.

  8. C. The mail command with -s for the subject is necessary, followed by the email address for the mail. Then, input is redirected to the mail command using /etc/hostname.

  9. C. The /etc/skel directory contains files that are a skeleton of a user’s home directory when their account is created. The other directories listed do not exist by default.

  10. D. The Universal Access section, which can be found by typing Universal Access from within an Ubuntu GUI interface, enables configuration of accessibility options.

  11. B. The kbdrate command is used for the purpose described and can help with accessibility. The other commands shown are not valid.

  12. A. The DISPLAY variable controls the destination and screen for displaying GUI applications. Setting this variable facilitates forwarding of X applications over ssh.

  13. B. The xhost command is used to control who can make connections for both users and hosts to a given X server. The other commands are not valid.

  14. B. The -f option sets the days between expiration and disabled for an account. The -g option is used to set the group ID, whereas -e is used to set the overall expiration date.

  15. A. The getent command can be used for the purpose described and will display the aliases on the server by examining the aliases database. The other commands are not valid and, in the case of the mail command shown, will simply attempt to send mail to an address known as aliases.

  16. C. The ALL: ALL syntax will cause all hosts to be denied. This means that you must explicitly authorize hosts and networks using /etc/hosts.allow.

  17. B. The current at jobs for all users are shown when atq is executed as superuser.

  18. C. The -r option to the crontab command removes all cron entries for a given user. The -l option lists cron jobs, whereas the -e option edits the crontab. There is no -d option.

  19. A. The -u option specifies the user. The -l option lists the cron jobs and -e edits them. There is no -d or -m option.

  20. A. The userdel command, given no other options, does not delete the home directory. When given the -r option, the command will delete the home directory and mail spool file. There is no -h or -p option for the userdel command.

  21. D. The -gid option is used to specify group ownership for the find command. The -group option does exist, but since the question specified that the group had already been deleted, the gid must be used instead. There is a -name option, but it searches by name and not group ID.

  22. B. The groupmod command will be used for this purpose, and the -n option followed by the new group name is used to change the name. There is no groupchg command.

  23. D. The journalctl command is used to view and parse log file entries on systemd-based systems that maintain logs in a special format. The logger command can be used to create log entries, and the other commands shown do not exist.

  24. A. The -o option followed by either 1 or 2 enables ntpdate compatibility with older NTP servers. The default, when no -o option is specified, is version 3. The -v option tells ntpdate to be verbose, whereas the -e option sets the authentication timeout.

  25. D. The /var/log/journal directory is used to store journal log files for systemd-based systems. The other directories do not exist by default.

  26. C. The -m option sets the mail program to use when mailing logs. It is set to /usr/bin/mail -s by default. There is no -o option, and -v is verbose. The -s option to the logrotate command sets the state file to use.

  27. A. The -u option configures the output to UTC regardless of the time zone. The -s option sets the time, and there is no -v or -t option.

  28. D. The lprm command is used to remove print jobs on a system that uses the lp system for printing. There is no lpdel or rmprint command. There is an rm command, but it’s not used for working with print queues.

  29. D. The 255.255.254.0 subnet mask is equivalent to /23. The 255.255.255.0 subnet mask is /24. The subnet mask 255.255.255.255 is /32, and 255.255.0.0 is /16.

  30. A. The /etc/hosts file will be examined first, and then a Domain Name System (DNS) query will be sent based on the configuration shown.

  31. D. Standard LDAP traffic is TCP port 389 on the server. TCP port 25 is SMTP, 443 is HTTPS, and 143 is IMAP.

  32. C. The -l option to ssh changes the username sent for authentication. This can be useful for scripting scenarios where the @ notation cannot be used. The -v option is verbose mode, and -i is the identity file to use. There is no -u option.

  33. D. The -n option disables name resolution for addresses involved in the ping request/reply. The -D option returns a time stamp, whereas -d sets the SO_DEBUG option. Finally, -f is a flood ping.

  34. A. The ifconfig command shows various statistics about the interfaces on a Linux system, including whether the interface is up or down, its packets and bytes, queue length, and other information. The other commands listed do not exist.

  35. C. The -C option shows the SOA for each of the DNS name servers listed as authoritative for the domain. The -a option sends an ANY query, whereas -N sets the number of dots for the domain to be considered absolute. There is no -n option.

  36. A. The entire 127.0.0.0/8 range is available for local host addresses. Therefore, an answer would need to be in this range. The proper format for /etc/hosts is IP address followed by name, followed by optional aliases, which makes option A correct.

  37. C. The --ignore-errors option tells ifup to continue even if there are otherwise fatal errors. The -h option outputs help. There is no -C or --continue option.

  38. C. The -u option unlocks an account that was locked using the -l option. The -w option sets the warn days, and -S prints the status.

  39. C. When connecting to an alternate port, you can use the -p option to set the port or use a colon to separate the host from the port.

  40. B. The mailto configuration option sets the destination for emails related to sudo. The other options listed are not valid for sudo.

  41. B. The who command displays who is currently logged in and the date and time they logged in. The whois command displays information about domains. The other commands are not valid.

  42. C. Port 123 is used for NTP communication by default. Port 161 is SNMP, 139 is NetBIOS, and 194 is IRC.

  43. D. A UDP scan can be initiated with -sU. A scan of -sT is a normal TCP scan, and -sS is a SYN scan. There is no -sP option.

  44. B. The +D option is used to search an entire directory tree for files that are open by processes. The -d option does essentially the same thing but does not go into subdirectories. The -f option is typically used in combination with other options to control path name interpretation. The -i option lists files or processes with open ports.

  45. C. The -r option causes the ip command to attempt to resolve IP addresses. The -f option specifies the protocol family. There is no -n or -a option to the ip command.

  46. A. The ss command will be used, and when given the -o option, timer information is displayed. The netstat -rn command shows route information but not sockets or timing, and ping -f is a flood ping and not related. The ls -l command displays files in a long listing format.

  47. C. All of the addresses shown are in private ranges. The only one with the correct netmask is 255.255.255.0, which is equivalent to 24 masked bits.

  48. C. The !H sequence indicates host unreachable. Network unreachable is !N.

  49. D. There is no port for ICMP. The protocol itself does not use ports.

  50. B. The /etc/services file contains the port number to name translation for a given server. The file contains well-known ports and can be customized on a per-server basis.

  51. A. The command shown launches speech output for Orca. The other commands contain options that are invalid and thus will not work.

  52. A. The configuration files can be found in the /etc/lightdm hierarchy or in /usr/share/lightdm. The other directory locations do not exist by default.

  53. D. The xwininfo command is used to gather information about windows. The other commands shown are not valid.

  54. A. The tzconfig command can be used on a Debian system to set the time zone. The other commands listed do not exist.

  55. C. The locale command will be used for this purpose, and the -m option displays the available character maps. There is no charmap or mapinfo command.

  56. B. Time zone information is found within the /usr/share/zoneinfo hierarchy. The other directories listed do not typically exist by default.

  57. A. The default location on a Red Hat system is /var/lib/ntp/drift. The other locations shown do not exist by default. Within /etc/ntpd.conf, the location of the drift file can be changed with the driftfile option.

  58. C. The <<< character combination reads input from STDIN or standard input and uses it as the body of the message for the mail command.

  59. C. The groupdel command is used to remove a group from a system. No members of the group can remain or the command will fail.

  60. C. The lpr syslog facility sends messages from the lp subsystem to syslog. The auth facility is used for security-related messages. The other listed options are not syslog facilities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset