ExamGecko
Home Home / CompTIA / XK0-005

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

Question list
Search
Search

List of questions

Search

Related questions











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.
The DNS address has been commented out in the configuration file.
A.
The DNS address has been commented out in the configuration file.
Answers
B.
The search entry in the /etc/resolv.conf file is incorrect.
B.
The search entry in the /etc/resolv.conf file is incorrect.
Answers
C.
Wired connection 1 is offline.
C.
Wired connection 1 is offline.
Answers
D.
No default route is defined.
D.
No default route is defined.
Answers
Suggested answer: D

Explanation:

The issue is caused by the lack of a default route defined in the /etc/sysconfig/network-scripts/ifcfgenp0s3 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. Reference: Configuring IP Networking with nmcli; Configuring IP Networking with ifcfg Files

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/hda
A.
grub-install /dev/hda
Answers
B.
grub-install /dev/sda
B.
grub-install /dev/sda
Answers
C.
grub-install /dev/sr0
C.
grub-install /dev/sr0
Answers
D.
grub-install /dev/hd0,0
D.
grub-install /dev/hd0,0
Answers
Suggested 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

A junior Linux administrator is tasked with installing an application. The installation guide states the application should only be installed in a run level 5 environment.

Which of the following commands would ensure the server is set to runlevel 5?

A.
systemctl isolate multi-user.target
A.
systemctl isolate multi-user.target
Answers
B.
systemctl isolate graphical.target
B.
systemctl isolate graphical.target
Answers
C.
systemctl isolate network.target
C.
systemctl isolate network.target
Answers
D.
systemctl isolate basic.target
D.
systemctl isolate basic.target
Answers
Suggested answer: B

Explanation:

The command that would ensure the server is set to runlevel 5 is systemctl isolate graphical.target. This command will change the current target (or runlevel) of systemd to graphical.target, which is equivalent to runlevel 5 in SysV init systems. Graphical.target means that the system will start with a graphical user interface (GUI) and all services required for it.

The other options are not correct commands for setting the server to runlevel 5. The systemctl isolate multi-user.target command will change the current target to multi-user.target, which is equivalent to runlevel 3 in SysV init systems. Multi-user.target means that the system will start with multiple user logins and networking, but without a GUI. The systemctl isolate network.target command will change the current target to network.target, which is not a real runlevel but a synchronization point for network-related services. Network.target means that network functionality should be available, but does not specify whether it should be started before or after it. The systemctl isolate basic.target command will change the current target to basic.target, which is also not a real runlevel but a synchronization point for basic system services. Basic.target means that all essential services should be started, but does not specify whether it should be started before or after it. Reference: systemd System and Service Manager; systemd.special(7) - Linux manual page

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
A.
sudo useradd -e 2021-09-30 Project_user
Answers
B.
sudo useradd -c 2021-09-30 Project_user
B.
sudo useradd -c 2021-09-30 Project_user
Answers
C.
sudo modinfo -F 2021-09-30 Project_uses
C.
sudo modinfo -F 2021-09-30 Project_uses
Answers
D.
sudo useradd -m -d 2021-09-30 Project_user
D.
sudo useradd -m -d 2021-09-30 Project_user
Answers
Suggested answer: 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-MMDD 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 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
A.
git clone https://git.company.com/admin/project.git
Answers
B.
git checkout https://git.company.com/admin/project.git
B.
git checkout https://git.company.com/admin/project.git
Answers
C.
git pull https://git.company.com/admin/project.git
C.
git pull https://git.company.com/admin/project.git
Answers
D.
git branch https://git.company.com/admin/project.git
D.
git branch https://git.company.com/admin/project.git
Answers
Suggested answer: 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.

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=$PATH:/opt/operations1/bin' >> /etc/profile
A.
echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile
Answers
B.
echo 'export PATH=/opt/operations1/bin' >> /etc/profile
B.
echo 'export PATH=/opt/operations1/bin' >> /etc/profile
Answers
C.
echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile
C.
echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile
Answers
D.
echo 'export $PATH:/opt/operations1/bin' >> /etc/profile
D.
echo 'export $PATH:/opt/operations1/bin' >> /etc/profile
Answers
Suggested answer: A

Explanation:

The command echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile should be used to resolve the issue of users not being able to access the application without using the full path.

