ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











A systems administrator is tasked with setting up key-based SSH authentication. In which of the following locations should the administrator place the public keys for the server?

A.
~/.sshd/authkeys
A.
~/.sshd/authkeys
Answers
B.
~/.ssh/keys
B.
~/.ssh/keys
Answers
C.
~/.ssh/authorized_keys
C.
~/.ssh/authorized_keys
Answers
D.
~/.ssh/keyauth
D.
~/.ssh/keyauth
Answers
Suggested answer: C

Explanation:

The administrator should place the public keys for the server in the ~/.ssh/authorized_keys file. The SSH (Secure Shell) protocol is a method for establishing secure and encrypted connections between remote systems. The SSH protocol supports two types of authentication: password-based and keybased.

Password-based authentication requires the user to enter the password of the remote system every time they connect. Key-based authentication requires the user to generate a pair of cryptographic keys: a public key and a private key. The public key is stored on the remote system, while the private key is kept on the local system. The public key and the private key are mathematically related, but not identical. The SSH protocol uses the keys to verify the identity of the user and establish a secure connection without requiring a password. The ~/.ssh/authorized_keys file is a file that contains the public keys of the users who are allowed to connect to the remote system using key-based authentication. The administrator should place the public keys for the server in this file, one per line, and set the appropriate permissions for the file. The administrator should also configure the SSH server to enable key-based authentication by editing the /etc/ssh/sshd_config file and setting the option PasswordAuthentication to no. The administrator should place the public keys for the server in the ~/.ssh/authorized_keys file. This is the correct answer to the question. The other options are incorrect because they are not the standard locations for the public keys for the server (~/.sshd/authkeys, ~/.ssh/keys, or ~/.ssh/keyauth). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 17: Implementing Basic Security, page 513.

A Linux administrator needs to create a new user named user02. However, user02 must be in a different home directory, which is under /comptia/projects. Which of the following commands will accomplish this task?

A.
useradd -d /comptia/projects user02
A.
useradd -d /comptia/projects user02
Answers
B.
useradd -m /comptia/projects user02
B.
useradd -m /comptia/projects user02
Answers
C.
useradd -b /comptia/projects user02
C.
useradd -b /comptia/projects user02
Answers
D.
useradd -s /comptia/projects user02
D.
useradd -s /comptia/projects user02
Answers
Suggested answer: A

Explanation:

The command useradd -d /comptia/projects user02 will accomplish the task of creating a new user named user02 with a different home directory. The useradd command is a tool for creating new user accounts on Linux systems. The -d option specifies the home directory for the new user, which is the directory where the user's personal files and settings are stored. The /comptia/projects is the path of the home directory for the new user, which is different from the default location of /home/user02.

The user02 is the name of the new user. The command useradd -d /comptia/projects user02 will create a new user named user02 with a home directory under /comptia/projects. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not specify the home directory for the new user (useradd -m /comptia/projects user02 or useradd -s /comptia/projects user02) or do not use the correct option for the home directory (useradd -b /comptia/projects user02 instead of useradd -d /comptia/projects user02). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Users and Groups, page 403.

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.
Reboot the server. The volume will automatically go back to linear mode.
A.
Reboot the server. The volume will automatically go back to linear mode.
Answers
B.
Replace the failed drive and reconfigure the mirror.
B.
Replace the failed drive and reconfigure the mirror.
Answers
C.
Reboot the server. The volume will revert to stripe mode.
C.
Reboot the server. The volume will revert to stripe mode.
Answers
D.
Recreate the logical volume.
D.
Recreate the logical volume.
Answers
Suggested answer: B

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). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 333-334.

A systems administrator created a new Docker image called test. After building the image, the administrator forgot to version the release. Which of the following will allow the administrator to assign the v1 version to the image?

A.
docker image save test test:v1
A.
docker image save test test:v1
Answers
B.
docker image build test:vl
B.
docker image build test:vl
Answers
C.
docker image tag test test:vl
C.
docker image tag test test:vl
Answers
D.
docker image version test:v1
D.
docker image version test:v1
Answers
Suggested answer: C

