Practice Free XK0-005 Exam Online Questions
A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to.
When listing link parameters, the following is presented:
Based on the output above, which of following is the MOST probable cause of the issue?
- A . The address ac:00:11:22:33:cd is not a valid Ethernet address.
- B . The Ethernet broadcast address should be ac:00:11:22:33:ff instead.
- C . The network interface eth0 is using an old kernel module.
- D . The network interface cable is not connected to a switch.
D
Explanation:
The most probable cause of the connectivity issue is that the network interface cable is not connected to a switch. This can be inferred from the output of the ip link list dev eth0 command, which shows that the network interface eth0 has the NO-CARRIER flag set. This flag indicates that there is no physical link detected on the interface, meaning that the cable is either unplugged or faulty. The other options are not valid causes of the issue. The address ac:00:11:22:33:cd is a valid Ethernet address, as it follows the format of six hexadecimal octets separated by colons. The Ethernet broadcast address should be ff:ff:ff:ff:ff:ff, which is the default value for all interfaces. The network interface eth0 is not using an old kernel module, as it shows the UP flag, which indicates that the interface is enabled and ready to transmit data.
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Networking
A cloud engineer wants to delete all unused networks that are not referenced by any container.
Which of the following commands will achieve this goal?
- A . docker network erase
- B . docker network clear
- C . docker network prune
- D . docker network rm
C
Explanation:
The docker command is used to manage Docker containers, images, networks, volumes, and other resources on a Linux system. Docker is a platform that allows users to run applications in isolated environments called containers. Docker also provides networking features that allow users to create and manage networks for containers.
To delete all unused networks that are not referenced by any container, the cloud engineer can use the docker network prune command. This command will remove all networks that have no containers connected to them. The statement C is correct.
The statements A, B, and D are incorrect because they do not delete all unused networks. The docker network erase and docker network clear commands do not exist. The docker network rm command deletes a specific network by name or ID, but not all unused networks.
Reference: [How to Manage Docker Networks]
A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users’ access will be disabled once the project is over. The expiration date should be 2021-09-30.
Which of the following commands will accomplish this task?
- A . sudo useradd -e 2021-09-30 Project_user
- B . sudo useradd -c 2021-09-30 Project_user
- C . sudo modinfo -F 2021-09-30 Project_uses
- D . sudo useradd -m -d 2021-09-30 Project_user
A
Explanation:
The command that will accomplish this task is sudo useradd -e 2021-09-30 Project_user. This command will create a new user account named Project_user with an expiration date of 2021-09-30. The -e option of useradd specifies the date on which the user account will be disabled in YYYY-MM-DD format.
The other options are not correct commands for creating a user account with an expiration date. The sudo useradd -c 2021-09-30 Project_user command will create a new user account named Project_user with a comment of 2021-09-30. The -c option of useradd specifies a comment or description for the user account, not an expiration date. The sudo modinfo -F 2021-09-30 Project_user command is invalid because modinfo is not a command for managing user accounts, but a command for displaying information about kernel modules. The -F option of modinfo specifies a field name to show, not an expiration date. The sudo useradd -m -d 2021-09-30 Project_user command will create a new user account named Project_user with a home directory of 2021-09-30. The -m option of useradd specifies that the home directory should be created if it does not exist, and the -d option specifies the home directory name, not an expiration date.
Reference: useradd(8) – Linux manual page; modinfo(8) – Linux manual page
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
- B . useradd -m /comptia/projects user02
- C . useradd -b /comptia/projects user02
- D . useradd -s /comptia/projects user02
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.
A Linux administrator is working on a system and notices that some of the packages are not at the latest version.
Which of the following commands should the administrator use to correct this issue?
- A . rpm –update
- B . apt update
- C . dnt update
- D . dpkg –update
B
Explanation:
Comprehensive and Detailed Step-by-Step
The apt update command updates the package lists for repositories but does not upgrade installed packages.
After apt update, the administrator should run apt upgrade to install the latest versions of all packages.
rpm –update is incorrect because RPM does not have an –update option for updating repositories.
RPM package management requires yum or dnf on RHEL-based systems.
dnt update is not a valid command (probably a typo for dnf update, which would be used on Fedora/RHEL systems).
dpkg –update is incorrect because dpkg is used for managing individual .deb packages and does not update repositories.
Reference: CompTIA Linux+ Official Study Guide, Chapter on Package Management
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 checkout https://git.company.com/admin/project.git
- C . git pull https://git.company.com/admin/project.git
- D . git branch https://git.company.com/admin/project.git
A
Explanation:
The command git clone https://git.company.com/admin/project.git will achieve the goal of downloading a Git repository from the given URL. The git command is a tool for managing version control systems. The clone option creates a copy of an existing repository. The URL specifies the location of the repository to clone, in this case https://git.company.com/admin/project.git. The command git clone https://git.company.com/admin/project.git will download the repository and create a directory named project in the current working directory. This is the correct command to use to accomplish the goal. The other options are incorrect because they either do not download the repository (git checkout, git pull, or git branch) or do not use the correct syntax (git checkout https://git.company.com/admin/project.git instead of git checkout -b project https://git.company.com/admin/project.git or git branch https://git.company.com/admin/project.git instead of git branch project https://git.company.com/admin/project.git).
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 571.
A systems administrator wants to ensure all the latest patches and updates are automatically synced to the local repository every two hours on Sundays through Tuesdays in the month of May.
Which of the following cron entries can the administrator use to achieve this goal? (Select two)
- A . 0 */2 * 5 0-3 /root/update-from-remote-to-local.sh
- B . 0 0,2,4,6,8,10,12,14 * 5 0-2 /root/update-from-remote-to-local.sh
- C . 0 0,2,4,6,8,10,12,14 * 5 0-3 /root/update-from-remote-to-local.sh
- D . 0 0-23/2 * 5 0-3 /root/update-from-remote-to-local.sh
- E . 0 0-23/2 * 5 0-2 /root/update-from-remote-to-local.sh
- F . 0 */2 * 5 0-2 /root/update-from-remote-to-local.sh
Joe, a user, is unable to log in to the Linux system Given the following output:
Which of the following command would resolve the issue?
- A . usermod -s /bin/bash joe
- B . pam_tally2 -u joe -r
- C . passwd -u joe
- D . chage -E 90 joe
B
Explanation:
Based on the output of the image sent by the user, Joe is unable to log in to the Linux system because his account has been locked due to too many failed login attempts. The pam_tally2 -u joe -r command will resolve this issue by resetting Joe’s failed login counter to zero and unlocking his account. This command uses the pam_tally2 module to manage user account locking based on login failures. The usermod -s /bin/bash joe command will change Joe’s login shell to /bin/bash, but this will not unlock his account. The passwd -u joe command will unlock Joe’s password if it has been locked by passwd -l joe, but this will not reset his failed login counter or unlock his account if it has been locked by pam_tally2. The chage -E 90 joe command will set Joe’s account expiration date to 90 days from today, but this will not unlock his account or reset his failed login counter.
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 537.
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 +t /project/access2all
- B . chmod +rws /project/access2all
- C . chmod 2770 /project/access2all
- D . chmod ugo+rwx /project/access2all
A
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
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)
- A . Option A
- B . Option B
- C . Option C
- D . Option D
D
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.