[May 04, 2025] Fully Updated Linux+ (XK0-005) Certification Sample Questions
Latest CompTIA XK0-005 Real Exam Dumps PDF
CompTIA XK0-005 exam is a certification exam designed for individuals who want to demonstrate their knowledge and skills in Linux administration. XK0-005 exam is the latest version of the CompTIA Linux+ certification and is aimed at IT professionals who are interested in pursuing a career in Linux system administration. XK0-005 exam covers a wide range of topics, including system configuration, management, security, and troubleshooting, among others.
NEW QUESTION # 157
After starting an Apache web server, the administrator receives the following error:
Which of the following commands should the administrator use to further troubleshoot this issue?
- A. ip
- B. nc
- C. ss
- D. dig
Answer: C
Explanation:
The ss command is used to display information about socket connections, such as the port number, state, and process ID. The error message indicates that the port 80 is already in use by another process, which prevents the Apache web server from binding to it. By using the ss command with the -l and -n options, the administrator can list all the listening sockets and their port numbers in numeric form, and identify which process is using the port 80. For example: ss -ln
| grep :80. The ip, dig, and nc commands are not relevant for this issue, as they are used for different purposes, such as configuring network interfaces, querying DNS records, and testing network connectivity.
NEW QUESTION # 158
A systems administrator wants to test the route between IP address 10.0.2.15 and IP address
192.168.1.40. Which of the following commands will accomplish this task?
- A. ip route get 192.163.1.40 from 10.0.2.15
- B. route -n 192.168.1.40 from 10.0.2.15
- C. ip route 192.169.1.40 to 10.0.2.15
- D. route -e get to 192.168.1.40 from 10.0.2.15
Answer: A
Explanation:
The command ip route get 192.168.1.40 from 10.0.2.15 will test the route between the IP address
10.0.2.15 and the IP address 192.168.1.40. The ip route get command shows the routing decision for a given destination and source address. This is the correct command to accomplish the task.
NEW QUESTION # 159
Which of the following specifications is used to perform disk encryption in a Linux system?
- A. NFS
- B. LUKS
- C. TLS
- D. SSL
Answer: B
Explanation:
LUKS stands for Linux Unified Key Setup, which is a specification for disk encryption on Linux systems. LUKS allows users to encrypt partitions or entire disks using a passphrase or a key file.
LUKS also supports multiple keys and key slots, which can be used to unlock the encrypted data.
LUKS is compatible with various tools and utilities, such as cryptsetup, dm-crypt, and LVM.
NEW QUESTION # 160
A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task:
Which of the following technologies is the administrator using?
- A. Terraform
- B. Ansible
- C. Puppet
- D. Chef
Answer: A
Explanation:
The code snippet is written in Terraform language, which is a tool for building, changing, and versioning infrastructure as code. Terraform uses a declarative syntax to describe the desired state of the infrastructure and applies the changes accordingly. The code defines a resource of type aws_instance, which creates an AWS EC2 instance, and sets the attributes such as the AMI ID, instance type, security group IDs, and key name. The code also uses a count parameter to create three identical instances and assigns them different names using the count.index variable. This is the correct technology that the administrator is using. The other options are incorrect because they use different languages and syntaxes for infrastructure as code. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 559.
NEW QUESTION # 161
A new hard drive /dev/sdd was added to a server. Which of the following commands will create a partition table with a single partition /dev/sdd1 that consumes the entire disk?
- A. echo 'type=83' | sudo sfdisk /dev/sdd
- B. sudo fdisk /dev/sdd -1 -t=83
- C. sudo sfdisk /dev/sdd -t=83
- D. echo 'auto' | sudo fdisk /dev/sdd
Answer: A
Explanation:
Step-by-Step Comprehensive Detailed Explanation:
* Command Explanation:The sfdisk tool is used to manipulate partition tables in Linux. Option A creates a single partition on /dev/sdd of type 83 (Linux filesystem).
* type=83 specifies the partition type for Linux.
* The command pipes this configuration to sfdisk to apply it directly to /dev/sdd.
* Why Other Options are Incorrect:
* B: Incorrect syntax; -t is not a valid option for sfdisk.
* C: The fdisk command does not accept this syntax for automatic partition creation.
* D: There is no -1 or -t=83 option in fdisk.
* References:
* CompTIA Linux+ Certification Exam Objectives
* man sfdisk
NEW QUESTION # 162
A systems administrator installed a new software program on a Linux server. When the systems administrator tries to run the program, the following message appears on the screen.
Which of the following commands will allow the systems administrator to check whether the system supports virtualization?
- A. lscpu
- B. sysctl -a
- C. dmidecode -s system-version
- D. cat /sys/device/system/cpu/possible
Answer: A
Explanation:
The command that will allow the systems administrator to check whether the system supports virtualization is lscpu. This command will display information about the CPU architecture, such as the number of CPUs, cores, sockets, threads, model name, frequency, cache size, and flags. One of the flags is vmx (for Intel processors) or svm (for AMD processors), which indicates that the CPU supports hardware virtualization. If the flag is present, it means that the system supports virtualization. If the flag is absent, it means that the system does not support virtualization or that it is disabled in the BIOS settings.
The other options are not correct commands for checking whether the system supports virtualization. The dmidecode -s system-version command will display the version of the system, such as the product name or serial number, but not the CPU information. The sysctl -a command will display all the kernel parameters, but not the CPU flags. The cat /sys/devices/system/cpu/possible command will display the range of possible CPUs that can be online or offline, but not the CPU features. References: lscpu(1) - Linux manual page; How To Check If Virtualization is Enabled in Windows 10 / 11
NEW QUESTION # 163
A systems administrator is checking the system logs. The administrator wants to look at the last 20 lines of a log. Which of the following will execute the command?
- A. tail -c 20
- B. tail -n 20
- C. tail -l 20
- D. tail -v 20
Answer: B
NEW QUESTION # 164
An administrator deployed a Linux server that is running a web application on port 6379/tcp.
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:
Which of the following commands should be used to resolve the issue?
- A. semanage port -a -t http_port_t -p tcp 6379
- B. semanage port -a http_port_t -p top 6379
- C. semanage port -d -t http_port_t -p tcp 6379
- D. semanage port -l -t http_port_tcp 6379
Answer: A
Explanation:
Explanation
The command semanage port -a -t http_port_t -p tcp 6379 adds a new port definition to the SELinux policy and assigns the type http_port_t to the port 6379/tcp. This allows the web application to run on this port and accept connections from users. This is the correct way to resolve the issue. The other options are incorrect because they either delete a port definition (-d), use the wrong protocol (top instead of tcp), or list the existing port definitions (-l). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18:
Securing Linux Systems, page 535.
NEW QUESTION # 165
A systems administrator is compiling a report containing information about processes that are listening on the network ports of a Linux server. Which of the following commands will allow the administrator to obtain the needed information?
- A. tcpdump -nL
- B. ss -pint
- C. lsof -It
- D. netstat -pn
Answer: B
Explanation:
The command ss -pint will allow the administrator to obtain the needed information about processes that are listening on the network ports of a Linux server. The ss command is a tool for displaying socket statistics on Linux systems. Sockets are endpoints of network communication that allow processes to exchange data over the network. The ss command can show various information about the sockets, such as the state, address, port, protocol, and process. The -pint option specifies the filters and flags that the ss command should apply. The - p option shows the process name and ID that owns the socket. The -i option shows the internal information about the socket, such as the send and receive queue, the congestion window, and the retransmission timeout.
The -n option shows the numerical address and port, instead of resolving the hostnames and service names.
The -t option shows only the TCP sockets, which are the most common type of sockets used for network communication. The command ss -pint will display the socket statistics for the TCP sockets, along with the process name and ID, the numerical address and port, and the internal information. This will allow the administrator to obtain the needed information about processes that are listening on the network ports of a Linux server. This is the correct command to use to obtain the needed information. The other options are incorrect because they either do not show the socket statistics (tcpdump -nL or lsof -It) or do not show the process name and ID (netstat -pn). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 389.
NEW QUESTION # 166
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
- A. The OnCalendar schedule is incorrect in the timer definition.
- B. The checkdiskspace.service needs to be enabled.
- C. The system-daemon services need to be reloaded.
- D. The checkdiskspace.service is not running.
Answer: A
Explanation:
The OnCalendar schedule is incorrect in the timer definition, which is causing the issue. The OnCalendar schedule defines when the timer should trigger the service. The format of the schedule is OnCalendar=<year>-<month>-<day> <hour>:<minute>:<second>. If any of the fields are omitted, they are assumed to be *, which means any value. Therefore, the schedule OnCalendar=*-*-* 00:00:00 means every day at midnight, which is why the job is running daily. To make the job run every two hours, the schedule should be OnCalendar=*-*-* *:00:00/2, which means every hour divisible by 2 at the start of the minute. The other options are incorrect because they are not related to the schedule. The checkdiskspace.service is running, as shown by the output of systemct1 status checkdiskspace.service. The checkdiskspace.service is enabled, as shown by the output of systemct1 is-enabled checkdiskspace.service. The system-daemon services do not need to be reloaded, as the timer and service definitions are already loaded by the restart. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, page 437.
NEW QUESTION # 167
A Linux administrator is troubleshooting SSH connection issues from one of the workstations.
When users attempt to log in from the workstation to a server with the IP address 104.21.75.76, they receive the following message:
The administrator reviews the information below:

