CompTIA XK0-005 Exam (page: 11)
CompTIA Linux+
Updated on: 25-Dec-2025

Viewing Page 11 of 61

A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?

  1. visudo -c
  2. test -f /etc/sudoers
  3. sudo vi check
  4. cat /etc/sudoers | tee test

Answer(s): A



A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?

  1. scp ~/.ssh/id_rsa user@server:~/
  2. rsync ~ /.ssh/ user@server:~/
  3. ssh-add user server
  4. ssh-copy-id user@server

Answer(s): D



A Linux administrator created a new file system. Which of the following files must be updated to ensure the filesystem mounts at boot time?

  1. /etc/sysctl
  2. /etc/filesystems
  3. /etc/fstab
  4. /etc/nfsmount.conf

Answer(s): C



A Linux administrator is troubleshooting a memory-related issue. Based on the output of the commands:



Which of the following commands would address the issue?

  1. top -p 8321
  2. kill -9 8321
  3. renice -10 8321
  4. free 8321

Answer(s): B



A systems administrator made some unapproved changes prior to leaving the company. The newly hired administrator has been tasked with revealing the system to a compliant state. Which of the following commands will list and remove the correspondent packages?

  1. dnf list and dnf remove last
  2. dnf remove and dnf check
  3. dnf info and dnf upgrade
  4. dnf history and dnf history undo last

Answer(s): D



An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output:



Which of the following commands would resolve the issue?

  1. restorecon .ssh/authorized_keys
  2. ssh_keygen -t rsa -o .ssh/authorized_keys
  3. chown root:root .ssh/authorized_keys
  4. chmod 600 .ssh/authorized_keys

Answer(s): A



A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?

  1. docker images prune -a
  2. docker push images -a
  3. docker rmi -a images
  4. docker images rmi --all

Answer(s): A



A Linux system is failing to boot with the following error:



Which of the following actions will resolve this issue? (Choose two.)

  1. Execute grub-install --root-directory=/mnt and reboot.
  2. Execute grub-install /dev/sdX and reboot.
  3. Interrupt the boot process in the GRUB menu and add rescue to the kernel line.
  4. Fix the partition modifying /etc/default/grub and reboot.
  5. Interrupt the boot process in the GRUB menu and add single to the kernel line.
  6. Boot the system on a LiveCD/ISO.

Answer(s): B,F



Viewing Page 11 of 61



Share your comments for CompTIA XK0-005 exam with other users:

soheib 7/24/2023 7:05:00 PM

question: 78 the right answer i think is d not a
Anonymous