UPDATED [Dec 10, 2023] Pass CompTIA Linux+ Certification Exam Exam with Latest Questions [Q75-Q95]

Share

UPDATED [Dec 10, 2023] Pass CompTIA Linux+ Certification Exam Exam with Latest Questions

XK0-005 Exam Practice Questions prepared by CompTIA Professionals


CompTIA XK0-005 exam is a certification exam designed for individuals who want to demonstrate their knowledge and skills in Linux administration. XK0-005 exam is the latest version of the CompTIA Linux+ certification and is aimed at IT professionals who are interested in pursuing a career in Linux system administration. XK0-005 exam covers a wide range of topics, including system configuration, management, security, and troubleshooting, among others.

 

NEW QUESTION # 75
A systems administrator frequently connects to a remote host via SSH and a non-standard port. The systems administrator would like to avoid passing the port parameter on the command line every time. Which of the following files can be used to set a different port value for that host?

  • A. ~/.ssh/config
  • B. ~/.ssh/authorized_keys
  • C. /etc/ssh/moduli
  • D. /etc/ssh/sshd_config

Answer: A

Explanation:
Explanation
The ~/.ssh/config file can be used to set various options for SSH connections, including the port number, for specific hosts or groups of hosts. This file is located in the user's home directory and affects only the current user. The /etc/ssh/sshd_config file is used to configure the SSH server daemon, not the client. The
/etc/ssh/moduli file contains parameters for Diffie-Hellman key exchange, not port settings. The
~/.ssh/authorized_keys file contains public keys for authentication, not port settings. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Secure Shell (SSH), page 414.


NEW QUESTION # 76
A developer has been unable to remove a particular data folder that a team no longer uses. The developer escalated the issue to the systems administrator. The following output was received:

Which of the following commands can be used to resolve this issue?

  • A. chattr -R -i data/
  • B. chmod -R 777 data/
  • C. chown -R data/
  • D. chgrp -R 755 data/

Answer: A

Explanation:
Explanation
The command that can be used to resolve the issue of being unable to remove a particular data folder is chattr
-R -i data/. This command will use the chattr utility to change file attributes on a Linux file system. The -R option means that chattr will recursively change attributes of directories and their contents. The -i option means that chattr will remove (unset) the immutable attribute from files or directories. When a file or directory has the immutable attribute set, it cannot be modified, deleted, or renamed.
The other options are not correct commands for resolving this issue. The chgrp -R 755 data/ command will change the group ownership of data/ and its contents recursively to 755, which is not a valid group name. The chgrp command is used to change group ownership of files or directories. The chmod -R 777 data/ command will change the file mode bits of data/ and its contents recursively to 777, which means that everyone can read, write, and execute them. However, this will not remove the immutable attribute, which prevents deletion or modification regardless of permissions. The chmod command is used to change file mode bits of files or directories. The chown -R data/ command is incomplete and will produce an error. The chown command is used to change the user and/or group ownership of files or directories, but it requires at least one argument besides the file name. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 7:
Managing Disk Storage; chattr(1) - Linux manual page; chgrp(1) - Linux manual page; chmod(1) - Linux manual page; chown(1) - Linux manual page


NEW QUESTION # 77
A Linux administrator needs to remove software from the server. Which of the following RPM options should be used?

  • A. rpm -e
  • B. rm -d
  • C. rpm -s
  • D. rpm -q

Answer: A

Explanation:
Explanation
The RPM option -e should be used to remove software from the server. The rpm command is a tool for managing software packages on RPM-based Linux distributions. The -e option stands for erase and removes the specified package from the system. This is the correct option to use to accomplish the task. The other options are incorrect because they either do not exist (-s or -d) or do not remove software (-q stands for query and displays information about the package). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 16: Managing Software, page 489.


NEW QUESTION # 78
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 is mostly idle, therefore the iowait is high.
  • B. The system has a partitioned disk, which causes the IOPS to be doubled.
  • C. The system has reached its maximum permitted throughput, therefore iowait is increasing.
  • D. The system has reached its maximum IOPS, causing the system to be slow.

Answer: C

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 # 79
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. systemctl reboot
  • B. systemctl get-default
  • C. telinit 0
  • D. systemctl emergency

