Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Pass XK0-005 Exam Latest Practice Questions Updated on May 04, 2024 [Q155-Q174]

Share

Pass XK0-005 Exam Latest Practice Questions Updated on May 04, 2024

CompTIA XK0-005 Study Guide Archives 

NEW QUESTION # 155
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. ssh-copy-id
  • B. scp
  • C. ssh-agent
  • D. ssh-keyscan

Answer: A

Explanation:
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.


NEW QUESTION # 156
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 -n 192.168.1.40 from 10.0.2.15
  • B. ip route get 192.163.1.40 from 10.0.2.15
  • C. ip route 192.169.1.40 to 10.0.2.15
  • D. route -e get to 192.168.1.40 from 10.0.2.15

Answer: B

Explanation:
Explanation
The command ip route get 192.168.1.40 from 10.0.2.15 will test the route between the IP address 10.0.2.15 and the IP address 192.168.1.40. The ip route get command shows the routing decision for a given destination and source address. This is the correct command to accomplish the task. The other options are incorrect because they either use the wrong commands (route instead of ip route), the wrong options (-e or -n instead of get), or the wrong syntax (to instead of from). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 379.


NEW QUESTION # 157
A systems administrator is investigating why one of the servers has stopped connecting to the internet.

Which of the following is causing the issue?

  • A. No default route is defined.
  • B. Wired connection 1 is offline.
  • C. The DNS address has been commented out in the configuration file.
  • D. The search entry in the /etc/resolv.conf file is incorrect.

Answer: A

Explanation:
Explanation
The issue is caused by the lack of a default route defined in the /etc/sysconfig/network-scripts/ifcfg-enp0s3 file. A default route is a special route that specifies where to send packets that do not match any other routes in the routing table. Without a default route, the server will not be able to communicate with hosts outside its local network. The default route is usually configured with the GATEWAY option in the network interface configuration file. For example, to set the default gateway to 192.168.1.1, the file should contain:
GATEWAY=192.168.1.1
The other options are not causing the issue. The DNS address is not commented out in the configuration file, it is specified with the DNS1 option. The search entry in the /etc/resolv.conf file is correct, it specifies the domain name to append to unqualified hostnames. Wired connection 1 is online, as indicated by the ONBOOT=yes option and the output of ip link show enp0s3 command. References: Configuring IP Networking with nmcli; Configuring IP Networking with ifcfg Files


NEW QUESTION # 158
A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?

  • A. docker images prune -a
  • B. docker rmi -a images
  • C. docker images rmi --all
  • D. docker push images -a

Answer: A

Explanation:
Explanation
The command docker images prune -a will help to remove all dangling images and delete all the images that do not have an associated container. The docker command is a tool for managing Docker containers and images. The images subcommand operates on images. The prune option removes unused images.
The -a option removes all images, not just dangling ones. A dangling image is an image that is not tagged and is not referenced by any container. This command will accomplish the task of cleaning up the unused images.
The other options are incorrect because they either do not exist (docker push images -a or docker images rmi
--all) or do not remove images (docker rmi -a images only removes images that match the name or ID of
"images"). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 567.


NEW QUESTION # 159
A systems administrator is investigating a service that is not starting up. Given the following information:

Which of the following systemd commands should the administrator use in order to obtain more details about the failing service?

  • A. sysctl -a network
  • B. systemct1 info network
  • C. journalctl -xu network
  • D. systemct1 analyze network

Answer: C

Explanation:
Explanation
The systemd is a system and service manager for Linux systems that provides a standard way to control and monitor system services. The systemd uses various commands and tools to manage and troubleshoot system services, such as systemct1, sysctl, and journalctl. The systemct1 command is used to start, stop, enable, disable, restart, reload, status, and list system services. The sysctl command is used to configure kernel parameters at runtime. The journalctl command is used to view and filter the logs of system services.
To investigate a service that is not starting up, the administrator can use the journalctl command with the -xu option. The -x option enables verbose output that includes explanatory text and priority information.
The -u option filters the output by a specific unit name, such as network.service. Therefore, the command journalctl -xu network will show detailed logs of the network service, which can help identify the cause of the failure. The statement D is correct.
The statements A, B, and C are incorrect because they do not provide more details about the failing service.
The systemct1 analyze network command does not exist. The systemct1 info network command shows basic information about the network unit, such as description, load state, active state, sub state, and main PID.
The sysctl -a network command shows all kernel parameters related to network settings. References: [How to Use Systemd to Manage System Services]


NEW QUESTION # 160
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. Recreate the logical volume.
  • B. Reboot the server. The volume will automatically go back to linear mode.
  • C. Reboot the server. The volume will revert to stripe mode.
  • D. Replace the failed drive and reconfigure the mirror.

