Free preview mode

Enjoy the free questions and consider upgrading to gain full access!

XK0-005Free trialFree trial

By comptia
Aug, 2025

Verified

25Q per page

Question 26

A systems administrator is tasked with setting up key-based SSH authentication. In which of the following locations should the administrator place the public keys for the server?

  • A: ~/.sshd/authkeys
  • B: ~/.ssh/keys
  • C: ~/.ssh/authorized_keys
  • D: ~/.ssh/keyauth

Question 27

A Linux administrator needs to create a new user named user02. However, user02 must be in a different home directory, which is under /comptia/projects. Which of the following commands will accomplish this task?

  • A: useradd -d /comptia/projects user02
  • B: useradd -m /comptia/projects user02
  • C: useradd -b /comptia/projects user02
  • D: useradd -s /comptia/projects user02

Question 28

One leg of an LVM-mirrored volume failed due to the underlying physical volume, and a systems administrator is troubleshooting the issue. The following output has been provided:

Image 1

Given this scenario, which of the following should the administrator do to recover this volume?

  • A: Reboot the server. The volume will automatically go back to linear mode.
  • B: Replace the failed drive and reconfigure the mirror.
  • C: Reboot the server. The volume will revert to stripe mode.
  • D: Recreate the logical volume.

Question 29

A systems administrator created a new Docker image called test. After building the image, the administrator forgot to version the release. Which of the following will allow the administrator to assign the v1 version to the image?

  • A: docker image save test test:v1
  • B: docker image build test:vl
  • C: docker image tag test test:vl
  • D: docker image version test:v1

Question 30

A Linux systems administrator receives a notification that one of the server’s filesystems is full. Which of the following commands would help the administrator to identify this filesystem?

  • A: lsblk
  • B: fdisk
  • C: df -h
  • D: du -ah

Question 31

A systems administrator is notified that the mysqld process stopped unexpectedly. The systems administrator issues the following command:

sudo grep –i -r ‘out of memory’ /var/log
The output of the command shows the following:
kernel: Out of memory: Kill process 9112 (mysqld) score 511 or sacrifice child.
Which of the following commands should the systems administrator execute NEXT to troubleshoot this issue? (Select two).

  • A: free -h
  • B: nc -v 127.0.0.1 3306
  • C: renice -15 $( pidof mysql )
  • D: lsblk
  • E: killall -15
  • F: vmstat -a 1 4

Question 32

Users have reported that the interactive sessions were lost on a Linux server. A Linux administrator verifies the server was switched to rescue.target mode for maintenance. Which of the following commands will restore the server to its usual target?

  • A: telinit 0
  • B: systemctl reboot
  • C: systemctl get-default
  • D: systemctl emergency

Question 33

A systems administrator was tasked with assigning the temporary IP address/netmask 192.168.168.1/255.255.255.255 to the interface eth0 of a Linux server.
When adding the address, the following error appears:

ip address add 192.168.168.1/33 dev eth0

Error: any valid prefix is expected rather than "192.168.168.1/33".
Based on the command and its output above, which of the following is the cause of the issue?

  • A: The CIDR value /33 should be /32 instead.
  • B: There is no route to 192.168.168.1/33.
  • C: The interface eth0 does not exist.
  • D: The IP address 192.168.168.1 is already in use.

Question 34

A Linux user reported the following error after trying to connect to the system remotely: ssh: connect to host 10.0.1.10 port 22: Resource temporarily unavailable
The Linux systems administrator executed the following commands in the Linux system while trying to diagnose this issue:

Image 1

Which of the following commands will resolve this issue?

  • A: firewall-cmd --zone=public --permanent --add-service=22
  • B: systemctl enable firewalld; systemctl restart firewalld
  • C: firewall-cmd --zone=public --permanent --add-service=ssh
  • D: firewall-cmd --zone=public --permanent --add-port=22/udp

Question 35

A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?

  • A: tar -cvzf /dev/sdd1 /dev/sdc1
  • B: rsync /dev/sdc1 /dev/sdd1
  • C: dd if=/dev/sdc1 of=/dev/sdd1
  • D: scp /dev/sdc1 /dev/sdd1

Question 36

A Linux administrator has been tasked with installing the most recent versions of packages on a RPM-based OS. Which of the following commands will accomplish this task?

  • A: apt-get upgrade
  • B: rpm -a
  • C: yum updateinfo
  • D: dnf update
  • E: yum check-update

Question 37

A Linux administrator needs to expand a volume group using a new disk. Which of the following options presents the correct sequence of commands to accomplish the task?

  • A: partprobe vgcreate lvextend
  • B: lvcreate fdisk partprobe
  • C: fdisk partprobe mkfs
  • D: fdisk pvcreate vgextend

Question 38

