ExamGecko
Home Home / CompTIA / XK0-005

CompTIA XK0-005 Practice Test - Questions Answers, Page 29

Question list
Search
Search

List of questions

Search

Related questions











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?

A.
scp
A.
scp
Answers
B.
ssh-copy-id
B.
ssh-copy-id
Answers
C.
ssh-agent
C.
ssh-agent
Answers
D.
ssh-keyscan
D.
ssh-keyscan
Answers
Suggested answer: B

Explanation:

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.

The application team has reported latency issues that are causing the application to crash on the Linux server. The Linux administrator starts troubleshooting and receives the following output:

Which of the following commands will improve the latency issue?

A.
# echo 'net.core.net_backlog = 5000000' >> /etc/sysctl.conf # sysctl -p # systemctl daemon-reload
A.
# echo 'net.core.net_backlog = 5000000' >> /etc/sysctl.conf # sysctl -p # systemctl daemon-reload
Answers
B.
# ifdown eth0 # ip link set dev eth0 mtu 800 # ifup eth0
B.
# ifdown eth0 # ip link set dev eth0 mtu 800 # ifup eth0
Answers
C.
# systemctl stop network # ethtool -g eth0 512 # systemctl start network
C.
# systemctl stop network # ethtool -g eth0 512 # systemctl start network
Answers
D.
# echo 'net.core.rmem max = 12500000' >> /etc/sysctl.conf # echo 'net.core.wmem_max = 12500000' >> /etc/sysctl.conf # sysctl -p
D.
# echo 'net.core.rmem max = 12500000' >> /etc/sysctl.conf # echo 'net.core.wmem_max = 12500000' >> /etc/sysctl.conf # sysctl -p
Answers
Suggested answer: D

Explanation:

The best command to use to improve the latency issue is D. # echo 'net.core.rmem max = 12500000' >> /etc/sysctl.conf # echo 'net.core.wmem_max = 12500000' >> /etc/sysctl.conf # sysctl -p. This command will increase the size of the receive and send buffers for the network interface, which can improve the network performance and reduce packet loss. The sysctl command will apply the changes to the kernel parameters without rebooting the system.

The other commands are either incorrect or not suitable for this task. For example:

A) # echo 'net.core.net_backlog = 5000000' >> /etc/sysctl.conf # sysctl -p # systemctl daemon-reload will try to increase the backlog queue for incoming connections, but this is not relevant for the latency issue. The systemctl daemon-reload command is also unnecessary, as it only reloads the systemd configuration files, not the kernel parameters.

B) # ifdown eth0 # ip link set dev eth0 mtu 800 # ifup eth0 will try to change the maximum transmission unit (MTU) of the network interface to 800 bytes, but this is too low and may cause fragmentation and performance degradation. The default MTU for Ethernet is 1500 bytes, and it should not be changed unless there is a specific reason.

C) # systemctl stop network # ethtool -g eth0 512 # systemctl start network will try to change the ring buffer size of the network interface to 512, but this is too small and may cause packet drops and latency spikes. The default ring buffer size for Ethernet is usually 4096 or higher, and it should be increased if there is a high network traffic.

An administrator runs ping comptia.org. The result of the command is:

ping: comptia.org: Name or service not known

Which of the following files should the administrator verify?

A.
/etc/ethers
A.
/etc/ethers
Answers
B.
/etc/services
B.
/etc/services
Answers
C.
/etc/resolv.conf
C.
/etc/resolv.conf
Answers
D.
/etc/sysctl.conf
D.
/etc/sysctl.conf
Answers
Suggested answer: C

Explanation:

The best file to verify when the ping command returns the error ''Name or service not known'' is C. /etc/resolv.conf. This file contains the configuration for the DNS resolver, which is responsible for translating domain names into IP addresses. If this file is missing, corrupted, or has incorrect entries, the ping command will not be able to resolve the domain name and will fail with the error. To fix this issue, the administrator should check that the file exists, has proper permissions, and has valid nameserver entries. For example, a typical /etc/resolv.conf file may look like this:

nameserver 8.8.8.8nameserver 8.8.4.4

These are the IP addresses of Google's public DNS servers, which can be used as a fallback option if the default DNS servers are not working.

Which of the following should be used to verify the integrity of a file?

A.
sha256sum
A.
sha256sum
Answers
B.
fsck
B.
fsck
Answers
C.
gpg ---d
C.
gpg ---d
Answers
D.
hashcat
D.
hashcat
Answers
Suggested answer: A

Explanation:

The best tool to use to verify the integrity of a file is

A) sha256sum. This tool will compute and display the SHA-256 hash of a file, which is a 64-digit hexadecimal number that uniquely identifies the file's content. By comparing the hash of a downloaded file with the hash provided by the file owner or source, you can confirm that the file has not been altered or corrupted during the transfer. The other tools are either not relevant or not suitable for this task. For example:

B) fsck is a tool for checking and repairing the file system, but it does not verify the integrity of individual files.

C) gpg -d is a tool for decrypting files that have been encrypted with GnuPG, but it does not verify the integrity of unencrypted files.

D) hashcat is a tool for cracking passwords or hashes, but it does not verify the integrity of files.

