[UPDATED 2025] Read XK0-005 Study Guide Cover to Cover as Literally
100% Real & Accurate XK0-005 Questions and Answers with Free and Fast Updates
NEW QUESTION # 11
Several users reported that they were unable to write data to the /oracle1 directory. The following output has been provided:
Which of the following commands should the administrator use to diagnose the issue?
- A. lsblk /dev/sdb1
- B. df -i /oracle1
- C. fdisk -1 /dev/sdb1
- D. du -sh /oracle1
Answer: B
NEW QUESTION # 12
A systems administrator checked out the code from the repository, created a new branch, made changes to the code, and then updated the main branch. The systems administrator wants to ensure that the Terraform state files do not appear in the main branch. Which of following should the administrator use to meet this requirement?
- A. clone
- B. get
- C. gitxgnore
- D. .ssh
Answer: C
Explanation:
To prevent certain files from being tracked by Git, the administrator can use a .gitignore file (B) in the repository. The .gitignore file can specify patterns of files or directories that Git should ignore. This way, the Terraform state files will not appear in the main branch or any other branch. The other commands are not related to this requirement. Reference:
[CompTIA Linux+ Study Guide], Chapter 10: Working with Git, Section: Ignoring Files with .gitignore
[How to Use .gitignore File]
NEW QUESTION # 13
A systems administrator is receiving tickets from users who cannot reach the application app that should be listening on port 9443/tcp on a Linux server.
To troubleshoot the issue, the systems administrator runs netstat and receives the following output:
Based on the information above, which of the following is causing the issue?
- A. The IP address 0.0.0.0 is not valid.
- B. The application is listening on port 1234.
- C. The application is listening on the loopback interface.
- D. The application is not running.
Answer: C
Explanation:
The server is in a "Listen" state on port 9943 using its loopback address. The "1234" is a process-id The cause of the issue is that the application is listening on the loopback interface. The loopback interface is a virtual network interface that is used for internal communication within the system. The loopback interface has the IP address 127.0.0.1, which is also known as localhost. The netstat output shows that the application is listening on port 9443 using the IP address 127.0.0.1. This means that the application can only accept connections from the same system, not from other systems on the network. This can prevent the users from reaching the application and cause the issue. The administrator should configure the application to listen on the IP address 0.0.0.0, which means all available interfaces, or on the specific IP address of the system that is reachable from the network. This will allow the application to accept connections from other systems and resolve the issue. The cause of the issue is that the application is listening on the loopback interface. This is the correct answer to the question. The other options are incorrect because they are not supported by the outputs. The IP address 0.0.0.0 is valid and means all interfaces, the application is not listening on port 1234, and the application is running as shown by the process ID 1234. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 383.
NEW QUESTION # 14
A user is unable to remotely log on to a server using the server name server1 and port 22. The Linux engineer troubleshoots the issue and gathers the following information:
Which of the following is most likely causing the issue?
- A. serverl is using an incorrect IP address.
- B. sshd is not an active service.
- C. server 1 is not in the DNS.
- D. sshd is running on a non-standard port.
Answer: D
Explanation:
The sshd is the Secure Shell Daemon, which is a service that allows remote login to a Linux system using the SSH protocol. The output shows that the sshd is running on port 2222, which is a non-standard port for SSH. The default port for SSH is 22, which is what the user is trying to use. Therefore, the statement B is most likely causing the issue. The statements A, C, and D are incorrect because they do not explain why the user cannot log on using port 22. Reference: [How to Change SSH Port in Linux]
NEW QUESTION # 15
A DevOps engineer wants to allow the same Kubernetes container configurations to be deployed in development, testing, and production environments. A key requirement is that the containers should be configured so that developers do not have to statically configure custom, environment-specific locations.
Which of the following should the engineer use to meet this requirement?
- A. Ambassador container
- B. Node affinity
- C. Overlay network
- D. Custom scheduler
Answer: A
Explanation:
Explanation
To allow the same Kubernetes container configurations to be deployed in different environments without statically configuring custom locations, the engineer can use an ambassador container (D). An ambassador container is a proxy container that handles communication between containers and external services. It can dynamically configure locations based on environment variables or other methods. The other options are not related to this requirement. References
[CompTIA Linux+ Study Guide], Chapter 11: Working with Containers, Section: Using Ambassador Containers
[How to Use Ambassador Containers]
NEW QUESTION # 16
Users have been unable to reach www.comptia.org from a Linux server. A systems administrator is troubleshooting the issue and does the following:
Based on the information above, which of the following is causing the issue?
- A. The server 192.168.168.53 is unreachable.
- B. The network interface eth0 is disconnected.
- C. The name www.comptia.org does not point to a valid IP address.
- D. No default route is set on the server.
Answer: A
Explanation:
Explanation
The issue is caused by the server 192.168.168.53 being unreachable. This server is the DNS server configured in the /etc/resolv.conf file, which is used to resolve domain names to IP addresses. The ping command shows that the server cannot be reached, and the nslookup command shows that the name www.comptia.org cannot be resolved using this server. The other options are incorrect because:
* The name www.comptia.org does point to a valid IP address, as shown by the nslookup command using another DNS server (8.8.8.8).
* The default route is set on the server, as shown by the ip route command, which shows a default gateway of 192.168.168.1.
* The network interface eth0 is connected, as shown by the ip link command, which shows a state of UP for eth0. References: CompTIA Linux+ Study Guide, Fourth Edition, page 457-458, 461-462.
NEW QUESTION # 17
A Linux administrator was notified that a virtual server has an I/O bottleneck. The Linux administrator analyzes the following output:
Given there is a single CPU in the sever, which of the following is causing the slowness?
- A. The CPU is overloaded.
- B. The processes are paging.
- C. The memory is exhausted.
- D. The system is running out of swap space.
Answer: A
Explanation:
Explanation
The slowness is caused by the CPU being overloaded. The iostat command shows that the CPU utilization is
100%, which means that there are more processes competing for CPU time than the CPU can handle. The other options are incorrect because:
The system is not running out of swap space, as shown by the iostat command, which shows that there is no swap activity (si and so columns are zero).
The memory is not exhausted, as shown by the free -m command, which shows that there is still available memory (avail column) and free buffer/cache memory (buff/cache column).
The processes are not paging, as shown by the vmstat command, which shows that there are no major page faults (majflt column) and no swap activity (si and so columns). References: CompTIA Linux+ Study Guide, Fourth Edition, page 417-419, 424-425.
NEW QUESTION # 18
A junior Linux administrator needs to ensure a service will start on system boot.
Which of the following commands should be used to accomplish this task?
- A. chkconfig <service> on
- B. service <service> enable
- C. systemctl <service> bootup
- D. crontab install <service>
Answer: A
Explanation:
https://geekflare.com/how-to-auto-start-services-on-boot-in-linux/
NEW QUESTION # 19
A Linux administrator wants a permission bit on a shared folder that allows only the owner of the file within that directory or the root user to delete or rename the file. Which of the following commands will help achieve this goal?
- A. chmod o-t /directory/
- B. chmod u-w /directory/
- C. chmod +t /directory/
- D. chmod a-r /directory/
Answer: C
Explanation:
The +t option sets the "sticky bit" on a directory, which restricts deletion or renaming of files in the directory to the file's owner or the root user. This is commonly used in shared directories like /tmp, where multiple users may have access, but only the file owner should be allowed to modify their own files. The command chmod +t /directory/ applies this permission.
NEW QUESTION # 20
A systems administrator wants to permit access temporarily to an application running on port 1234/TCP on a Linux server. Which of the following commands will permit this traffic?
- A. firewall-cmd -add-whitelist-uid=1234
- B. firewall-cmd -new-service=1234/tcp
- C. firewall-cmd -add-port=1234/tcp
- D. firewall-cmd -service=1234 -protocol=tcp
Answer: C
Explanation:
The firewall-cmd command is used to manage firewalld, which is a firewall service for Linux systems that provides dynamic and persistent configuration of firewall rules. Firewalld uses zones and services to define different levels of trust and access for network connections.
To permit access temporarily to an application running on port 1234/TCP on a Linux server, the systems administrator can use the firewall-cmd --add-port=1234/tcp command. This command will add a rule to the default zone (usually public) that allows incoming traffic on port 1234/TCP. The rule will only be effective until the next reload or restart of firewalld. To make the rule permanent, the administrator can add the -- permanent option to the command. The statement C is correct.
The statements A, B, and D are incorrect because they do not permit access to port 1234/TCP. The firewall- cmd --new-service=1234/tcp command does not exist. The firewall-cmd --service=1234 -- protocol=tcp command does not work because 1234 is not a predefined service name in firewalld.
The firewall-cmd --add-whitelist-uid=1234 command does not exist. References: [How to Use FirewallD to Manage Firewall in Linux]
NEW QUESTION # 21
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses rotated files in /var/log without recursion.
INSTRUCTIONS
Fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
Answer:
Explanation:

NEW QUESTION # 22
Which of the following commands will display the operating system?
- A. uname -n
- B. uname -o
- C. uname -s
- D. uname -m
Answer: B
Explanation:
The command that will display the operating system is uname -o. This command uses the uname tool, which is used to print system information such as the kernel name, version, release, machine, and processor. The -o option stands for operating system, and prints the name of the operating system implementation (usually GNU/Linux).
NEW QUESTION # 23
Which of the following enables administrators to configure and enforce MFA on a Linux system?
- A. Kerberos
- B. PAM
- C. PKI
- D. SELinux
Answer: B
Explanation:
The mechanism that enables administrators to configure and enforce MFA on a Linux system is PAM. PAM stands for Pluggable Authentication Modules, which is a framework for managing authentication and authorization on Linux systems. PAM allows the administrator to define the rules and policies for accessing various system resources and services, such as login, sudo, ssh, or cron. PAM also supports different types of authentication methods, such as passwords, tokens, biometrics, or smart cards. PAM can be used to implement MFA, which stands for Multi-Factor Authentication, which is a security technique that requires the user to provide more than one piece of evidence to prove their identity. MFA can enhance the security of the system and prevent unauthorized access. PAM enables administrators to configure and enforce MFA on a Linux system. This is the correct answer to the question. The other options are incorrect because they either do not manage authentication and authorization on Linux systems (Kerberos or PKI) or do not support MFA (SELinux). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 17: Implementing Basic Security, page 517.
NEW QUESTION # 24
A Linux engineer needs to block an incoming connection from the IP address 2.2.2.2 to a secure shell server and ensure the originating IP address receives a response that a firewall is blocking the connection. Which of the following commands can be used to accomplish this task?
- A. iptables -A INPUT -p tcp --dport ssh -s 2.2.2.2 -j DROP
- B. iptables -A INPUT -p tcp --dport ssh -s 2.2.2.2 -j RETURN
- C. iptables -A INPUT -p tcp --dport ssh -s 2.2.2.2 -j REJECT
- D. iptables -A INPUT -p tcp --dport ssh -s 2.2.2.2 -j QUEUE
Answer: C
Explanation:
The REJECT target sends back an error packet to the source IP address, indicating that the connection is refused by the firewall. This is different from the DROP target, which silently discards the packet without any response. The RETURN target returns to the previous chain, which may or may not accept the connection. The QUEUE target passes the packet to a userspace application for further processing, which is not the desired outcome in this case.
NEW QUESTION # 25
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:
Given this scenario, which of the following should the administrator do to recover this volume?
- A. Replace the failed drive and reconfigure the mirror.
- B. Reboot the server. The volume will automatically go back to linear mode.
- C. Recreate the logical volume.
- D. Reboot the server. The volume will revert to stripe mode.
Answer: A
Explanation:
Explanation
The administrator should replace the failed drive and reconfigure the mirror to recover the volume. The LVM (Logical Volume Manager) is a tool for managing disk space on Linux systems. The LVM allows the administrator to create logical volumes that span across multiple physical volumes, such as hard disks or partitions. The LVM also supports different types of logical volumes, such as linear, striped, or mirrored. A mirrored logical volume is a type of logical volume that creates a copy of the data on another physical volume, providing redundancy and fault tolerance. The output shows that the logical volume is mirrored and that one leg of the mirror has failed due to the underlying physical volume. This means that one of the physical volumes that contains the data of the logical volume is damaged or missing. This can cause data loss and performance degradation. The administrator should replace the failed drive and reconfigure the mirror to recover the volume. The administrator should identify the failed physical volume by using commands such as pvdisplay, vgdisplay, or lvdisplay. The administrator should then remove the failed physical volume from the volume group by using the vgreduce command. The administrator should then install a new drive and create a new physical volume by using the pvcreate command. The administrator should then add the new physical volume to the volume group by using the vgextend command. The administrator should then reconfigure the mirror by using the lvconvert command. The administrator should replace the failed drive and reconfigure the mirror to recover the volume. This is the correct answer to the question. The other options are incorrect because they either do not recover the volume (reboot the server. The volume will automatically go back to linear mode or reboot the server. The volume will revert to stripe mode) or do not preserve the data of the volume (recreate the logical volume). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 333-334.
NEW QUESTION # 26
A systems administrator is implementing a new service task with systems at startup and needs to execute a script entitled test.sh with the following content:
The administrator tries to run the script after making it executable with chmod +x; however, the script will not run. Which of the following should the administrator do to address this issue? (Choose two.)
- A. Restart the computer to enable the new service.
- B. Add #!//bin/bash to the top of the script.
- C. Shut down the computer to enable the new service.
- D. Create a unit file for the new service in /etc/init.d with the name helpme.service in the location.
- E. Add #!/bin/bash to the bottom of the script.
- F. Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location.
Answer: B,F
Explanation:
The administrator should do the following two things to address the issue:
* Add #!/bin/bash to the top of the script. This is called a shebang line and it tells the system which interpreter to use to execute the script. Without this line, the script will not run properly. The shebang line should be the first line of the script and should start with #! followed by the path to the interpreter.
In this case, the interpreter is bash and the path is /bin/bash. The other option (A) is incorrect because the shebang line should be at the top, not the bottom of the script.
* Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location. This is necessary to register the script as a systemd service and enable it to run at startup. A unit file is a configuration file that defines the properties and behavior of a service, such as the description, dependencies, start and stop commands, and environment variables. The unit file should have the extension .service and should be placed in the /etc/systemd/system/ directory. The other option (E) is incorrect because /etc/init.d is the directory for init scripts, not systemd services.
References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, pages 429-430.
NEW QUESTION # 27
While inspecting a recently compromised Linux system, the administrator identified a number of processes that should not have been running:
Which of the following commands should the administrator use to terminate all of the identified processes?
- A. skill -9 "upload*.sh"
- B. kill -9 "upload*.sh"
- C. killall -9 -upload*.sh"
- D. pkill -9 -f "upload*.sh"
Answer: C
NEW QUESTION # 28
Users have been unable to reach www.comptia.org from a Linux server. A systems administrator is troubleshooting the issue and does the following:
Based on the information above, which of the following is causing the issue?
- A. The server 192.168.168.53 is unreachable.
- B. The network interface eth0 is disconnected.
- C. The name www.comptia.org does not point to a valid IP address.
- D. No default route is set on the server.
Answer: A
Explanation:
Explanation
The issue is caused by the server 192.168.168.53 being unreachable. This server is the DNS server configured in the /etc/resolv.conf file, which is used to resolve domain names to IP addresses. The ping command shows that the server cannot be reached, and the nslookup command shows that the name www.comptia.org cannot be resolved using this server. The other options are incorrect because:
The name www.comptia.org does point to a valid IP address, as shown by the nslookup command using another DNS server (8.8.8.8).
The default route is set on the server, as shown by the ip route command, which shows a default gateway of 192.168.168.1.
The network interface eth0 is connected, as shown by the ip link command, which shows a state of UP for eth0. References: CompTIA Linux+ Study Guide, Fourth Edition, page 457-458, 461-462.
NEW QUESTION # 29
A Linux systems administrator is setting up a new web server and getting 404 - NOT FOUND errors while trying to access the web server pages from the browser. While working on the diagnosis of this issue, the Linux systems administrator executes the following commands:
Which of the following commands will BEST resolve this issue?
- A. setsebool -P httpd_can_network_connect_db on
- B. sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
- C. setenforce 0
- D. restorecon -R -v /var/www/html
Answer: D
Explanation:
Explanation
The command restorecon -R -v /var/www/html will best resolve the issue. The issue is caused by the incorrect SELinux context of the web server files under the /var/www/html directory. The output of ls -Z
/var/www/html shows that the files have the type user_home_t, which is not allowed for web content. The command restorecon restores the default SELinux context of files based on the policy rules. The options -R and -v are used to apply the command recursively and verbosely. This command will change the type of the files to httpd_sys_content_t, which is the correct type for web content. This will allow the web server to access the files and serve the pages to the browser. The other options are incorrect because they either disable SELinux entirely (sed -i 's/SELINUX=enforcing/SELINUX=disabled/'
/etc/selinux/config or setenforce 0), which is not a good security practice, or enable an unnecessary boolean (setsebool -P httpd_can_network_connect_db on), which is not related to the issue. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 535.
NEW QUESTION # 30
A systems administrator is working on a security report from the Linux servers. Which of the following commands can the administrator use to display all the firewall rules applied to the Linux servers? (Choose two.)
- A. systemctl status firewalld
- B. firewall-cmd --list-all
- C. iptables -F
- D. ufw status
- E. ufw limit
- F. iptables -A
Answer: B,D
Explanation:
These commands can display all the firewall rules applied to the Linux servers, depending on which firewall service is being used.
The firewall-cmd command is a utility for managing firewalld, which is a dynamic firewall service that supports zones and services. The --list-all option will show all the settings and rules for the default zone, or for a specific zone if specified. For example, firewall-cmd --list-all --zone=public will show the rules for the public zone.
The ufw command is a frontend for iptables, which is a low-level tool for manipulating netfilter, the Linux kernel's packet filtering framework. The status option will show the status of ufw and the active rules, or the numbered rules if verbose is specified. For example, ufw status verbose will show the numbered rules and other information.
NEW QUESTION # 31
......
The CompTIA Linux+ Certification Exam certification exam consists of multiple-choice questions and performance-based simulations that assess the candidate's practical knowledge and skills. XK0-005 exam is available in English and Japanese languages and can be taken online or in-person at a Pearson VUE testing center. CompTIA Linux+ Certification Exam certification exam has a duration of 90 minutes, and the passing score is 720 on a scale of 100-900.
Reliable Study Materials for XK0-005 Exam Success For Sure: https://www.itexamreview.com/XK0-005-exam-dumps.html
Get Unlimited Access to XK0-005 Certification Exam Cert Guide: https://drive.google.com/open?id=14hs0Z23Wn6YRFu0ZprOteipYGFN8uZBx