Which of the following directories is the mount point in a UEFI system?

  • A: /sys/efi
  • B: /boot/efi
  • C: /efi
  • D: /etc/efi

Question 39

A Linux administrator copied a Git repository locally, created a feature branch, and committed some changes to the feature branch. Which of the following Git actions should the Linux administrator use to publish the changes to the main branch of the remote repository?

  • A: rebase
  • B: tag
  • C: commit
  • D: push

Question 40

A Linux administrator needs to obtain a list of all volumes that are part of a volume group. Which of the following commands should the administrator use to accomplish this task?

  • A: vgs
  • B: lvs
  • C: fdisk -1
  • D: pvs

Question 41

A Linux administrator is adding a new configuration file to a Git repository. Which of the following describes the correct order of Git commands to accomplish the task successfully?

  • A: pull -> push -> add -> checkout
  • B: pull -> add -> commit -> push
  • C: checkout -> push -> add -> pull
  • D: pull -> add -> push -> commit

Question 42

A systems administrator is tasked with mounting a USB drive on a system. The USB drive has a single partition, and it has been mapped by the system to the device /dev/sdb. Which of the following commands will mount the USB to /media/usb?

  • A: mount /dev/sdb1 /media/usb
  • B: mount /dev/sdb0 /media/usb
  • C: mount /dev/sdb /media/usb
  • D: mount -t usb /dev/sdb1 /media/usb

Question 43

User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?

  • A: chown user2:accounting script.sh chmod 750 script.sh
  • B: chown user1:accounting script.sh chmod 777 script.sh
  • C: chown accounting:user1 script.sh chmod 057 script.sh
  • D: chown user2:accounting script.sh chmod u+x script.sh

Question 44

A systems administrator needs to verify whether the built container has the app.go file in its root directory. Which of the following can the administrator use to verify the root directory has this file?

  • A: docker image inspect
  • B: docker container inspect
  • C: docker exec <container_name> ls
  • D: docker ps <container_name>

Question 45

A Linux administrator is reviewing changes to a configuration file that includes the following section:

Image 1

The Linux administrator is trying to select the appropriate syntax formatter to correct any issues with the configuration file. Which of the following should the syntax formatter support to meet this goal?

  • A: Markdown
  • B: XML
  • C: YAMLD. JSON

Question 46

When trying to log in remotely to a server, a user receives the following message:

Image 1

The server administrator is investigating the issue on the server and receives the following outputs:

Image 2

Which of the following is causing the issue?

  • A: The wrong permissions are on the user’s home directory.
  • B: The account was locked out due to three failed logins.
  • C: The user entered the wrong password.
  • D: The user has the wrong shell assigned to the account.

Question 47

A systems administrator is investigating an issue in which one of the servers is not booting up properly. The journalctl entries show the following:

Image 1

Which of the following will allow the administrator to boot the Linux system to normal mode quickly?

  • A: Comment out the /opt/app filesystem in /etc/fstab and reboot.
  • B: Reformat the /opt/app filesystem and reboot.
  • C: Perform filesystem checks on local filesystems and reboot.
  • D: Trigger a filesystem relabel and reboot.

Question 48

A Linux systems administrator receives reports from various users that an application hosted on a server has stopped responding at similar times for several days in a row. The administrator logs in to the system and obtains the following output:
Output 1:

Image 1

Output 2:

Image 2

Output 3:

Image 3

Which of the following should the administrator do to provide the BEST solution for the reported issue?

  • A: Configure memory allocation policies during business hours and prevent the Java process from going into a zombie state while the server is idle.
  • B: Configure a different nice value for the Java process to allow for more users and prevent the Java process from restarting during business hours.
  • C: Configure more CPU cores to allow for the server to allocate more processing and prevent the Java process from consuming all of the available resources.
  • D: Configure the swap space to allow for spikes in usage during peak hours and prevent the Java process from stopping due to a lack of memory.

Question 49

A Linux administrator found many containers in an exited state. Which of the following commands will allow the administrator to clean up the containers in an exited state?

  • A: docker rm --all
  • B: docker rm $(docker ps -aq)
  • C: docker images prune *
  • D: docker rm --state exited

Question 50

A Linux administrator reviews a set of log output files and needs to identify files that contain any occurrence of the word denied. All log files containing entries in uppercase or lowercase letters should be included in the list. Which of the following commands should the administrator use to accomplish this task?

  • A: find . -type f -print | xrags grep -ln denied
  • B: find . -type f -print | xrags grep -nv denied
  • C: find . -type f -print | xrags grep -wL denied
  • D: find . -type f -print | xrags grep -li denied
Page 2 of 13 • Questions 26-50 of 302

Free preview mode

Enjoy the free questions and consider upgrading to gain full access!