Answer: D


NEW QUESTION # 161
A Linux administrator is reviewing changes to a configuration file that includes the following section:

The Linux administrator is trying to select the appropriate syntax formatter to correct any issues with the configuration file. Which of the following should the syntax formatter support to meet this goal?

  • A. XML
  • B. Markdown
  • C. JSON
  • D. YAML

Answer: D

Explanation:
The configuration file shown in the image is written in YAML format, so the syntax formatter should support YAML to correct any issues with the file. YAML stands for YAML Ain't Markup Language, and it is a human-readable data serialization language that uses indentation and colons to define key-value pairs. YAML supports various data types, such as scalars, sequences, mappings, anchors, aliases, and tags. The configuration file follows the rules and syntax of YAML, while the other options do not. Markdown is a lightweight markup language that uses plain text formatting to create rich text documents. XML is a markup language that uses tags to enclose elements and attributes. JSON is a data interchange format that uses curly braces to enclose objects and square brackets to enclose arrays. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 21: Automating Tasks with Ansible, page 591.


NEW QUESTION # 162
A cloud engineer needs to block the IP address 192.168.10.50 from accessing a Linux server. Which of the following commands will achieve this goal?

  • A. iptables -A INPUT -s 192.168.10.30 -j DROP
  • B. iptables -j INPUT 192.168.10.50 -p DROP
  • C. iptables -F INPUT -j 192.168.10.50 -m DROP
  • D. iptables -i INPUT --ipv4 192.168.10.50 -z DROP

Answer: A


NEW QUESTION # 163
A junior administrator is trying to set up a passwordless SSH connection to one of the servers. The administrator follows the instructions and puts the key in the authorized_key file at the server, but the administrator is still asked to provide a password during the connection.
Given the following output:

Which of the following commands would resolve the issue and allow an SSH connection to be established without a password?

  • A. restorecon -rv .ssh/authorized_key
  • B. chmod 600 mv .ssh/authorized_key
  • C. mv .ssh/authorized_key .ssh/authorized_keys
  • D. systemct1 restart sshd.service

Answer: C

Explanation:
Explanation
The command mv .ssh/authorized_key .ssh/authorized_keys will resolve the issue and allow an SSH connection to be established without a password. The issue is caused by the incorrect file name of the authorized key file on the server. The file should be named authorized_keys, not authorized_key.
The mv command will rename the file and fix the issue. The other options are incorrect because they either do not affect the file name (restorecon or chmod) or do not restart the SSH service (systemct1). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 410.


NEW QUESTION # 164
A systems administrator receives reports that several virtual machines in a host are responding slower than expected. Upon further investigation, the administrator obtains the following output from one of the affected systems:

Which of the following best explains the reported issue?

  • A. The virtual machine is running out of CPU resources, leading to users experiencing longer response times.
  • B. The virtual machine has enough CPU cycles, leading to the system use percentage being higher than expected.
  • C. The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines.
  • D. The physical host has enough CPU cores, leading to users running more processes to compensate for the slower response times.

Answer: A

Explanation:
Explanation
Based on the output from one of the affected systems, the best explanation for the reported issue is that the virtual machine is running out of CPU resources, leading to users experiencing longer response times (D). The output shows that the system use percentage is very high (57.85%), indicating that the virtual machine is using most of its CPU cycles for system processes. This leaves little CPU time for user processes, which results in slower performance. The other explanations are not supported by the output or are contradictory. References:
[CompTIA Linux+ Study Guide], Chapter 8: Optimizing Linux Performance, Section: Monitoring CPU Usage
[How to Interpret CPU Usage Statistics]


NEW QUESTION # 165
A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?

  • A. docker images prune -a
  • B. docker rmi -a images
  • C. docker images rmi --all
  • D. docker push images -a

Answer: A

Explanation:
The command docker images prune -a will help to remove all dangling images and delete all the images that do not have an associated container. The docker command is a tool for managing Docker containers and images. The images subcommand operates on images. The prune option removes unused images. The -a option removes all images, not just dangling ones. A dangling image is an image that is not tagged and is not referenced by any container. This command will accomplish the task of cleaning up the unused images. The other options are incorrect because they either do not exist (docker push images -a or docker images rmi --all) or do not remove images (docker rmi -a images only removes images that match the name or ID of "images"). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 567.


NEW QUESTION # 166
A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries.

Which of the following commands would be BEST to use to accomplish this task?

  • A. chattr +i /opt/app/logs
  • B. chattr +d /opt/app/logs
  • C. chattr +c /opt/app/logs
  • D. chattr +a /opt/app/logs

Answer: D