The echo command prints the given string to the standard output. The export command sets an environment variable and makes it available to all child processes. The PATH variable contains a list of directories where the shell looks for executable files. The $PATH expands to the current value of the PATH variable. The : separates the directories in the list. The /opt/operations1/bin is the directory where the application is installed. The >> operator appends the output to the end of the file.

The /etc/profile file is a configuration file that is executed when a user logs in. The command echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile will add the /opt/operations1/bin directory to the PATH variable for all users and allow them to access the application without using the full path. This is the correct command to use to resolve the issue. The other options are incorrect because they either overwrite the PATH variable (echo 'export PATH=/opt/operations1/bin' >> /etc/profile) or do not use the correct syntax (echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile or echo 'export $PATH:/opt/operations1/bin' >> /etc/profile). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 9: Working with the Linux Shell, page 295.

A Linux system is getting an error indicating the root filesystem is full. Which of the following commands should be used by the systems administrator to resolve this issue? (Choose three.)

A.
df -h /
A.
df -h /
Answers
B.
fdisk -1 /dev/sdb
B.
fdisk -1 /dev/sdb
Answers
C.
growpart /dev/mapper/rootvg-rootlv
C.
growpart /dev/mapper/rootvg-rootlv
Answers
D.
pvcreate /dev/sdb
D.
pvcreate /dev/sdb
Answers
E.
lvresize -L +10G -r /dev/mapper/rootvg-rootlv
E.
lvresize -L +10G -r /dev/mapper/rootvg-rootlv
Answers
F.
lsblk /dev/sda
F.
lsblk /dev/sda
Answers
G.
parted -l /dev/mapper/rootvg-rootlv
G.
parted -l /dev/mapper/rootvg-rootlv
Answers
H.
vgextend /dev/rootvg /dev/sdb
H.
vgextend /dev/rootvg /dev/sdb
Answers
Suggested answer: A, C, E

Explanation:

The administrator should use the following three commands to resolve the issue of the root filesystem being full:

df -h /. This command will show the disk usage of the root filesystem in a human-readable format. The df command is a tool for reporting file system disk space usage. The -h option displays the sizes in powers of 1024 (e.g., 1K, 234M, 2G). The / specifies the root filesystem. The command df -h / will show the total size, used space, available space, and percentage of the root filesystem. This command will help the administrator identify the problem and plan the solution.

growpart /dev/mapper/rootvg-rootlv. This command will grow the partition that contains the root filesystem to the maximum size available. The growpart command is a tool for resizing partitions on Linux systems. The /dev/mapper/rootvg-rootlv is the device name of the partition, which is a logical volume managed by the Logical Volume Manager (LVM). The command growpart /dev/mapper/rootvg-rootlv will extend the partition to fill the disk space and increase the size of the root filesystem. This command will help the administrator solve the problem and free up space.

lvresize -L +10G -r /dev/mapper/rootvg-rootlv. This command will resize the logical volume that contains the root filesystem and add 10 GB of space. The lvresize command is a tool for resizing logical volumes on Linux systems. The -L option specifies the new size of the logical volume, in this case +10G, which means 10 GB more than the current size. The -r option resizes the underlying file system as well. The /dev/mapper/rootvg-rootlv is the device name of the logical volume, which is the same as the partition name. The command lvresize -L +10G -r /dev/mapper/rootvg-rootlv will increase the size of the logical volume and the root filesystem by 10 GB and free up space. This command will help the administrator solve the problem and free up space.

The other options are incorrect because they either do not affect the root filesystem (fdisk -1 /dev/sdb, pvcreate /dev/sdb, lsblk /dev/sda, or vgextend /dev/rootvg /dev/sdb) or do not use the correct syntax (fdisk -1 /dev/sdb instead of fdisk -l /dev/sdb or parted -l /dev/mapper/rootvgrootlv instead of parted /dev/mapper/rootvg-rootlv print). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 10: Managing Storage, pages 318-319, 331-332.

A cloud engineer is asked to copy the file deployment.yaml from a container to the host where the container is running. Which of the following commands can accomplish this task?

A.
docker cp container_id/deployment.yaml deployment.yaml
A.
docker cp container_id/deployment.yaml deployment.yaml
Answers
B.
docker cp container_id:/deployment.yaml deployment.yaml
B.
docker cp container_id:/deployment.yaml deployment.yaml
Answers
C.
docker cp deployment.yaml local://deployment.yaml
C.
docker cp deployment.yaml local://deployment.yaml
Answers
D.
docker cp container_id/deployment.yaml local://deployment.yaml
D.
docker cp container_id/deployment.yaml local://deployment.yaml
Answers
Suggested answer: B