Explanation:

The docker image tag test test:v1 command can be used to assign the v1 version to the image called test. This command creates a new tag for the existing image, without changing the original image.

The docker image save test test:v1 command would save the image to a file, not assign a version. The docker image build test:vl command is invalid, as vl is not a valid version number. The docker image version test:v1 command does not exist. Reference: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 16: Virtualization and Cloud Technologies, page 500.

A Linux systems administrator receives a notification that one of the server's filesystems is full.

Which of the following commands would help the administrator to identify this filesystem?

A.
lsblk
A.
lsblk
Answers
B.
fdisk
B.
fdisk
Answers
C.
df -h
C.
df -h
Answers
D.
du -ah
D.
du -ah
Answers
Suggested answer: C

Explanation:

The df -h command can be used to identify the filesystem that is full. This command displays the disk usage of each mounted filesystem in a human-readable format, showing the total size, used space, available space, and percentage of each filesystem. The lsblk command displays information about block devices, not filesystems. The fdisk command can be used to manipulate partition tables, not check disk usage. The du -ah command displays the disk usage of each file and directory in a humanreadable format, not the filesystems. Reference: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 14: Managing Disk Storage, page 454.

A systems administrator is notified that the mysqld process stopped unexpectedly. The systems administrator issues the following command:

sudo grep -i -r ‘out of memory' /var/log

The output of the command shows the following:

kernel: Out of memory: Kill process 9112 (mysqld) score 511 or sacrifice child.

Which of the following commands should the systems administrator execute NEXT to troubleshoot this issue? (Select two).

A.
free -h
A.
free -h
Answers
B.
nc -v 127.0.0.1 3306
B.
nc -v 127.0.0.1 3306
Answers
C.
renice -15 $( pidof mysql )
C.
renice -15 $( pidof mysql )
Answers
D.
lsblk
D.
lsblk
Answers
E.
killall -15
E.
killall -15
Answers
F.
vmstat -a 1 4
F.
vmstat -a 1 4
Answers
Suggested answer: A, F

Explanation:

The free -h command can be used to check the amount of free and used memory in the system in a human-readable format. This can help to troubleshoot the issue of mysqld being killed due to out of memory. The vmstat -a 1 4 command can be used to monitor the system's virtual memory statistics, such as swap usage, paging activity, and memory faults, every one second for four times. This can help to identify any memory pressure or performance issues that may cause out of memory errors.

The nc -v 127.0.0.1 3306 command would attempt to connect to the MySQL server on port 3306 and display any diagnostic messages, but this would not help to troubleshoot the memory issue. The renice -15 $( pidof mysql ) command would change the priority of the mysql process to -15, but this would not prevent it from being killed due to out of memory. The lsblk command would display information about block devices, not memory usage. The killall -15 command would send a SIGTERM signal to all processes with a matching name, but this would not help to troubleshoot the memory issue. Reference: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 15: Managing Memory and Process Execution, pages 468-469.

Users have reported that the interactive sessions were lost on a Linux server. A Linux administrator verifies the server was switched to rescue.target mode for maintenance. Which of the following commands will restore the server to its usual target?

A.
telinit 0
A.
telinit 0
Answers
B.
systemctl reboot
B.
systemctl reboot
Answers
C.
systemctl get-default
C.
systemctl get-default
Answers
D.
systemctl emergency
D.
systemctl emergency
Answers
Suggested answer: B

Explanation:

The systemctl reboot command will restore the server to its usual target by rebooting it. This will cause the server to load the default target specified in /etc/systemd/system.conf or /etc/systemd/system/default.target files. The telinit 0 command would shut down the server, not restore it to its usual target. The systemctl get-default command would display the default target, not change it. The systemctl emergency command would switch the server to emergency.target mode, which is even more restrictive than rescue.target mode. Reference: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 17: System Maintenance and Operation, page 516.

A systems administrator was tasked with assigning the temporary IP address/netmask 192.168.168.1/255.255.255.255 to the interface eth0 of a Linux server.

When adding the address, the following error appears:

