Linux+

Here you have the best CompTIA XK0-005 practice exam questions

  • You have 226 total questions to study from
  • Each page has 5 questions, making a total of 46 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on November 12, 2024
Question 1 of 226

An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct version of this file?

    Correct Answer: A

    To identify the correct version of the /boot/vmlinuz file that needs to be restored, the 'rpm -qa | grep kernel' command can be used to list all installed kernel packages, and 'uname -a' can display information about the currently running kernel. By combining the outputs of these commands, an administrator can determine the specific version of the kernel that is needed. This approach directly addresses the requirement to identify the correct version of the deleted file.

Question 2 of 226

A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value?

    Correct Answer: D

    To change the secure remote login port from 22 to 49000, the engineer should modify the /etc/ssh/sshd_config file. This file contains the configuration settings for the SSH server, including the port number. The engineer needs to find the line that specifies Port 22 and change it to Port 49000. After making this change, the SSH service must be restarted for the new port configuration to take effect.

Question 3 of 226

A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task?

    Correct Answer: B

    To synchronize a local copy with the contents of the main Git repository, the administrator should use the 'git pull' command. This command fetches the latest changes from the remote repository and merges them into the local branch, ensuring that the local copy has the most recent updates, including any new files that were added.

Question 4 of 226

A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?

    Correct Answer: D

    To redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128, the command used must perform destination NAT (DNAT) on incoming TCP packets destined for port 80. The correct command that meets all these criteria is 'iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.0.2.25:3128'. This command appends a rule to the PREROUTING chain in the NAT table, specifically targeting TCP packets with a destination port of 80 and redirecting them to the new proxy server at the specified IP address and port.

Question 5 of 226

Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?

    Correct Answer: D

    To implement a persistent, static route on the application server, the command 'ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0' should be used. This command correctly specifies that packets sent to the destination 10.0.213.5/32 should be routed via the gateway 10.0.5.1, using the interface eth0. The 'ip route add' command is the appropriate way to add a new route to the routing table in Linux. For persistence across reboots, this command should be added to the appropriate network configuration file or system startup script.