Answer: A

Explanation:
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. References: [CompTIA Linux+ (XK0-005) Certification Study Guide], Chapter 17: System Maintenance and Operation, page 516.


NEW QUESTION # 80
A systems administrator is encountering performance issues. The administrator runs 3 commands with the following output

The Linux server has the following system properties
CPU: 4 vCPU
Memory: 50GB
Which of the following accurately describes this situation?

  • A. Too many users are currently logged in to the system
  • B. The system has been running for over a year and requires a reboot.
  • C. The system requires more memory
  • D. The system is under CPU pressure and will require additional vCPUs

Answer: D

Explanation:
Based on the output of the image sent by the user, the system is under CPU pressure and will require additional vCPUs. The output shows that there are four processes running upload.sh scripts that are consuming a high percentage of CPU time (99.7%, 99.6%, 99.5%, and 99.4%). The output also shows that the system has only 4 vCPUs, which means that each process is using almost one entire vCPU. This indicates that the system is struggling to handle the CPU load and may experience performance issues or slowdowns. Adding more vCPUs to the system would help to alleviate the CPU pressure and improve the system performance. The system has not been running for over a year, as the uptime command shows that it has been up for only 1 day, 2 hours, and 13 minutes. The number of users logged in to the system is not relevant to the performance issue, as they are not consuming significant CPU resources. The system does not require more memory, as the free command shows that it has plenty of available memory (49 GB total, 48 GB free). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Memory and Process Execution, pages 468-469.


NEW QUESTION # 81
A Linux administrator created the directory /project/access2all. By creating this directory, the administrator is trying to avoid the deletion or modification of files from non-owners. Which of the following will accomplish this goal?

  • A. chmod +rws /project/access2all
  • B. chmod ugo+rwx /project/access2all
  • C. chmod +t /project/access2all
  • D. chmod 2770 /project/access2all

Answer: C

Explanation:
The command that will accomplish the goal of avoiding the deletion or modification of files from non-owners is chmod +t /project/access2all. This command will set the sticky bit on the directory /project/access2all, which is a special permission that restricts file deletion or renaming to only the file owner, directory owner, or root user. This way, even if multiple users have write permission to the directory, they cannot delete or modify each other's files.
The other options are not correct commands for accomplishing the goal. The chmod +rws /project/access2all command will set both the SUID and SGID bits on the directory, which are special permissions that allow a program or a directory to run or be accessed with the permissions of its owner or group, respectively. However, this does not prevent file deletion or modification from non-owners. The chmod 2770 /project/access2all command will set only the SGID bit on the directory, which means that any new files or subdirectories created in it will inherit its group ownership. However, this does not prevent file deletion or modification from non-owners. The chmod ugo+rwx /project/access2all command will grant read, write, and execute permissions to all users (user, group, and others) on the directory, which means that anyone can delete or modify any file in it. Reference: chmod(1) - Linux manual page; How to Use SUID, SGID, and Sticky Bits on Linux


NEW QUESTION # 82
An administrator attempts to rename a file on a server but receives the following error.

The administrator then runs a few commands and obtains the following output:

Which of the following commands should the administrator run NEXT to allow the file to be renamed by any user?

  • A. chgrp reet files
  • B. chmod -t files
  • C. chown users files
  • D. chacl -R 644 files

Answer: B


NEW QUESTION # 83
A DevOps engineer needs to allow incoming traffic to ports in the range of 4000 to 5000 on a Linux server. Which of the following commands will enforce this rule?

  • A. iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT
  • B. iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT
  • C. iptables -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT
  • D. iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT

Answer: D


NEW QUESTION # 84
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. scp ~/.ssh/id_rsa user@server:~/
  • C. rsync ~ /.ssh/ user@server:~/
  • D. ssh-copy-id user@server

Answer: D

