[Jun-2024] XK0-005 Questions - Truly Beneficial For Your CompTIA Exam
Download CompTIA XK0-005 Sample Questions
NEW QUESTION # 22
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. systemct1 enable firewalld; systemct1 restart firewalld
- B. firewall-cmd --zone=public --permanent --add-service=22
- C. firewall-cmd --zone=public --permanent --add-port=22/udp
- D. firewall-cmd --zone=public --permanent --add-service=ssh
Answer: D
Explanation:
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 --add-service=22 command is invalid, as 22 is not a valid service name. The systemct1 enable firewalld; systemct1 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. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 543.
NEW QUESTION # 23
A systems administrator is adding a Linux-based server and removing a Windows-based server from a cloud-based environment. The changes need to be validated before they are applied to the cloud-based environment. Which of the following tools should be used to meet this requirement?
- A. git clone
- B. git pull
- C. Ansible
- D. terraform plan
Answer: D
Explanation:
Terraform is a tool for building, changing, and managing infrastructure as code in a cloud-based environment. Terraform uses configuration files to describe the desired state of the infrastructure and applies changes accordingly. Terraform supports various cloud providers, such as AWS, Azure, Google Cloud Platform, and more.
To validate changes before they are applied to the cloud-based environment, the administrator can use the terraform plan command. This command will compare the current state of the infrastructure with the desired state defined in the configuration files and show what actions will be performed to achieve the desired state. This command will not make any changes to the infrastructure but only show a plan of changes. The statement D is correct.
The statements A, B, and C are incorrect because they do not validate changes before they are applied to the cloud-based environment. Ansible is another tool for automating infrastructure management, but it does not have a plan command. Git clone and git pull are commands for working with git repositories, which are used for version control of code. Reference: [How to Use Terraform to Manage Cloud Infrastructure]
NEW QUESTION # 24
A DevOps engineer needs to download a Git repository from https://git.company.com/admin/project.git. Which of the following commands will achieve this goal?
- A. git clone https://git.company.com/admin/project.git
- B. git pull https://git.company.com/admin/project.git
- C. git checkout https://git.company.com/admin/project.git
- D. git branch https://git.company.com/admin/project.git
Answer: A
NEW QUESTION # 25
A Linux administrator wants to set the SUID of a file named dev_team.text with 744 access rights. Which of the following commands will achieve this goal?
- A. chmod 744 --setuid dev_team.txt
- B. chmod -c 744 dev_team.txt
- C. chmod 4744 dev_team.txt
- D. chmod -v 4744 --suid dev_team.txt
Answer: C
Explanation:
Explanation
The command that will set the SUID of a file named dev_team.txt with 744 access rights is chmod 4744 dev_team.txt. This command will use the chmod utility to change the file mode bits of dev_team.txt. The first digit (4) represents the SUID bit, which means that when someone executes dev_team.txt, it will run with the permissions of the file owner. The next three digits (744) represent the read, write, and execute permissions for the owner (7), group (4), and others (4). This means that the owner can read, write, and execute dev_team.txt, while the group and others can only read it.
The other options are not correct commands for setting the SUID of a file with 744 access rights. The chmod
744 --setuid dev_team.txt command is invalid because there is no --setuid option in chmod. The chmod -c 744 dev_team.txt command will change the file mode bits to 744, but it will not set the SUID bit. The -c option only means that chmod will report when a change is made. The chmod -v 4744 --suid dev_team.txt command is also invalid because there is no --suid option in chmod. The -v option only means that chmod will output a diagnostic for every file processed. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups; chmod(1) - Linux manual page
NEW QUESTION # 26
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 interface eth0 does not exist.
- B. There is no route to 192.168.168.1/33.
- C. The IP address 192.168.168.1 is already in use.
- D. The CIDR value /33 should be /32 instead.
Answer: D
Explanation:
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. References: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 13:
Networking Fundamentals, page 435.
NEW QUESTION # 27
Employees in the finance department are having trouble accessing the file /opt/work/file. All IT employees can read and write the file. Systems administrator reviews the following output:
Which of the following commands would permanently fix the access issue while limiting access to IT and finance department employees?
- A. setfacl -m g:finance:rw file
- B. chown it:finance file
- C. chmod 666 file
- D. chattr +i file
Answer: A
NEW QUESTION # 28
A junior administrator is setting up a new Linux server that is intended to be used as a router at a remote site. Which of the following parameters will accomplish this goal?
- A.

- B.

- C.

- D.