Explanation:

The command docker cp container_id:/deployment.yaml deployment.yaml can accomplish the task of copying the file deployment.yaml from a container to the host. The docker command is a tool for managing Docker containers and images. The cp option copies files or directories between a container and the local filesystem. The container_id is the identifier of the container, which can be obtained by using the docker ps command. The /deployment.yaml is the path of the file in the container, which must be preceded by a slash. The deployment.yaml is the path of the file on the host, which can be relative or absolute. The command docker cp container_id:/deployment.yaml deployment.yaml will copy the file deployment.yaml from the container to the current working directory on the host. This is the correct command to use to accomplish the task. The other options are incorrect because they either use the wrong syntax (docker cp container_id/deployment.yaml deployment.yaml or docker cp container_id/deployment.yaml local://deployment.yaml) or do not exist (docker cp deployment.yaml local://deployment.yaml). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 567.

A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)

A.
Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.
A.
Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.
Answers
B.
Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line.
B.
Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line.
Answers
C.
Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.
C.
Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.
Answers
D.
Interrupt the boot process in the GRUB menu and add single=user in the kernel line.
D.
Interrupt the boot process in the GRUB menu and add single=user in the kernel line.
Answers
E.
Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.
E.
Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.
Answers
F.
Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.
F.
Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.
Answers
Suggested answer: C, F

Explanation:

The administrator can use the following two options to boot the system into the single user mode:

Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.

This option will boot the system into the rescue mode, which is a minimal environment that allows the administrator to perform basic tasks such as repairing the system. The GRUB menu is a screen that appears when the system is powered on and allows the administrator to choose which kernel or operating system to boot. The kernel line is a line that specifies the parameters for the kernel, such as the root device, the init system, and the boot options. The administrator can interrupt the boot process by pressing the e key in the GRUB menu and edit the kernel line by adding systemd.unit=rescue.target at the end. This option will tell the system to use the rescue target, which is a unit that defines the state of the system in the rescue mode. The administrator can then press Ctrl+X to boot the system with the modified kernel line. This option will boot the system into the single user mode and allow the administrator to troubleshoot the issues.

Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.

This option will boot the system into the single user mode, which is a mode that allows the administrator to log in as the root user and perform maintenance tasks. The GRUB menu and the kernel line are the same as the previous option. The administrator can interrupt the boot process by pressing the e key in the GRUB menu and edit the kernel line by adding systemd.unit=single.target at the end. This option will tell the system to use the single target, which is a unit that defines the state of the system in the single user mode. The administrator can then press Ctrl+X to boot the system with the modified kernel line. This option will boot the system into the single user mode and allow the administrator to troubleshoot the issues.

The other options are incorrect because they either do not boot the system into the single user mode (execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot or interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line) or do not use the correct syntax (interrupt the boot process in the GRUB menu and add single=user in the kernel line or interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8:

Managing the Linux Boot Process, pages 267-268.

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 -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT
A.
iptables -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT
Answers
B.
iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT
B.
iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT
Answers
C.
iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT
C.
iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT
Answers
D.
iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT
D.
iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT
Answers
Suggested answer: B

Explanation:

The command iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT will enforce the rule of allowing incoming traffic to ports in the range of 4000 to 5000 on a Linux server.

The iptables command is a tool for managing firewall rules on Linux systems. The -t option specifies the table to operate on, in this case filter, which is the default table that contains the rules for filtering packets. The -A option appends a new rule to the end of a chain, in this case INPUT, which is the chain that processes the packets that are destined for the local system. The -p option specifies the protocol to match, in this case tcp, which is the transmission control protocol. The --dport option specifies the destination port or port range to match, in this case 4000:5000, which is the range of ports from 4000 to 5000. The -j option specifies the target to jump to if the rule matches, in this case ACCEPT, which is the target that allows the packet to pass through. The command iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT will add a new rule to the end of the INPUT chain that will accept the incoming TCP packets that have a destination port between 4000 and 5000. This command will enforce the rule and allow the traffic to the specified ports. This is the correct command to use to accomplish the task. The other options are incorrect because they either use the wrong options (-f instead of -t or -D instead of -A) or do not exist (iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT or iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 543.

Total 371 questions
Go to page: of 38