CompTIA Linux+ Certification XK0-005 Exam Practice Test

Page: 1 / 14
Total 487 questions
Question 1

A Linux administrator intends to start using KVM on a Linux server. Which of the following commands will allow the administrator to load the KVM module as

well as any related dependencies?



Answer : A

This command will load the KVM module as well as any related dependencies, such as kvm-intel or kvm-amd, depending on the processor type. The modprobe command is a Linux utility that reads the /etc/modules.conf file and adds or removes modules from the kernel. It also resolves any dependencies between modules, so that they are loaded in the correct order.

The other options are incorrect because:

B . insmod kvm

This command will only load the KVM module, but not any related dependencies. The insmod command is a low-level Linux utility that inserts a single module into the kernel. It does not resolve any dependencies between modules, so they have to be loaded manually.

C . depmod kvm

This command will not load the KVM module at all, but only create a list of module dependencies for modprobe to use. The depmod command is a Linux utility that scans the installed modules and generates a file called modules.dep that contains dependency information for each module.

D . hotplug kvm

This command is invalid and does not exist. The hotplug mechanism is a feature of the Linux kernel that allows devices to be added or removed while the system is running. It does not have anything to do with loading modules.


Question 2

A systems administrator creates a public key for authentication. Which of the following tools is most suitable to use when uploading the key to the remote

servers?



Answer : B

The best tool to use when uploading the public key to the remote servers is B. ssh-copy-id. This tool will copy the public key from the local computer to the remote server and append it to the authorized_keys file, which is used for public key authentication. This tool will also create the necessary directories and files on the remote server if they do not exist. The other tools are either not suitable or not relevant for this task. For example:

A . scp is a tool for securely copying files between hosts, but it does not automatically add the public key to the authorized_keys file.

C . ssh-agent is a tool for managing private keys and passphrases, but it does not upload the public key to the remote server.

D . ssh-keyscan is a tool for collecting public keys from remote hosts, but it does not upload the public key to the remote server.


Question 3

A Linux engineer needs to get information from the foo.com domain mail servers. Which of the following network tools should the engineer use?



Answer : C

To query Mail Exchange (MX) records for a domain, use dig:dig mx foo.com

To query Mail Exchange (MX) records for a domain, use dig:dig mx foo.com

To query Mail Exchange (MX) records for a domain, use dig:dig mx foo.com

MX records specify which mail servers handle email for a domain.

Why the other options are incorrect?

A . arp mx foo.com Incorrect, arp is used for MAC address resolution, not DNS lookups.

B . nc mx foo.com Incorrect, nc (netcat) is used for networking and port scanning, not DNS queries.

D . route mx foo.com Incorrect, route manages routing tables, not DNS records.

:

Linux dig Command -- Linux Documentation


Question 4

The administrator comptia is not able to perform privileged functions on a newly deployed system. Given the following command outputs:

Which of the following is the reason that the administrator is unable to perform the assigned duties?



Answer : B

The reason that the administrator is unable to perform the assigned duties is because the administrator is not a part of the correct group. This is option B.

Based on the image that you sent, I can see that the user comptia has a user ID and a group ID of 1000, and belongs to only one group, which is also comptia. However, the sudoers file, which defines the permissions for users to run commands as root or other users, does not include the comptia group in any of the entries. Therefore, the user comptia cannot use sudo to perform privileged functions on the system.

The other options are incorrect because:

A . The administrator needs a password reset.

This is not true, because the password aging information for the user comptia shows that the password was last changed on Oct 24, 2023, and it does not expire until Jan 22, 2024. There is no indication that the password is locked or expired.

C . The administrator did not update the sudo database.

This is not necessary, because the sudo database is automatically updated whenever the sudoers file is modified. There is no separate command to update the sudo database.

D . The administrator's credentials need to be more complex.

This is not relevant, because the complexity of the credentials does not affect the ability to use sudo. The sudoers file does not specify any password policy for the users or groups that are allowed to use sudo.


Question 5

A Linux administrator would like to measure possible packet loss between a workstation and a remote web application that is running on port 443. Which of the following would be the best command for the administrator to use to display this information?



Answer : C

mtr (My Traceroute) is a network diagnostic tool that combines the functionality of traceroute and ping. It shows real-time packet loss and latency on a hop-by-hop basis. The -T option uses TCP instead of ICMP, and the -P 443 option specifies the remote port. This provides the best method for checking packet loss on port 443.


Question 6

An administrator would like to securely connect to a server and forward port 8080 on a local machine to port 80 on the server. Which of the following commands should the administrator use to satisfy both requirements?



Answer : A

This command will create a local port forwarding, which means that connections from the SSH client are forwarded via the SSH server, then to a destination server. In this case, the destination server is the same as the SSH server (localhost), and the destination port is 80. The SSH client will listen on port 8080 on the local machine, and any connection to that port will be forwarded to port 80 on the server. This way, the administrator can securely access the web service running on port 80 on the server by using http://localhost:8080 on the local machine.

The other options are incorrect because:

B . ssh -R 8080:localhost:80 admin@server

This command will create a remote port forwarding, which means that connections from the SSH server are forwarded via the SSH client, then to a destination server. In this case, the destination server is the same as the SSH client (localhost), and the destination port is 80. The SSH server will listen on port 8080 on the remote machine, and any connection to that port will be forwarded to port 80 on the client. This is not what the administrator wants to do.

C . ssh -L 80:localhost:8080 admin@server

This command will also create a local port forwarding, but it will use port 80 on the local machine and port 8080 on the server. This is not what the administrator wants to do, and it may also fail if port 80 is already in use by another service on the local machine.

D . ssh -R admin@server

This command is incomplete and invalid. It does not specify any port numbers or destination addresses for the remote port forwarding. It will also fail if the SSH server does not allow remote port forwarding.

:

CompTIA Linux+ Certification Exam Objectives

How to Set up SSH Tunneling (Port Forwarding)


Question 7

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?



Answer : C

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.


Page:    1 / 14   
Total 487 questions