Answer: C
Explanation:
The parameter net.ipv4.ip_forward=1 will accomplish the goal of setting up a new Linux server as a router. This parameter enables the IP forwarding feature, which allows the server to forward packets between different network interfaces. This is necessary for a router to route traffic between different networks. The parameter can be set in the /etc/sysctl.conf file or by using the sysctl command. This is the correct parameter to use to accomplish the goal. The other options are incorrect because they either do not exist (net.ipv4.ip_forwarding or net.ipv4.ip_route) or do not enable IP forwarding (net.ipv4.ip_forward=0). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 382.
NEW QUESTION # 29
Users are unable to create new files on the company's FTP server, and an administrator is troubleshooting the issue. The administrator runs the following commands:
Which of the following is the cause of the issue based on the output above?
- A. The users do not have the correct permissions to create files on the FTP server.
- B. ftpusers is mounted as read only.
- C. The inodes is at full capacity and would affect file creation for users.
- D. The ftpusers filesystem does not have enough space.
Answer: C
Explanation:
Explanation
The cause of the issue based on the output above is C. The inodes is at full capacity and would affect file creation for users.
An inode is a data structure that stores information about a file or directory, such as its name, size, permissions, owner, timestamps, and location on the disk. Each file or directory has a unique inode number that identifies it. The number of inodes on a filesystem is fixed when the filesystem is created, and it determines how many files and directories can be created on that filesystem. If the inodes are exhausted, no new files or directories can be created, even if there is enough disk space available.
The output for the second command shows that the /ftpusers/ filesystem has 0% of inodes available, which means that all the inodes have been used up. This would prevent users from creating new files on the FTP server. The administrator should either delete some unused files or directories to free up some inodes, or resize the filesystem to increase the number of inodes.
The other options are incorrect because:
A: The users do not have the correct permissions to create files on the FTP server.
This is not true, because the output for the first command shows that the /ftpusers/ filesystem has 26% of disk space available, which means that there is enough space for users to create files. The permissions of the files and directories are not shown in the output, but they are not relevant to the issue of inode exhaustion.
B: The ftpusers filesystem does not have enough space.
This is not true, because the output for the first command shows that the /ftpusers/ filesystem has 26% of disk space available, which means that there is enough space for users to create files. The issue is not related to disk space, but to inode capacity.
D: ftpusers is mounted as read only.
This is not true, because the output for the first command does not show any indication that the /ftpusers/ filesystem is mounted as read only. If it was, it would have an (ro) flag next to the mounted on column. A read only filesystem would prevent users from creating or modifying files on the FTP server, but it would not affect the inode usage.
NEW QUESTION # 30
A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?
- A. chown -cf
- B. chactr -Rv
- C. chmod 775
- D. umask. 002
Answer: D
NEW QUESTION # 31
An administrator is trying to diagnose a performance issue and is reviewing the following output:
System Properties:
CPU: 4 vCPU
Memory: 40GB
Disk maximum IOPS: 690
Disk maximum throughput: 44Mbps | 44000Kbps
Based on the above output, which of the following BEST describes the root cause?
- A. The system has reached its maximum permitted throughput, therefore iowait is increasing.
- B. The system has a partitioned disk, which causes the IOPS to be doubled.
- C. The system has reached its maximum IOPS, causing the system to be slow.
- D. The system is mostly idle, therefore the iowait is high.
Answer: A
Explanation:
The system has reached its maximum permitted throughput, therefore iowait is increasing. The output of iostat -x shows that the device sda has an average throughput of 44.01 MB/s, which is equal to the disk maximum throughput of 44 Mbps. The output also shows that the device sda has an average iowait of 99.99%, which means that the CPU is waiting for the disk to complete the I/O requests. This indicates that the disk is the bottleneck and the system is slow due to the high iowait. The other options are incorrect because they are not supported by the outputs. The system has not reached its maximum IOPS, as the device sda has an average IOPS of 563.50, which is lower than the disk maximum IOPS of 690. The system is not mostly idle, as the output of top shows that the CPU is 100% busy. The system does not have a partitioned disk, as the output of lsblk shows that the device sda has only one partition sda1. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 17: Optimizing Linux Systems, pages 513-514.
NEW QUESTION # 32
A Linux system is failing to boot with the following error:
Which of the following actions will resolve this issue? (Choose two.)
- A. Execute grub-install --root-directory=/mnt and reboot.
- B. Fix the partition modifying /etc/default/grub and reboot.
- C. Interrupt the boot process in the GRUB menu and add rescue to the kernel line.
- D. Boot the system on a LiveCD/ISO.
- E. Execute grub-install /dev/sdX and reboot.
- F. Interrupt the boot process in the GRUB menu and add single to the kernel line.
Answer: D,E
Explanation:
Explanation
The administrator should do the following two actions to resolve the issue:
Boot the system on a LiveCD/ISO. This is necessary to access the system and repair the boot loader. A LiveCD/ISO is a bootable media that contains a Linux distribution that can run without installation. The administrator can boot the system from the LiveCD/ISO and mount the root partition of the system to a temporary directory, such as /mnt.
Execute grub-install /dev/sdX and reboot. This will reinstall the GRUB boot loader to the disk device, where sdX is the device name of the disk, such as sda or sdb. The GRUB boot loader is a program that runs when the system is powered on and allows the user to choose which operating system or kernel to boot. The issue is caused by a corrupted or missing GRUB boot loader, which prevents the system from booting. The command grub-install will restore the GRUB boot loader and fix the issue.
The other options are incorrect because they either do not fix the boot loader (interrupt the boot process in the GRUB menu or fix the partition modifying /etc/default/grub) or do not use the correct syntax (grub-install
--root-directory=/mnt instead of grub-install /dev/sdX or rescue or single instead of recovery in the GRUB menu). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing the Linux Boot Process, pages 265-266.
NEW QUESTION # 33
A systems administrator received a request to change a user's credentials. Which of the following commands will grant the request?
- A. sudo userde 1
- B. sudo chage
- C. sudo passwd
- D. sudo usermod
Answer: C
Explanation:
This command will allow the systems administrator to change the password of another user account in the system. The sudo prefix will grant the administrator the necessary privileges to perform this action, and the passwd command will prompt for the new password for the specified user. For example, if the administrator wants to change the password of a user named tom, the command will look like this:
sudo passwd tom
The other options are incorrect because:
B) sudo userdel
This command will delete a user account from the system, not change its credentials. The userdel command removes the user's entry from the /etc/passwd and /etc/shadow files, as well as deletes the user's home directory and mail spool. This is not what the request asked for.
C) sudo chage
This command will change the password expiration and aging information for a user account, not its credentials. The chage command can be used to set or modify various parameters related to password aging, such as the minimum and maximum number of days between password changes, the number of days before password expiration to issue a warning, and so on. This is not what the request asked for.
D) sudo usermod
This command will modify various attributes of a user account, such as its login name, home directory, default shell, primary group, and so on. However, it cannot change the user's password directly. To do that, the usermod command requires the -p option followed by an encrypted password string, which is not easy to generate manually. Therefore, this is not a practical way to change a user's credentials.
Reference:
How to Change Account Passwords on Linux
How to Change a Password in Linux for Root and Other Users
CompTIA Linux+ Certification Exam Objectives
NEW QUESTION # 34
A file called testfile has both uppercase and lowercase letters:
$ cat testfile
ABCDEfgH
IJKLmnoPQ
abcdefgH
ijklLMNopq
A Linux administrator is tasked with converting testfile into all uppercase and writing it to a new file with the name uppercase. Which of the following commands will achieve this task?
- A. cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase
- B. echo testfile | tr "[Z-A]" "[z-a]" < testfile > uppercase
- C. tr '[a-z]' '[A-Z]' < testfile > uppercase
- D. tr '(A-Z}' '{a-z}' < testfile > uppercase
Answer: C
Explanation:
Explanation
This command will use the tr tool to translate all lowercase letters in the testfile to uppercase letters and write the output to the uppercase file. The first argument '[a-z]' specifies the set of characters to be replaced, and the second argument '[A-Z]' specifies the set of characters to replace with. The '<' symbol redirects the input from the testfile, and the '>' symbol redirects the output to the uppercase file12.
References: 1: Linux Tr Command - javatpoint 2: Linux tr Command with Examples - phoenixNAP
NEW QUESTION # 35
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. du -sh /oracle1
- B. lsblk /dev/sdb1
- C. fdisk -1 /dev/sdb1
- D. df -i /oracle1
Answer: D
NEW QUESTION # 36
A Linux administrator cloned an existing Linux server and built a new server from that clone. The administrator encountered the following error after booting the cloned server:
The administrator performed the commands listed below to further troubleshoot and mount the missing filesystem:
Which of the following should administrator use to resolve the device mismatch issue and mount the disk?
- A. mount disk by-blkid
- B. mount disk by-label
- C. fsck -A
- D. mount disk by device-id
Answer: D
Explanation:
Explanation
The administrator should use the command mount disk by device-id to resolve the device mismatch issue and mount the disk. The issue is caused by the cloned server having a different device name for the disk than the original server. The output of blkid shows that the disk has the device name /dev/sdb1 on the cloned server, but the output of cat /etc/fstab shows that the disk is expected to have the device name /dev/sda1. The command mount disk by device-id will mount the disk by using its unique identifier (UUID) instead of its device name. The UUID can be obtained from the output of blkid or lsblk -f. The command will mount the disk to the specified mount point (/data) and resolve the issue. The other options are incorrect because they either do not mount the disk (fsck -A), do not use the correct identifier (mount disk by-label or mount disk by-blkid), or do not exist (mount disk by-blkid). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 318-319.
NEW QUESTION # 37
A systems administrator wants to test the route between IP address 10.0.2.15 and IP address 192.168.1.40. Which of the following commands will accomplish this task?
- A. route -e get to 192.168.1.40 from 10.0.2.15
- B. ip route get 192.163.1.40 from 10.0.2.15
- C. route -n 192.168.1.40 from 10.0.2.15
- D. ip route 192.169.1.40 to 10.0.2.15
Answer: B
NEW QUESTION # 38
A systems engineer is adding a new 1GB XFS filesystem that should be temporarily mounted under /ops/app.
Which of the following is the correct list of commands to achieve this goal?
- A.