# ip address add 192.168.168.1/33 dev eth0

Error: any valid prefix is expected rather than "192.168.168.1/33".

Based on the command and its output above, which of the following is the cause of the issue?

A.
The CIDR value /33 should be /32 instead.
A.
The CIDR value /33 should be /32 instead.
Answers
B.
There is no route to 192.168.168.1/33.
B.
There is no route to 192.168.168.1/33.
Answers
C.
The interface eth0 does not exist.
C.
The interface eth0 does not exist.
Answers
D.
The IP address 192.168.168.1 is already in use.
D.
The IP address 192.168.168.1 is already in use.
Answers
Suggested answer: A

Explanation:

The cause of the issue is that the CIDR value /33 is invalid for an IPv4 address. The CIDR value represents the number of bits in the network prefix of an IP address, and it can range from 0 to 32 for IPv4 addresses. A CIDR value of /33 would imply a network prefix of more than 32 bits, which is impossible for an IPv4 address. To assign a temporary IP address/netmask of 192.168.168.1/255.255.255.255 to eth0, the CIDR value should be /32 instead, which means a network prefix of 32 bits and a host prefix of 0 bits. There is no route to 192.168.168.1/33 is not the cause of the issue, as the ip address add command does not check the routing table. The interface eth0 does not exist is not the cause of the issue, as the ip address add command would display a different error message if the interface does not exist. The IP address 192.168.168.1 is already in use is not the cause of the issue, as the ip address add command would display a different error message if the IP address is already in use. Reference: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 13: Networking Fundamentals, page 435.

A Linux user reported the following error after trying to connect to the system remotely:

ssh: connect to host 10.0.1.10 port 22: Resource temporarily unavailable

The Linux systems administrator executed the following commands in the Linux system while trying to diagnose this issue:

Which of the following commands will resolve this issue?

A.
firewall-cmd --zone=public --permanent --add-service=22
A.
firewall-cmd --zone=public --permanent --add-service=22
Answers
B.
systemctl enable firewalld; systemctl restart firewalld
B.
systemctl enable firewalld; systemctl restart firewalld
Answers
C.
firewall-cmd --zone=public --permanent --add-service=ssh
C.
firewall-cmd --zone=public --permanent --add-service=ssh
Answers
D.
firewall-cmd --zone=public --permanent --add-port=22/udp
D.
firewall-cmd --zone=public --permanent --add-port=22/udp
Answers
Suggested answer: C

Explanation:

The firewall-cmd --zone=public --permanent --add-service=ssh command will resolve the issue by allowing SSH connections on port 22 in the public zone of the firewalld service. This command will add the ssh service to the permanent configuration of the public zone, which means it will persist after a reboot or a reload of the firewalld service. The firewall-cmd --zone=public --permanent --addservice= 22 command is invalid, as 22 is not a valid service name. The systemctl enable firewalld; systemctl restart firewalld command will enable and restart the firewalld service, but it will not change the firewall rules. The firewall-cmd --zone=public --permanent --add-port=22/udp command will allow UDP traffic on port 22 in the public zone, but SSH uses TCP, not UDP. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 543.

A Linux administrator has been tasked with installing the most recent versions of packages on a RPMbased OS. Which of the following commands will accomplish this task?

A.
apt-get upgrade
A.
apt-get upgrade
Answers
B.
rpm -a
B.
rpm -a
Answers
C.
yum updateinfo
C.
yum updateinfo
Answers
D.
dnf update
D.
dnf update
Answers
E.
yum check-update
E.
yum check-update
Answers
Suggested answer: D

Explanation:

The dnf update command will accomplish the task of installing the most recent versions of packages on a RPM-based OS. This command will check for available updates from the enabled repositories and apply them to the system. The apt-get upgrade command is used to install updates on a Debianbased OS, not a RPM-based OS. The rpm -a command is invalid, as -a is not a valid option for rpm.

The yum updateinfo command will display information about available updates, but it will not install them. The yum check-update command will check for available updates, but it will not install them. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Packages and Software, page 559.

Total 371 questions
Go to page: of 38