CompTIA XK0-005 Practice Exams
Last updated on Nov 16,2026- Exam Code: XK0-005
- Exam Name: CompTIA Linux+ Exam
- Certification Provider: CompTIA
- Latest update: Nov 16,2026
A Linux administrator is installing a web server and needs to check whether web traffic has already been allowed through the firewall.
Which of the following commands should the administrator use to accomplish this task?
- A . firewalld query-service-http
- B . firewall-cmd –check-service http
- C . firewall-cmd –query-service http
- D . firewalld –check-service http
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
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:
![]()
Output 2:

Output 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.
A newly created container has been unable to start properly, and a Linux administrator is analyzing the cause of the failure.
Which of the following will allow the administrator to determine the FIRST command that is executed inside the container right after it starts?
- A . docker export <container_id>
- B . docker info <container_id>
- C . docker start <container_id>
- D . docker inspect <container_id>
A Linux administrator is creating a primary partition on the replacement hard drive for an application server.
Which of the following commands should the administrator issue to verify the device name of
this partition?
- A . sudo fdisk /dev/sda
- B . sudo fdisk -s /dev/sda
- C . sudo fdisk -l
- D . sudo fdisk -h
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?
- A . restorecon .ssh/authorized_keys
- B . ssh_keygen -t rsa -o .ssh/authorized_keys
- C . chown root:root .ssh/authorized_keys
- D . chmod 600 .ssh/authorized_keys
A Linux administrator needs to connect securely to a remote server in order to install application software.
Which of the following commands would allow this connection?
- A . scp "ABC-key.pem" [email protected]
- B . sftp rooteiO.0.0.1
- C . telnet 10.0.0.1 80
- D . ssh -i "ABC-key.pem" [email protected]
- E . sftp "ABC-key.pem" [email protected]
During a security scan, the password of an SSH key file appeared to be too weak and was cracked.
Which of the following commands would allow a user to choose a stronger password and set it on the existing SSH key file?
- A . passwd
- B . ssh
- C . ssh-keygen
- D . pwgen
A systems administrator pressed Ctrl+Z after starting a program using the command line, and the shell prompt was presented.
In order to go back to the program, which of the following commands can the administrator use?
- A . fg
- B . su
- C . bg
- D . ed
Which of the following can be used as a secure way to access a remote termi-nal?
- A . TFTP
- B . SSH
- C . SCP
- D . SFTP