Which of the following is causing the connectivity issue?
- A. The workstation has the wrong IP settings.
- B. The sshd service is disabled.
- C. The server's firewall is preventing connections from being made.
- D. The server has an incorrect default gateway configuration.
Answer: C
Explanation:
Explanation
The server's firewall is preventing connections from being made, which is causing the connectivity issue. The output of iptables -L -n shows that the firewall is blocking all incoming traffic on port 22, which is the default port for SSH. The output of ssh -v [email protected] shows that the connection is refused by the server. To resolve the issue, the administrator needs to allow port 22 on the firewall. The other options are incorrect because they are not supported by the outputs. The workstation has the correct IP settings, as shown by the output of ip addr show. The sshd service is enabled and running, as shown by the output of systemct1 status sshd. The server has the correct default gateway configuration, as shown by the output of ip route show. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, pages 406-407.
NEW QUESTION # 168
A systems administrator is tasked with creating a cloud-based server with a public IP address.
Which of the following technologies did the systems administrator use to complete this task?
- A. Terraform
- B. Git
- C. Ansible
- D. Puppet
Answer: A
Explanation:
The systems administrator used Terraform to create a cloud-based server with a public IP address. Terraform is a tool for building, changing, and versioning infrastructure as code. Terraform can create and manage resources on different cloud platforms, such as AWS, Azure, or Google Cloud. Terraform uses a declarative syntax to describe the desired state of the infrastructure and applies the changes accordingly. Terraform can also assign a public IP address to a cloud server by using the appropriate resource attributes. This is the correct technology that the systems administrator used to complete the task. The other options are incorrect because they are either not designed for creating cloud servers (Puppet or Git) or not capable of assigning public IP addresses (Ansible). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter
19: Managing Cloud and Virtualization Technologies, page 559.
NEW QUESTION # 169
A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)
- A. Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.
- B. Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.
- C. Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.
- D. Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line.
- E. Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.
- F. Interrupt the boot process in the GRUB menu and add single=user in the kernel line.
Answer: C,E
Explanation:
The administrator can use the following two options to boot the system into the single user mode:
Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line. This option will boot the system into the rescue mode, which is a minimal environment that allows the administrator to perform basic tasks such as repairing the system. The GRUB menu is a screen that appears when the system is powered on and allows the administrator to choose which kernel or operating system to boot. The kernel line is a line that specifies the parameters for the kernel, such as the root device, the init system, and the boot options. The administrator can interrupt the boot process by pressing the e key in the GRUB menu and edit the kernel line by adding systemd.unit=rescue.target at the end. This option will tell the system to use the rescue target, which is a unit that defines the state of the system in the rescue mode. The administrator can then press Ctrl+X to boot the system with the modified kernel line. This option will boot the system into the single user mode and allow the administrator to troubleshoot the issues.
Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line. This option will boot the system into the single user mode, which is a mode that allows the administrator to log in as the root user and perform maintenance tasks. The GRUB menu and the kernel line are the same as the previous option. The administrator can interrupt the boot process by pressing the e key in the GRUB menu and edit the kernel line by adding systemd.unit=single.target at the end. This option will tell the system to use the single target, which is a unit that defines the state of the system in the single user mode. The administrator can then press Ctrl+X to boot the system with the modified kernel line. This option will boot the system into the single user mode and allow the administrator to troubleshoot the issues.
The other options are incorrect because they either do not boot the system into the single user mode (execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot or interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line) or do not use the correct syntax (interrupt the boot process in the GRUB menu and add single=user in the kernel line or interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing the Linux Boot Process, pages 267-268.
NEW QUESTION # 170
A junior administrator is setting up a new Linux server that is intended to be used as a router at a remote site.
Which of the following parameters will accomplish this goal?
- A.

- B.

- C.

- D.

Answer: A
Explanation:
The parameter net.ipv4.ip_forward=1 will accomplish the goal of setting up a new Linux server as a router.
This parameter enables the IP forwarding feature, which allows the server to forward packets between different network interfaces. This is necessary for a router to route traffic between different networks. The parameter can be set in the /etc/sysctl.conf file or by using the sysctl command. This is the correct parameter to use to accomplish the goal. The other options are incorrect because they either do not exist (net.ipv4.
ip_forwarding or net.ipv4.ip_route) or do not enable IP forwarding (net.ipv4.
ip_forward=0). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 382.
NEW QUESTION # 171
A Linux administrator modified the SSH configuration file. Which of the following commands should be used to apply the configuration changes?
- A. systemct1 stop sshd
- B. systemct1 reload sshd
- C. systemct1 start sshd
- D. systemct1 mask sshd
Answer: B
Explanation:
The systemct1 reload sshd command can be used to apply the configuration changes of the SSH server daemon without restarting it. This is useful to avoid interrupting existing connections. The systemct1 stop sshd command would stop the SSH server daemon, not apply the changes. The systemct1 mask sshd command would prevent the SSH server daemon from being started, not apply the changes. The systemct1 start sshd command would start the SSH server daemon if it is not running, but it would not apply the changes if it is already running. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Secure Shell (SSH), page 415.
NEW QUESTION # 172
A systems technician is working on deploying several microservices to various RPM-based systems, some of which could run up to two hours. Which of the following commands will allow the technician to execute those services and continue deploying other microservices within the same terminal section?
- A. bg %1 job name
- B. fg %1
- C. gedit & disown
- D. kill 9 %1
Answer: A
Explanation:
Explanation
The command that will allow the technician to execute the services and continue deploying other microservices within the same terminal session is bg %1 job name. This command will send the job with ID 1 and name job name to the background, where it will run without occupying the terminal. The other options are incorrect because:
* gedit & disown will launch a graphical text editor in the background and detach it from the terminal, but it will not execute any service.
* kill 9 %1 will terminate the job with ID 1 using a SIGKILL signal, which cannot be ignored or handled by the process.
* fg %1 will bring the job with ID 1 to the foreground, where it will occupy the terminal until it finishes or is stopped. References: CompTIA Linux+ Study Guide, Fourth Edition, page 181-182.
NEW QUESTION # 173
A systems administrator wants to list all local account names and their respective UIDs. Which of the following commands will provide output containing this information?
- A. cut -c: -f3,1 /etc/passwd
- B. cut -d: -s2,3 /etc/passwd
- C. cut -n: -f1,2 /etc/passwd
- D. cut -d: -f1,3 /etc/passwd
Answer: D
Explanation:
The /etc/passwd file contains user account information, where each line includes fields separated by colons. To list all user accounts and their UIDs, use cut -d: -f1,3 /etc/passwd. This cuts the first field (username) and the third field (UID) from each line.
NEW QUESTION # 174
......
CompTIA XK0-005 certification exam is ideal for IT professionals who are looking to enhance their Linux skills and knowledge. It is also an excellent certification for individuals who are looking to begin a career in Linux system administration. CompTIA Linux+ Certification Exam certification exam is vendor-neutral, which means that it is not tied to any specific Linux distribution, making it a highly coveted certification for Linux professionals. The CompTIA Linux+ certification exam is recognized by leading organizations in the IT industry, making it a valuable credential for IT professionals who want to stay ahead of the curve in their careers.
CompTIA XK0-005 Dumps - Secret To Pass in First Attempt: https://www.passleadervce.com/Linux/reliable-XK0-005-exam-learning-guide.html
XK0-005 Practice Test Questions Updated 390 Questions: https://drive.google.com/open?id=1SJM3-oll4Mh8is52QbfuDX2ZQ3iBM8He