A new application container was built with an incorrect version number. Which of the following commands should be used to rename the image to match the correct version 2.1.2?

A.
docker tag comptia/app:2.1.1 comptia/app:2.1.2
A.
docker tag comptia/app:2.1.1 comptia/app:2.1.2
Answers
B.
docker push comptia/app:2.1.1 comptia/app:2.1.2
B.
docker push comptia/app:2.1.1 comptia/app:2.1.2
Answers
C.
docker rmi comptia/app:2.1.1 comptia/app:2.1.2
C.
docker rmi comptia/app:2.1.1 comptia/app:2.1.2
Answers
D.
docker update comptia/app:2.1.1 comptia/app:2.1.2
D.
docker update comptia/app:2.1.1 comptia/app:2.1.2
Answers
Suggested answer: A

Explanation:

The best command to use to rename the image to match the correct version 2.1.2 is A. docker tag comptia/app:2.1.1 comptia/app:2.1.2. This command will create a new tag for the existing image with the new version number, without changing the image content or ID. The other commands are either incorrect or not suitable for this task. For example:

B) docker push comptia/app:2.1.1 comptia/app:2.1.2 will try to push two images to a remote repository, but it does not rename the image locally.

C) docker rmi comptia/app:2.1.1 comptia/app:2.1.2 will try to remove two images from the local system, but it does not rename the image.

D) docker update comptia/app:2.1.1 comptia/app:2.1.2 will try to update the configuration of a running container, but it does not rename the image.

A Linux administrator wants to prevent the httpd web service from being started both manually and automatically on a server. Which of the following should the administrator use to accomplish this task?

A.
systemctl mask httpd
A.
systemctl mask httpd
Answers
B.
systemctl disable httpd
B.
systemctl disable httpd
Answers
C.
systemctl stop httpd
C.
systemctl stop httpd
Answers
D.
systemctl reload httpd
D.
systemctl reload httpd
Answers
Suggested answer: A

Explanation:

The best command to use to prevent the httpd web service from being started both manually and automatically on a server is

A) systemctl mask httpd. This command will create a symbolic link from the httpd service unit file to /dev/null, which will make the service impossible to start or enable. This is different from systemctl disable httpd, which will only prevent the service from starting automatically on boot, but not manually. The other commands are either not relevant or not sufficient for this task. For example:

C) systemctl stop httpd will only stop the service if it is currently running, but it will not prevent it from being started again.

D) systemctl reload httpd will only reload the configuration files of the service, but it will not stop or disable it.

Which of the following will prevent non-root SSH access to a Linux server?

A.
Creating the /etc/nologin file
A.
Creating the /etc/nologin file
Answers
B.
Creating the /etc/nologin.allow file containing only a single line root
B.
Creating the /etc/nologin.allow file containing only a single line root
Answers
C.
Creating the /etc/nologin/login.deny file containing a single line +all
C.
Creating the /etc/nologin/login.deny file containing a single line +all
Answers
D.
Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so
D.
Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so
Answers
Suggested answer: A

Explanation:

This file prevents any non-root user from logging in to the system, regardless of the authentication method. The contents of the file are displayed to the user before the login is terminated.This can be useful for system maintenance or security reasons12.

Due to performance issues on a server, a Linux administrator needs to terminate an unresponsive process. Which of the following commands should the administrator use to terminate the process immediately without waiting for a graceful shutdown?

A.
kill -SIGKILL 5545
A.
kill -SIGKILL 5545
Answers
B.
kill -SIGTERM 5545
B.
kill -SIGTERM 5545
Answers
C.
kill -SIGHUP 5545
C.
kill -SIGHUP 5545
Answers
D.
kill -SIGINT 5545
D.
kill -SIGINT 5545
Answers
Suggested answer: A

Explanation:

SIGKILL is used to immediately terminate a process without allowing it to clean up. It does not give the process a chance to gracefully shut down, which is what's needed in the case of an unresponsive process.

A Linux administrator needs to determine if prerequisites are met. One of the application requirements is to install Perl on a system. Which of the following commands would accomplish this task?

A.
rpm -Uf perl
A.
rpm -Uf perl
Answers
B.
rpm -iv perl
B.
rpm -iv perl
Answers
C.
rpm -qa perl
C.
rpm -qa perl
Answers
D.
rpm -eh perl
D.
rpm -eh perl
Answers
Suggested answer: C

Explanation:

rpm -qa lists all installed packages and filtering with perl will show if Perl is installed or not. This command is useful for verifying prerequisites like the presence of certain software on the system.

A Linux administrator is troubleshooting an SSHD issue on a server. Users are receiving error messages stating the connection is refused. Which of the following commands should be used to verify whether the service is listening?

A.
nslookup
A.
nslookup
Answers
B.
route
B.
route
Answers
C.
netstat
C.
netstat
Answers
D.
ifconfig
D.
ifconfig
Answers
Suggested answer: C

Explanation:

netstat is a command-line tool that displays network connections, routing tables, and a number of network interface statistics. It can be used to check if the SSHD service is listening on its default port (usually port 22) or any other configured port.

Total 371 questions
Go to page: of 38