Explanation:
The command ssh-copy-id user@server will allow the user to upload the public key to a remote server and enable passwordless login. The ssh-copy-id command is a tool for copying the public key to a remote server and appending it to the authorized_keys file, which is used for public key authentication. The command will also set the appropriate permissions on the remote server to ensure the security of the key. The command ssh-copy-id user@server will copy the public key of the user to the server and allow the user to log in without a password. This is the correct command to use for this task. The other options are incorrect because they either do not copy the public key (scp, rsync, or ssh-add) or do not use the correct syntax (scp ~/.ssh/id_rsa user@server:~/ instead of scp ~/.ssh/id_rsa.pub user@server:~/ or rsync ~ /.ssh/ user@server:~/ instead of rsync ~/.ssh/id_rsa.pub user@server:~/). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 410.


NEW QUESTION # 85
A junior systems administrator has just generated public and private authentication keys for passwordless login. Which of the following files will be moved to the remote servers?

  • A. id_rsa
  • B. id_dsa.pem
  • C. id_ecdsa
  • D. id_rsa.pub

Answer: D

Explanation:
The file id_rsa.pub will be moved to the remote servers for passwordless login. The id_rsa.pub file is the public authentication key that is generated by the ssh-keygen command. The public key can be copied to the remote servers by using the ssh-copy-id command or manually. The remote servers will use the public key to authenticate the user who has the corresponding private key (id_rsa). This will allow the user to log in without entering a password. The other options are incorrect because they are either private keys (id_rsa, id_dsa.pem, or id_ecdsa) or non-existent files (id_dsa.pem or id_ecdsa). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 410.


NEW QUESTION # 86
A systems administrator is tasked with installing GRUB on the legacy MBR of the SATA hard drive. Which of the following commands will help the administrator accomplish this task?

  • A. grub-install /dev/sr0
  • B. grub-install /dev/sda
  • C. grub-install /dev/hd0,0
  • D. grub-install /dev/hda

Answer: B

Explanation:
The command that will help the administrator install GRUB on the legacy MBR of the SATA hard drive is grub-install /dev/sda. This command will install GRUB on the master boot record (MBR) of the first SATA disk (/dev/sda). The MBR is the first sector of a disk that contains boot code and a partition table. GRUB will overwrite the boot code and place its own code that can load GRUB modules and configuration files from a specific partition.
The other options are not correct commands for installing GRUB on the legacy MBR of the SATA hard drive. The grub-install /dev/hda command will try to install GRUB on the first IDE disk (/dev/hda), which may not exist or may not be bootable. The grub-install /dev/sr0 command will try to install GRUB on the first SCSI CD-ROM device (/dev/sr0), which is not a hard drive and may not be bootable. The grub-install /dev/hd0,0 command is invalid because grub-install does not accept partition names as arguments, only disk names. Reference: Installing GRUB using grub-install; GRUB Manual


NEW QUESTION # 87
Which of the following technologies can be used as a central repository of Linux users and groups?

  • A. PAM
  • B. SSO
  • C. LDAP
  • D. MFA

Answer: C

Explanation:
Explanation
LDAP stands for Lightweight Directory Access Protocol, which is a protocol for accessing and managing a central directory of users and groups. LDAP can be used as a central repository of Linux users and groups, allowing for centralized authentication and authorization across multiple Linux systems. MFA, SSO, and PAM are not technologies that can be used as a central repository of Linux users and groups. MFA stands for Multi-Factor Authentication, which is a method of verifying a user's identity using more than one factor, such as a password, a token, or a biometric. SSO stands for Single Sign-On, which is a feature that allows a user to log in once and access multiple applications or systems without having to re-enter credentials. PAM stands for Pluggable Authentication Modules, which is a framework that allows Linux to use different authentication methods, such as passwords, tokens, or biometrics. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups


NEW QUESTION # 88
A systems administrator has been unable to terminate a process. Which of the following should the administrator use to forcibly stop the process?

  • A. kill -TERM
  • B. kill -15
  • C. kill -1
  • D. kill -HUP
  • E. kill -9

Answer: D


NEW QUESTION # 89
A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

  • A. podman run -d -p 443:8443 httpd
  • B. podman exec -p 8443:443 httpd
  • C. podman run -d -e 443:8443 httpd
  • D. podman run -d -p 8443:443 httpd

Answer: A