- B.

- C.

- D.

Answer: B
Explanation:
Explanation
The list of commands in option D is the correct way to achieve the goal. The commands are as follows:
fallocate -l 1G /ops/app.img creates a 1GB file named app.img under the /ops directory.
mkfs.xfs /ops/app.img formats the file as an XFS filesystem.
mount -o loop /ops/app.img /ops/app mounts the file as a loop device under the /ops/app directory. The other options are incorrect because they either use the wrong commands (dd or truncate instead of fallocate), the wrong options (-t or -f instead of -o), or the wrong order of arguments (/ops/app.img
/ops/app instead of /ops/app /ops/app.img). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 323-324.
NEW QUESTION # 39
A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task?
- A. lsof filename
- B. touch filename
- C. file filename
- D. grep filename
Answer: C
Explanation:
The file command is used to determine the type of a file by examining its contents. It can recognize many different formats, such as text, binary, executable, compressed, image, audio, video, etc. It can also display some additional information about the file, such as encoding, size, dimensions, etc12
NEW QUESTION # 40
A Linux administrator is troubleshooting an issue in which an application service failed to start on a Linux server. The administrator runs a few commands and gets the following outputs:
Based on the above outputs, which of the following is the MOST likely action the administrator should take to resolve this issue?
- A. Update the KillSignal configuration for the logsearch.service to use TERM.
- B. Enable the logsearch.service and restart the service.
- C. Increase the TimeoutStartUSec configuration for the logsearch.sevice.
- D. Update the OnCalendar configuration to schedule the start of the logsearch.service.
Answer: C
Explanation:
Explanation
The administrator should increase the TimeoutStartUSec configuration for the logsearch.service to resolve the issue. The output of systemctl status logsearch.service shows that the service failed to start due to a timeout.
The output of cat /etc/systemd/system/logsearch.service shows that the service has a TimeoutStartUSec configuration of 10 seconds, which might be too short for the service to start. The administrator should increase this value to a higher number, such as 30 seconds or 1 minute, and then restart the service. The other options are incorrect because they are not related to the issue. The service is already enabled, as shown by the output of systemctl is-enabled logsearch.service. The service does not use an OnCalendar configuration, as it is not a timer unit. The service does not use a KillSignal configuration, as it is not being killed by a signal. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, pages 434-435.
NEW QUESTION # 41
A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers. Which of the following commands can be used to copy a key file to remote servers? (Choose two.)
- A. ssh-keyscan
- B. ssh-keygen
- C. ssh-copy-id
- D. wget
- E. scp
- F. ftpd
Answer: C,E
NEW QUESTION # 42
When trying to log in remotely to a server, a user receives the following message:
The server administrator is investigating the issue on the server and receives the following outputs:
Which of the following is causing the issue?
- A. The wrong permissions are on the user's home directory.
- B. The user has the wrong shell assigned to the account.
- C. The user entered the wrong password.
- D. The account was locked out due to three failed logins.
Answer: B
Explanation:
Explanation
The user has the wrong shell assigned to the account, which is causing the issue. The output 1 shows that the user's shell is set to /bin/false, which is not a valid shell and will prevent the user from logging in. The output
2 shows that the user's home directory has the correct permissions (drwxr-xr-x), and the output 3 shows that the user entered the correct password and was accepted by the SSH daemon, but the session was closed immediately due to the invalid shell. The other options are incorrect because they are not supported by the outputs. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 413.
NEW QUESTION # 43
A new drive was recently added to a Linux system. Using the environment and tokens provided, complete the following tasks:
* Create an appropriate device label.
* Format and create an ext4 file system on the new partition.
The current working directory is /.
Answer:
Explanation:
NEW QUESTION # 44
......
Truly Beneficial For Your CompTIA Exam: https://www.dumpsking.com/XK0-005-testking-dumps.html
Real XK0-005 Exam Questions and Answers FREE: https://drive.google.com/open?id=1c_yPof-XmH90swpgvPGJaTunbB3Vy0kc