Explanation:
Explanation
The command chattr +a /opt/app/logs will ensure the log file can only be written into without removing previous entries. The chattr command is a tool for changing file attributes on Linux file systems. The +a option sets the append-only attribute, which means that the file can only be opened in append mode for writing. This prevents the file from being modified, deleted, or renamed. This is the best command to use to accomplish the task. The other options are incorrect because they either set the wrong attributes (+d, +i, or +c) or do not affect the file at all (-a). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing Files and Directories, page 357.


NEW QUESTION # 167
An administrator installed an application from source into /opt/operations1/ and has received numerous reports that users are not able to access the application without having to use the full path /opt/operations1/bin/*. Which of the following commands should be used to resolve this issue?

  • A. echo 'export $PATH:/opt/operations1/bin' >> /etc/profile
  • B. echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile
  • C. echo 'export PATH=/opt/operations1/bin' >> /etc/profile
  • D. echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile

Answer: B


NEW QUESTION # 168
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?

  • A. git reflog
  • B. git pull
  • C. git push
  • D. git status

Answer: B

Explanation:
Explanation
The command iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination
192.0.2.25:3128 adds a rule to the nat table that redirects all incoming TCP packets with destination port 80 (HTTP) to the proxy server 192.0.2.25 on port 3128. This is the correct way to achieve the task. The other options are incorrect because they either delete a rule (-D), use the wrong protocol (top instead of tcp), or use the wrong port (81 instead of 80). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 381.


NEW QUESTION # 169
A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?

  • A. ssh-add user server
  • B. ssh-copy-id user@server
  • C. rsync ~ /.ssh/ user@server:~/
  • D. scp ~/.ssh/id_rsa user@server:~/

Answer: B


NEW QUESTION # 170
A systems administrator detected corruption in the /data filesystem. Given the following output:

Which of the following commands can the administrator use to best address this issue?

  • A. umount /data
    pvs /dev/sdcl
    mount /data
  • B. umount /data
    xfs repair /dev/ sdcl
    mount /data
  • C. umount /data
    mkfs . xfs /dev/sclcl
    mount /data
  • D. umount /data
    fsck /dev/ sdcl
    mount / data

Answer: B

Explanation:
Explanation
The xfs repair command is used to check and repair an XFS filesystem, which is the type of filesystem used for the /data partition, as shown in the output. The administrator needs to unmount the /data partition before running the xfs repair command on it, and then mount it back after the repair is done. For example: umount
/data; xfs_repair /dev/sdcl; mount /data. The mkfs.xfs command is used to create a new XFS filesystem, which would erase all the data on the partition. The fsck command is used to check and repair other types of filesystems, such as ext4, but not XFS. The pvs command is used to display information about physical volumes in a logical volume manager (LVM) setup, which is not relevant for this issue.


NEW QUESTION # 171
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-service=ssh
  • D. firewall-cmd --zone=public --permanent --add-port=22/udp

Answer: C

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 # 172
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. chattr +i file
  • C. chmod 666 file
  • D. chown it:finance file

Answer: A

Explanation:
The command setfacl -m g:finance:rw file will permanently fix the access issue while limiting access to IT and finance department employees. The setfacl command is a tool for modifying the access control lists (ACLs) of files and directories on Linux systems. The ACLs are a mechanism that allows more fine-grained control over the permissions of files and directories than the traditional owner-group-others model. The -m option specifies the modification to the ACL. The g:finance:rw means that the group named finance will have read and write permissions on the file. The file is the name of the file to modify, in this case /opt/work/file. The command setfacl -m g:finance:rw file will add an entry to the ACL of the file that will grant read and write access to the finance group. This will fix the access issue and allow the finance employees to access the file. The command will also preserve the existing permissions of the file, which means that the IT employees will still have read and write access to the file. This will limit the access to IT and finance department employees and prevent unauthorized access from other users. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not fix the access issue (chattr +i file or chown it:finance file) or do not limit the access to IT and finance department employees (chmod 666 file). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing File Permissions and Ownership, page 352.


NEW QUESTION # 173
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 account was locked out due to three failed logins.
  • B. The wrong permissions are on the user's home directory.
  • C. The user entered the wrong password.
  • D. The user has the wrong shell assigned to the account.

Answer: D

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 # 174
......


CompTIA Linux+ certification exam is an essential certification for IT professionals who work with Linux-based systems. CompTIA Linux+ Certification Exam certification is ideal for system administrators, network administrators, and technical support specialists who want to demonstrate their skills and knowledge of Linux operating systems. CompTIA Linux+ Certification Exam certification is also suitable for professionals who want to expand their skillset and advance their careers in the IT industry.

 

XK0-005 Questions Prepare with Learning Information: https://www.testsimulate.com/XK0-005-study-materials.html