Explanation:
The command that will accomplish the task of running a container with the httpd server inside and exposing it at port 443 of the Linux host machine while it internally listens on port 8443 is podman run -d -p 443:8443 httpd. This command uses the podman tool, which is a daemonless container engine that can run and manage containers on Linux systems. The -d option runs the container in detached mode, meaning that it runs in the background without blocking the terminal. The -p option maps a port on the host machine to a port inside the container, using the format host_port:container_port. In this case, port 443 on the host machine is mapped to port 8443 inside the container, allowing external access to the httpd server. The httpd argument specifies the name of the image to run as a container, which in this case is an image that contains the Apache HTTP Server software. The other options are not correct commands for accomplishing the task. Podman run -d -p 8443:443 httpd maps port 8443 on the host machine to port 443 inside the container, which does not match the requirement. Podman run -d -e 443:8443 httpd uses the -e option instead of the -p option, which sets an environment variable inside the container instead of mapping a port. Podman exec -p 8443:443 httpd uses the podman exec command instead of the podman run command, which executes a command inside an existing container instead of creating a new one. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks


NEW QUESTION # 90
A systems administrator is tasked with creating an Ansible playbook to automate the installation of patches on several Linux systems. In which of the following languages should the playbook be written?

  • A. YAML
  • B. JSON
  • C. HTML
  • D. SQL

Answer: A

Explanation:
The language that the playbook should be written in is YAML. YAML stands for YAML Ain't Markup Language, which is a human-readable data serialization language. YAML is commonly used for configuration files and data exchange. YAML uses indentation, colons, dashes, and brackets to represent the structure and values of the data. YAML also supports comments, variables, expressions, and functions. Ansible is an open-source tool for automating tasks and managing configuration on Linux systems. Ansible uses YAML to write playbooks, which are files that define the desired state and actions for the systems. Playbooks can be used to automate the installation of patches on several Linux systems by specifying the hosts, tasks, modules, and parameters. The language that the playbook should be written in is YAML. This is the correct answer to the question. The other options are incorrect because they are not the languages that Ansible uses for playbooks (SQL, HTML, or JSON). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 549.


NEW QUESTION # 91
An administrator deployed a Linux server that is running a web application on port 6379/tcp.
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:

Which of the following commands should be used to resolve the issue?

  • A. semanage port -a http_port_t -p top 6379
  • B. semanage port -a -t http_port_t -p tcp 6379
  • C. semanage port -l -t http_port_tcp 6379
  • D. semanage port -d -t http_port_t -p tcp 6379

Answer: B

Explanation:
Explanation
The command semanage port -a -t http_port_t -p tcp 6379 adds a new port definition to the SELinux policy and assigns the type http_port_t to the port 6379/tcp. This allows the web application to run on this port and accept connections from users. This is the correct way to resolve the issue. The other options are incorrect because they either delete a port definition (-d), use the wrong protocol (top instead of tcp), or list the existing port definitions (-l). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18:
Securing Linux Systems, page 535.


NEW QUESTION # 92
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: C

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


NEW QUESTION # 93
Which of the following commands will display the operating system?

  • A. uname -m
  • B. uname -s
  • C. uname -n
  • D. uname -o

Answer: D


NEW QUESTION # 94
A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

  • A. podman run -d -p 443:8443 httpd
  • B. podman exec -p 8443:443 httpd
  • C. podman run -d -e 443:8443 httpd
  • D. podman run -d -p 8443:443 httpd

Answer: A


NEW QUESTION # 95
......


The XK0-005 exam covers a broad range of topics, including system architecture, Linux installation and package management, GNU and Unix commands, devices, Linux filesystems, and file system hierarchy standards. Additionally, it tests the candidate's knowledge of networking concepts, security, and shell scripting. XK0-005 exam format consists of multiple-choice, drag and drop, and performance-based questions. It is a computer-based exam that can be taken at any Pearson VUE testing center.

 

XK0-005 Exam Practice Materials Collection: https://www.briandumpsprep.com/XK0-005-prep-exam-braindumps.html

Use Valid New XK0-005 Questions - Top choice Help You Gain Success: https://drive.google.com/open?id=1W_YZigkv2qwEaEkefvAgJd1-KBOaB6Cv