Special Summer Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > CompTIA > Linux+ > XK0-005

XK0-005 CompTIA Linux+ Exam Question and Answers

Question # 4

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

Full Access
Question # 5

Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?

A.

route -i etho -p add 10.0.213.5 10.0.5.1

B.

route modify eth0 +ipv4.routes "10.0.213.5/32 10.0.5.1"

C.

echo "10.0.213.5 10.0.5.1 eth0" > /proc/net/route

D.

ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0

Full Access
Question # 6

A Linux administrator is troubleshooting the root cause of a high CPU load and average.

Which of the following commands will permanently resolve the issue?

A.

renice -n -20 6295

B.

pstree -p 6295

C.

iostat -cy 1 5

D.

kill -9 6295

Full Access
Question # 7

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.

Full Access
Question # 8

A DevOps engineer wants to work on a snapshot of the infrastructure as code configuration. Which of the following commands should the engineer use to accomplish this task?

A.

git pull

B.

git push

C.

git branch

D.

git tag

Full Access
Question # 9

A systems administrator is notified that the mysqld process stopped unexpectedly. The systems administrator issues the following command:

sudo grep –i -r ‘out of memory’ /var/log

The output of the command shows the following:

kernel: Out of memory: Kill process 9112 (mysqld) score 511 or sacrifice child.

Which of the following commands should the systems administrator execute NEXT to troubleshoot this issue? (Select two).

A.

free -h

B.

nc -v 127.0.0.1 3306

C.

renice -15 $( pidof mysql )

D.

lsblk

E.

killall -15

F.

vmstat -a 1 4

Full Access
Question # 10

An administrator completes maintenance on a server but cannot remount the logical volume. Given the following output:

# mount /dev/data/files /opt/data/

mount: /opt/data: special device /dev/data/files does not exist.

# lvs

LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert

files data -wi-a------ 600.00m

# vgs

VG #PV #LV #SN Attr VSize VFree

data 1 1 0 wz—n- 1020.00m 420.00m

Which of the following commands should the administrator execute to resolve the issue?

A.

vgchange -ay data

B.

lvscan --all

C.

vgimport data

D.

lvchange -ay /dev/data/files

Full Access
Question # 11

Users report that they are unable to reach the company website https://www.comptia.org. A systems administrator confirms the issue with the following command:

# curl https://www.comptia.org

curl: (7) Failed to connect to www.comptia.org port 443: No route to host

The administrator logs in to the company’s web server to check its configuration and sees the following output:

root@comptia.org:-># firewall-cmd --list-all

public (active)

target: default

icmp-block-inversion: no

interfaces: dummy0 eth0

sources:

services: cockpit dhcpv6-client http ssh

ports: 3001/tcp

protocols:

forward: no

masquerade: no

forward-ports:

source-ports:

icmp-blocks:

rich rules:

rule family="ipv4" source address="61.177.173.6" port port="ssh" protocol="tcp" reject type="icmp-port-unreachable"

rule family="ipv4" source address="185.143.45.164" port port="ssh" protocol="tcp" reject type="icmp-port-unreachable"

rule family="ipv4" source address="143.198.60.41" port port="ssh" protocol="tcp" reject type="icmp-port-unreachable"

root@comptia.org:-># ip route

default via 172.31.1.1 dev eth0 proto dhcp src 65.21.187.65 metric 100

10.0.6.0/24 dev dummy0 proto kernel scope link src 10.0.6.65 metric 550

172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1

172.18.0.0/16 dev br-28ac2eaeeca1 proto kernel scope link src 172.18.0.1

172.19.0.0/16 dev br-fb3897555ca3 proto kernel scope link src 172.19.0.1 linkdown

172.31.1.1 dev eth0 proto dhcp scope link src 65.21.187.65 metric 100

192.168.224.0/20 dev br-e949ab177d79 proto kernel scope link src 192.168.224.1 linkdown

192.168.240.0/20 dev br-6adf72ac0ae3 proto kernel scope link src 192.168.240.1 linkdown

Which of the following is causing the issue?

A.

The web server's interface has no link.

B.

The default route on the web server is incorrect.

C.

HTTPS traffic is not allowed through the web server firewall.

D.

User IP addresses are rejected by the firewall.

Full Access
Question # 12

While inspecting a recently compromised Linux system, the administrator identified a number of processes that should not have been running:

Which of the following commands should the administrator use to terminate all of the identified processes?

A.

pkill -9 -f "upload*.sh"

B.

kill -9 "upload*.sh"

C.

killall -9 -upload*.sh"

D.

skill -9 "upload*.sh"

Full Access
Question # 13

A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?

A.

tar -cvzf /dev/sdd1 /dev/sdc1

B.

rsync /dev/sdc1 /dev/sdd1

C.

dd if=/dev/sdc1 of=/dev/sdd1

D.

scp /dev/sdc1 /dev/sdd1

Full Access
Question # 14

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.

df -i /oracle1

B.

fdisk -1 /dev/sdb1

C.

lsblk /dev/sdb1

D.

du -sh /oracle1

Full Access
Question # 15

A developer is trying to install an application remotely that requires a graphical interface for installation. The developer requested assistance to set up the necessary environment variables along with X11 forwarding in SSH. Which of the following environment variables must be set in remote shell in order to launch the graphical interface?

A.

$RHOST

B.

SETENV

C.

$SHELL

D.

$DISPLAY

Full Access
Question # 16

A systems administrator is tasked with setting up key-based SSH authentication. In which of the following locations should the administrator place the public keys for the server?

A.

~/.sshd/authkeys

B.

~/.ssh/keys

C.

~/.ssh/authorized_keys

D.

~/.ssh/keyauth

Full Access
Question # 17

A cloud engineer needs to launch a container named web-01 in background mode. Which of the following commands will accomplish this task''

A.

docker builder -f —name web-01 httpd

B.

docker load --name web-01 httpd

C.

docker ps -a --name web-01 httpd

D.

docker run -d --name web-01 httpd

Full Access
Question # 18

A systems administrator needs to verify whether the built container has the app.go file in its root directory. Which of the following can the administrator use to verify the root directory has this file?

A.

docker image inspect

B.

docker container inspect

C.

docker exec ls

D.

docker ps

Full Access
Question # 19

Using AD Query, the security gateway connections to the Active Directory Domain Controllers using what protocol?

A.

Windows Management Instrumentation (WMI)

B.

Hypertext Transfer Protocol Secure (HTTPS)

C.

Lightweight Directory Access Protocol (LDAP)

D.

Remote Desktop Protocol (RDP)

Full Access
Question # 20

A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a reposito-ry to share with the systems team. A junior Linux administrator needs to re-trieve the scripts and make them available on a local workstation. Which of the following Git commands should the junior Linux administrator use to accom-plish this task?

A.

fetch

B.

checkout

C.

clone

D.

branch

Full Access
Question # 21

Users have been unable to save documents to /home/tmp/temp and have been receiving the following error:

Path not found

A junior technician checks the locations and sees that /home/tmp/tempa was accidentally created instead of /home/tmp/temp. Which of the following commands should the technician use to fix this issue?

A.

cp /home/tmp/tempa /home/tmp/temp

B.

mv /home/tmp/tempa /home/tmp/temp

C.

cd /temp/tmp/tempa

D.

ls /home/tmp/tempa

Full Access
Question # 22

A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?

A.

docker run -ti app /bin/sh

B.

podman exec -ti app /bin/sh

C.

podman run -d app /bin/bash

D.

docker exec -d app /bin/bash

Full Access
Question # 23

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 /

B.

fdisk -1 /dev/sdb

C.

growpart /dev/mapper/rootvg-rootlv

D.

pvcreate /dev/sdb

E.

lvresize –L +10G -r /dev/mapper/rootvg-rootlv

F.

lsblk /dev/sda

G.

parted -l /dev/mapper/rootvg-rootlv

Full Access
Question # 24

A Linux administrator needs to create an image named sda.img from the sda disk and store it in the /tmp directory. Which of the following commands should be used to accomplish this task?

A.

dd of=/dev/sda if=/tmp/sda.img

B.

dd if=/dev/sda of=/tmp/sda.img

C.

dd --if=/dev/sda --of=/tmp/sda.img

D.

dd --of=/dev/sda --if=/tmp/sda.img

Full Access
Question # 25

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.

Execute grub-install /dev/sdX and reboot.

C.

Interrupt the boot process in the GRUB menu and add rescue to the kernel line.

D.

Fix the partition modifying /etc/default/grub and reboot.

E.

Interrupt the boot process in the GRUB menu and add single to the kernel line.

F.

Boot the system on a LiveCD/ISO.

Full Access
Question # 26

A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?

A.

The checkdiskspace.service is not running.

B.

The checkdiskspace.service needs to be enabled.

C.

The OnCalendar schedule is incorrect in the timer definition.

D.

The system-daemon services need to be reloaded.

Full Access
Question # 27

An administrator is running a web server in a container named web, but none of the error output is not showing. Which of the following should the administrator use to generate the errors on the container?

A.

docker-compose inspect WEB

B.

dockerlogs WEB

C.

dockerrun —nameWEB —volume/dev/stdout:/var/log/nginx/error.log

D.

dockerps WEB -f

Full Access
Question # 28

A Linux engineer set up two local DNS servers (10.10.10.10 and 10.10.10.20) and was testing email connectivity to the local mail server using the mail command on a local machine when the following error appeared:

The local machine DNS settings are:

Which of the following commands could the engineer use to query the DNS server to get mail server information?

A.

dig @example.com 10.10.10.20 a

B.

dig @10.10.10.20 example.com mx

C.

dig @example.com 10.10.10.20 ptr

D.

dig @10.10.10.20 example.com ns

Full Access
Question # 29

A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?

A.

iptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192.0.2.25:3128

B.

iptables -t nat -A PREROUTING -p top --dport 81 -j DNAT –-to-destination 192.0.2.25:3129

C.

iptables -t nat -I PREROUTING -p top --sport 80 -j DNAT –-to-destination 192.0.2.25:3129

D.

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128

Full Access
Question # 30

A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?

A.

visudo -c

B.

test -f /etc/sudoers

C.

sudo vi check

D.

cat /etc/sudoers | tee test

Full Access
Question # 31

A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?

A.

chown -s 755 devops

B.

chown 1755 devops

C.

chmod -s 755 devops

D.

chmod 1755 devops

Full Access
Question # 32

A Linux administrator needs to correct the permissions of a log file on the server. Which of the following commands should be used to set filename.log permissions to -rwxr—r--. ?

A.

chmod 755 filename.log

B.

chmod 640 filename.log

C.

chmod 740 filename.log

D.

chmod 744 filename.log

Full Access
Question # 33

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.

chgrp -R 755 data/

B.

chmod -R 777 data/

C.

chattr -R -i data/

D.

chown -R data/

Full Access
Question # 34

A systems administrator is tasked with creating a cloud-based server with a public IP address.

Which of the following technologies did the systems administrator use to complete this task?

A.

Puppet

B.

Git

C.

Ansible

D.

Terraform

Full Access
Question # 35

A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task:

Which of the following technologies is the administrator using?

A.

Ansible

B.

Puppet

C.

Chef

D.

Terraform

Full Access
Question # 36

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

B.

grub-install /dev/sda

C.

grub-install /dev/sr0

D.

grub-install /dev/hd0,0

Full Access
Question # 37

A systems administrator configured firewall rules using firewalld. However, after the system is rebooted, the firewall rules are not present:

The systems administrator makes additional checks:

Which of the following is the reason the firewall rules are not active?

A.

iptables is conflicting with firewalld.

B.

The wrong system target is activated.

C.

FIREWALL_ARGS has no value assigned.

D.

The firewalld service is not enabled.

Full Access
Question # 38

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.

Full Access
Question # 39

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 run -d -p 8443:443 httpd

C.

podman run –d -e 443:8443 httpd

D.

podman exec -p 8443:443 httpd

Full Access
Question # 40

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

B.

docker cp container_id:/deployment.yaml deployment.yaml

C.

docker cp deployment.yaml local://deployment.yaml

D.

docker cp container_id/deployment.yaml local://deployment.yaml

Full Access
Question # 41

A newly created container has been unable to start properly, and a Linux administrator is analyzing the cause of the failure. Which of the following will allow the administrator to determine the FIRST command that is executed inside the container right after it starts?

A.

docker export

B.

docker info

C.

docker start

D.

docker inspect

Full Access
Question # 42

In which of the following filesystems are system logs commonly stored?

A.

/var

B.

/tmp

C.

/etc

D.

/opt

Full Access
Question # 43

A Linux administrator has logged in to a server for the first time and needs to know which services are allowed through the firewall. Which of the following options will return the results for which the administrator is looking?

A.

firewall-cmd —get-services

B.

firewall-cmd —check-config

C.

firewall-cmd —list-services

D.

systemct1 status firewalld

Full Access
Question # 44

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 mkfs . xfs /dev/sclcl mount /data

B.

umount /data xfs repair /dev/ sdcl mount /data

C.

umount /data fsck /dev/ sdcl mount / data

D.

umount /data pvs /dev/sdcl mount /data

Full Access
Question # 45

A systems administrator installed a new software program on a Linux server. When the systems administrator tries to run the program, the following message appears on the screen.

Which of the following commands will allow the systems administrator to check whether the system supports virtualization?

A.

dmidecode -s system-version

B.

lscpu

C.

sysctl -a

D.

cat /sys/device/system/cpu/possible

Full Access
Question # 46

A systems administrator is implementing a new service task with systems at startup and needs to execute a script entitled test.sh with the following content:

The administrator tries to run the script after making it executable with chmod +x; however, the script will not run. Which of the following should the administrator do to address this issue? (Choose two.)

A.

Add #!/bin/bash to the bottom of the script.

B.

Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location.

C.

Add #!//bin/bash to the top of the script.

D.

Restart the computer to enable the new service.

E.

Create a unit file for the new service in /etc/init.d with the name helpme.service in the location.

F.

Shut down the computer to enable the new service.

Full Access
Question # 47

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 status

D.

git push

Full Access
Question # 48

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.

Full Access
Question # 49

A Linux system fails to start and delivers the following error message:

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

A.

fsck.ext4 /dev/sda1

B.

partprobe /dev/sda1

C.

fdisk /dev/sda1

D.

mkfs.ext4 /dev/sda1

Full Access
Question # 50

A Linux systems administrator receives a notification that one of the server’s filesystems is full. Which of the following commands would help the administrator to identify this filesystem?

A.

lsblk

B.

fdisk

C.

df -h

D.

du -ah

Full Access
Question # 51

A Linux systems administrator receives reports from various users that an application hosted on a server has stopped responding at similar times for several days in a row. The administrator logs in to the system and obtains the following output:

Output 1:

Output 2:

Output 3:

Which of the following should the administrator do to provide the BEST solution for the reported issue?

A.

Configure memory allocation policies during business hours and prevent the Java process from going into a zombie state while the server is idle.

B.

Configure a different nice value for the Java process to allow for more users and prevent the Java process from restarting during business hours.

C.

Configure more CPU cores to allow for the server to allocate more processing and prevent the Java process from consuming all of the available resources.

D.

Configure the swap space to allow for spikes in usage during peak hours and prevent the Java process from stopping due to a lack of memory.

Full Access
Question # 52

A Linux administrator found many containers in an exited state. Which of the following commands will allow the administrator to clean up the containers in an exited state?

A.

docker rm --all

B.

docker rm $(docker ps -aq)

C.

docker images prune *

D.

docker rm --state exited

Full Access
Question # 53

An administrator recently updated the BIND software package and would like to review the default configuration that shipped with this version. Which of the following files should the administrator review?

A.

/etc/named.conf.rpmnew

B.

/etc/named.conf.rpmsave

C.

/etc/named.conf

D.

/etc/bind/bind.conf

Full Access
Question # 54

Which of the following technologies provides load balancing, encryption, and observability in containerized environments?

A.

Virtual private network

B.

Sidecar pod

C.

Overlay network

D.

Service mesh

Full Access
Question # 55

After installing a new version of a package, a systems administrator notices a new version of the corresponding, service file was Installed In order to use the new version of the, service file, which of the following commands must be Issued FIRST?

A.

systemct1 status

B.

systemct1 stop

C.

systemct1 reinstall

D.

systemct1 daemon-reload

Full Access
Question # 56

A Linux systems administrator is troubleshooting an I/O latency on a single CPU server. The administrator runs a top command and receives the following output:

%Cpu(s): 0.2 us, 33.1 sy, 0.0 ni, 0.0 id, 52.4 wa, 0.0 hi, 0.2 si, 0.0 st

Which of the following is correct based on the output received from the exe-cuted command?

A.

The server's CPU is taking too long to process users' requests.

B.

The server's CPU shows a high idle-time value.

C.

The server's CPU is spending too much time waiting for data inputs.

D.

The server's CPU value for the time spent on system processes is low.

Full Access
Question # 57

A Linux administrator is alerted to a storage capacity issue on a server without a specific mount point or directory. Which of the following commands would be MOST helpful for troubleshooting? (Choose two.)

A.

parted

B.

df

C.

mount

D.

du

E.

fdisk

F.

dd

G.

ls

Full Access
Question # 58

A Linux administrator is adding a new configuration file to a Git repository. Which of the following describes the correct order of Git commands to accomplish the task successfully?

A.

pull -> push -> add -> checkout

B.

pull -> add -> commit -> push

C.

checkout -> push -> add -> pull

D.

pull -> add -> push -> commit

Full Access
Question # 59

A developer reported an incident involving the application configuration file /etc/httpd/conf/httpd.conf that is missing from the server. Which of the following identifies the RPM package that installed the configuration file?

A.

rpm -qf /etc/httpd/conf/httpd.conf

B.

rpm -ql /etc/httpd/conf/httpd.conf

C.

rpm —query /etc/httpd/conf/httpd.conf

D.

rpm -q /etc/httpd/conf/httpd.conf

Full Access
Question # 60

A Linux systems administrator needs to copy files and directories from Server A to Server B. Which of the following commands can be used for this purpose? (Select TWO)

A.

rsyslog

B.

cp

C.

rsync

D.

reposync

E.

scp

F.

ssh

Full Access
Question # 61

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 account was locked out due to three failed logins.

C.

The user entered the wrong password.

D.

The user has the wrong shell assigned to the account.

Full Access
Question # 62

A junior developer is unable to access an application server and receives the following output:

The systems administrator investigates the issue and receives the following output:

Which of the following commands will help unlock the account?

A.

Pam_tally2 --user=dev2 —-quiet

B.

pam_ tally2 --user=dev2

C.

pam_tally2 -–user+dev2 —-quiet

D.

pam_tally2 --user=dev2 —-reset

Full Access
Question # 63

A Linux administrator modified the SSH configuration file. Which of the following commands should be used to apply the configuration changes?

A.

systemct1 stop sshd

B.

systemct1 mask sshd

C.

systemct1 reload sshd

D.

systemct1 start sshd

Full Access
Question # 64

During a security scan, the password of an SSH key file appeared to be too weak and was cracked. Which of the following commands would allow a user to choose a stronger password and set it on the existing SSH key file?

A.

passwd

B.

ssh

C.

ssh-keygen

D.

pwgen

Full Access
Question # 65

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.

/etc/ssh/sshd_config

B.

/etc/ssh/moduli

C.

~/.ssh/config

D.

~/.ssh/authorized_keys

Full Access
Question # 66

A development team asks an engineer to guarantee the persistency of journal log files across system reboots. Which of the following commands would accomplish this task?

A.

grep -i auto /etc/systemd/journald.conf && systemct1 restart systemd-journald.service

B.

cat /etc/systemd/journald.conf | awk '(print $1,$3)'

C.

sed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/ˆ#//q' /etc/systemd/journald.conf

D.

journalctl --list-boots && systemct1 restart systemd-journald.service

Full Access
Question # 67

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.

Markdown

B.

XML

C.

YAML

D.

JSON

Full Access
Question # 68

A Linux administrator rebooted a server. Users then reported some of their files were missing. After doing some troubleshooting, the administrator found one of the filesystems was missing. The filesystem was not listed in /etc/f stab and might have been mounted manually by someone prior to reboot. Which of the following would prevent this issue from reoccurring in the future?

A.

Sync the mount units.

B.

Mount the filesystem manually.

C.

Create a mount unit and enable it to be started at boot.

D.

Remount all the missing filesystems

Full Access
Question # 69

In order to copy data from another VLAN, a systems administrator wants to temporarily assign IP address 10.0.6 5/24 to the newly added network interface enp1s0f1. Which of the following commands should the administrator run to achieve the goal?

A.

ip addr add 10.0.6.5/24 dev enpls0f1

B.

echo "IPV4_ADDRESS=10.0.6.5/24" > /etc/sysconfig/network-scripts/ifcfg-enplsOfl

C.

ifconfig 10.0.6.5/24 enpsIs0f1

D.

nmcli conn add lpv4.address-10.0.6.5/24 ifname enpls0f1

Full Access
Question # 70

A Linux administrator is providing a new Nginx image from the registry to local cache. Which of the following commands would allow this to happen?

A.

docker pull nginx

B.

docker attach nginx

C.

docker commit nginx

D.

docker import nginx

Full Access
Question # 71

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.

telinit 0

B.

systemct1 reboot

C.

systemct1 get-default

D.

systemct1 emergency

Full Access
Question # 72

A systems administrator wants to list all local accounts in which the UID is greater than 500. Which of the following commands will give the correct

output?

A.

find /etc/passwd —size +500

B.

cut —d: fl / etc/ passwd > 500

C.

awk -F: ‘$3 > 500 {print $1}' /etc/passwd

D.

sed '/UID/' /etc/passwd < 500

Full Access
Question # 73

A systems administrator is enabling LUKS on a USB storage device with an ext4 filesystem format. The administrator runs dmesg and notices the following output:

Given this scenario, which of the following should the administrator perform to meet these requirements? (Select three).

A.

gpg /dev/sdcl

B.

pvcreate /dev/sdc

C.

mkfs . ext4 /dev/mapper/LUKSCJ001 - L ENCRYPTED

D.

umount / dev/ sdc

E.

fdisk /dev/sdc

F.

mkfs . vfat /dev/mapper/LUKS0001 — L ENCRYPTED

G.

wipefs —a/dev/sdbl

Full Access
Question # 74

A Linux administrator copied a Git repository locally, created a feature branch, and committed some changes to the feature branch. Which of the following Git actions should the Linux administrator use to publish the changes to the main branch of the remote repository?

A.

rebase

B.

tag

C.

commit

D.

push

Full Access
Question # 75

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 -1

B.

kill -3

C.

kill -15

D.

kill -HUP

E.

kill -TERM

Full Access
Question # 76

Which of the following can be used as a secure way to access a remote termi-nal?

A.

TFTP

B.

SSH

C.

SCP

D.

SFTP

Full Access
Question # 77

A developer needs to launch an Nginx image container, name it Web001, and ex-pose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?

A.

docker exec —it -p 8080: 80 ——name Web001 nginx

B.

docker load -it -p 8080:80 ——name Web001 nginx

C.

docker run -it -P 8080:80 ——name Web001 nginx

D.

docker pull -it -p 8080:80 —name Web00l nginx

Full Access
Question # 78

A Linux administrator is creating a new sudo profile for the accounting user. Which of the following should be added by the administrator to the sudo

configuration file so that the accounting user can run / opt/ acc/ report as root?

A.

accounting localhost=/opt/acc/report

B.

accounting ALL=/opt/acc/report

C.

%accounting ALL=(ALL) NOPASSWD: /opt/acc/report

D.

accounting /opt/acc/report= (ALL) NOPASSWD: ALL

Full Access
Question # 79

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

Full Access
Question # 80

Users are experiencing high latency when accessing a web application served by a Linux machine. A systems administrator checks the network interface counters and sees the following:

Which of the following is the most probable cause of the observed latency?

A.

The network interface is disconnected.

B.

A connection problem exists on the network interface.

C.

No IP address is assigned to the interface.

D.

The gateway is unreachable.

Full Access
Question # 81

A security team discovers that a web server has been running with elevated privileges and identifies it as a security violation. Which of the following items needs to be added to the webserver.service file to remediate the issue?

A.

In the [Service] section of the webserver.service file, add User=comptia.

B.

In the [Unit] section of the webserver.service file, add AllowIsolate=true.

C.

In the [Install] section of the webserver.service file, add WantedBy=single.target.

D.

Add After=network.target to the [Install] section of the webserver.service file.

Full Access
Question # 82

A Linux administrator is creating a user that can run the FTP service but cannot log in to the system. The administrator sets /bin/false as a login shell for the user. When the user tries to run the FTP service, it is rejected with an "invalid shell: /bin/false" message. Which of the following is the best way to resolve the issue?

A.

Change ownership of /bin/false to the FTP user

B.

Add /bin/false entry to the /etc/shells file

C.

Make /bin/false an executable file

D.

Change the user’s default shell to /bin/bash

Full Access
Question # 83

After trying to install an RPM package unsuccessfully, a systems administrator verifies the integrity of the package's database. The administrator discovers that the database is corrupted and needs to be recreated. Which of the following commands will help accomplish this task?

A.

rpmdb -D rebuild

B.

rpmdb --initdb

C.

rpmdb --rebuilddb

D.

rpmdb --exportdb

Full Access
Question # 84

A non-privileged user is attempting to use commands that require elevated account permissions, but the commands are not successful. Which of the following most likely needs to be updated?

A.

/etc/passwd

B.

/etc/shadow

C.

/etc/sudoers

D.

/etc/bashrc

Full Access
Question # 85

A systems administrator is tasked with changing the default shell of a system account in order to disable iterative logins. Which of the following is the

best option for the administrator to use as the new shell?

A.

/sbin/nologin

B.

/bin/ sh

C.

/sbin/ setenforce

D.

/bin/bash

Full Access
Question # 86

A Linux administrator generated a list of users who have root-level command-line access to the Linux server to meet an audit requirement. The administrator analyzes the following /etc/passwd and /etc/sudoers files:

$ cat /etc/passwd

root:x: 0:0: :/home/root: /bin/bash

lee: x: 500: 500: :/home/lee:/bin/tcsh

mallory:x: 501:501: :/root:/bin/bash

eve:x: 502: 502: /home/eve:/bin/nologin

carl:x:0:503: :/home/carl:/bin/sh

bob:x: 504: 504: : /home/bob:/bin/ksh

alice:x: 505:505: :/home/alice:/bin/rsh

$ cat /etc/sudoers

Cmnd_Alias SHELLS = /bin/tcsh, /bin/sh, /bin/bash

Cmnd_Alias SYSADMIN = /usr/sbin/tcpdump

ALL = (ALL) ALL

ALL = NOPASSWD: SYSADMIN

Which of the following users, in addition to the root user, should be listed in the audit report as having root-level command-line access? (Select two).

A.

Carl

B.

Lee

C.

Mallory

D.

Eve

E.

Bob

F.

Alice

Full Access
Question # 87

A Linux administrator is troubleshooting a systemd mount unit file that is not working correctly. The file contains:

[root@system] # cat mydocs.mount

[Unit]

Description=Mount point for My Documents drive

[Mount]

What=/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34

Where=/home/user1/My Documents

Options=defaults

Type=xfs

[Install]

WantedBy=multi-user.target

The administrator verifies the drive UUID correct, and user1 confirms the drive should be mounted as My Documents in the home directory. Which of the following can the administrator

do to fix the issues with mounting the drive? (Select two).

A.

Rename the mount file to home-user1-My\x20Documents.mount.

B.

Rename the mount file to home-user1-my-documents.mount.

C.

Change the What entry to /dev/drv/disk/by-uuid/94afc9b2\-ac34\-ccff\-88ae\-297ab3c7ff34.

D.

Change the Where entry to Where=/home/user1/my\ documents.

E.

Change the Where entry to Where=/home/user1/My\x20Documents.

F.

Add quotes to the What and Where entries, such as What="/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34" and Where="/home/user1/My Documents".

Full Access
Question # 88

The application team has reported latency issues that are causing the application to crash on the Linux server. The Linux administrator starts

troubleshooting and receives the following output:

Which of the following commands will improve the latency issue?

A.

# echo 'net.core.net_backlog = 5000000' >> /etc/sysctl.conf# sysctl -p# systemctl daemon-reload

B.

# ifdown eth0# ip link set dev eth0 mtu 800# ifup eth0

C.

# systemctl stop network# ethtool -g eth0 512# systemctl start network

D.

# echo 'net.core.rmem max = 12500000' >> /etc/sysctl.conf# echo 'net.core.wmem_max = 12500000' >> /etc/sysctl.conf# sysctl -p

Full Access
Question # 89

A systems administrator is working on a security report from the Linux servers. Which of the following commands can the administrator use to display all the firewall rules applied to the Linux servers? (Select two).

A.

ufw limit

B.

iptables —F

C.

systemct1 status firewalld

D.

firewall—cmd ——1ist—a11

E.

ufw status

F.

iptables —A

Full Access
Question # 90

A Linux administrator provisioned a new web server with custom administrative permissions for certain users. The administrator receives a report that user1 is unable to restart the Apache web service on this server. The administrator reviews the following output:

[ root@server ] # id user1

UID=1011 (user1) gid=1011 (USER1) groups=1011 (user1), 101 (www-data), 1120 (webadmin)

[ root@server ] # cat /etc/sudoers.d/custom.conf

user1 ALL=/usr/sbin/systemctl start httpd, /usr/sbin/systemctl stop httpd

webadmin ALL=NOPASSWD: /etc/init.d.httpd restart, /sbin/service httpd restart, /usr/sbin/apache2ctl restart

#%wheel ALL=(ALL) NOPASSWD: ALL

Which of the following would most likely resolve the issue while maintaining a least privilege security model?

A.

User1 should be added to the wheel group to manage the service.

B.

User1 should have "NOPASSWD:" after the "ALL=" in the custom. conf.

C.

The wheel line in the custom. conf file should be uncommented.

D.

Webadmin should be listed as a group in the custom. conf file.

Full Access
Question # 91

An application developer received a file with the following content:

##This is a sample Image ##

FROM ubuntu:18.04

MAINTAINER demohut@gtmail.com.hac

COPY . /app

RUN make /app

CMD python /app/app.py

RUN apt-get update

RUN apt-get install -y nginx

CMD ["echo","Image created"]

The developer must use this information to create a test bed environment and identify the image (myimage) as the first version for testing a new

application before moving it to production. Which of the following commands will accomplish this task?

A.

docker build -t myimage:1.0 .

B.

docker build -t myimage: .

C.

docker build -t myimage-1.0 .

D.

docker build -i myimage:1.0 .

Full Access
Question # 92

A DevOps engineer is working on a local copy of a Git repository. The engineer would like to switch from the main branch to the staging branch but notices the staging branch does not exist. Which of the following Git commands should the engineer use to perform this task?

A.

git branch —m staging

B.

git commit —m staging

C.

git status —b staging

D.

git checkout —b staging

Full Access
Question # 93

A user is unable to remotely log on to a server using the server name server1 and port 22. The Linux engineer troubleshoots the issue and gathers the following information:

Which of the following is most likely causing the issue?

A.

server 1 is not in the DNS.

B.

sshd is running on a non-standard port.

C.

sshd is not an active service.

D.

serverl is using an incorrect IP address.

Full Access
Question # 94

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.

file filename

B.

touch filename

C.

grep filename

D.

lsof filename

Full Access
Question # 95

A systems engineer deploys a new application server, but the server cannot communicate with the back-end database hostname. The engineer confirms that the application server can ping the database server's IP address. Which of the following is the most likely cause of the issue?

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Full Access
Question # 96

An administrator made a change to a system’s network configuration. Which of the following best represents what the administrator should do to have the new configuration take effect?

A.

systemctl restart networkd

B.

systemctl enable networkd

C.

systemctl status networkd

D.

systemctl isolate networkd

Full Access
Question # 97

While troubleshooting server issues, a Linux systems administrator obtains the following output:

[rootGhost ~]# totalfree -m usedfreesharedbuf f/cache available

Mem:373635988824829

Swap:20471824223

Which of the following best describes the state of the system?

A.

The system has consumed the system memory and swap space.

B.

The system has enough free memory space.

C.

The system has swap disabled.

D.

The system has allocated enough buffer space.

Full Access
Question # 98

A Linux engineer wants to give read-write-execute permissions for the cloud_users directory to user Oliver. Which of the following commands should the engineer use?

A.

setfacl -L Oliver/cloud_users

B.

setfacl -x rwx/cloud_users

C.

setfacl -P rwx/cloud_users

D.

setfacl -m u:Oliver/cloud_users

Full Access
Question # 99

A Linux administrator has been tasked with installing the most recent versions of packages on a RPM-based OS. Which of the following commands will accomplish this task?

A.

apt-get upgrade

B.

rpm -a

C.

yum updateinfo

D.

dnf update

E.

yum check-update

Full Access
Question # 100

A Linux administrator needs to run a web application on a server that requires the use of a desktop web browser to enter the final configuration information. The administrator determines the server is running in multi-user mode. The administrator verifies that a web browser is installed on the server and that it has a display manager installed. Which of the following commands will best allow the administrator to temporarily use the web browser on the server?

A.

sudo systemctl isolate graphical.target

B.

sudo systemctl set-default runlevel5.target

C.

sudo systemctl restart gdm

D.

sudo systemctl --no-wall rescue

Full Access
Question # 101

Which of the following commands is used to tune kernel parameters?

A.

sysctl

B.

ss

C.

mkinitrd

D.

lsof

Full Access
Question # 102

A systems engineer has deployed a new application server, but the server cannot communicate with the backend database hostname. The engineer confirms that the application server can ping the database server's IP address. Which of the following is the most likely cause of the issue?

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Full Access
Question # 103

A systems administrator identifies multiple processes in a zombie state. Which of the following signals would be best for the administrator to send to the PPID?

A.

SIGTERM

B.

SIGHUP

C.

SIGQUIT

D.

SIGSTOP

Full Access
Question # 104

After connecting to a remote host via SSH, an administrator attempts to run an application but receives the following error:

[user@workstation ~]$ ssh admin@srv1

Last login: Tue Mar 29 18:03:34 2022

[admin@srvl ~] $ /usr/local/bin/config_manager

Error: cannot open display:

[admin@srv1 ~] $

Which of the following should the administrator do to resolve this error?

A.

Disconnect from the SSH session and reconnect using the ssh -x command.

B.

Add Options X11 to the /home/admin/.ssh/authorized_keys file.

C.

Open port 6000 on the workstation and restart the firewalld service.

D.

Enable X11 forwarding in /etc/ssh/ssh_config and restart the server.

Full Access
Question # 105

A Linux administrator is tasked with moving files in a database server. The administrator must not overwrite any existing files. Which of the following commands would indicate that the file already exists?

A.

mv-ifilename/tmp/backup

B.

mv-bfilename/tmp/backup

C.

mv-nfilename/tmp/backup

D.

mv-ffilename/tmp/backup

Full Access
Question # 106

NO: 66:

An administrator needs to stop a foreground process in between its execution in a terminal. Which of the following should the administrator use?

A.

Ctrl+D

B.

Ctrl+F

C.

Ctrl+Z

D.

Ctrl+C

Full Access
Question # 107

A Linux administrator needs to forward port 8000 on a remote server to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?

A.

firewall-cmd --add-forward-port=port=8000=tcp=8000=remote

B.

iptables -A FORWARD -m state -p tcp -d remote --dport 9000 -j accept

C.

ssh -R 8000:localhost:9000 remote

D.

socat TCP4-LISTEN:8000,fork TCP4:remote:8000

Full Access
Question # 108

The users of a Linux system are unable to use one of the application filesystems. The following outputs have been provided:

bash

$ cd /app

$ touch file

touch: cannot touch 'file': Readonly file system

Output 2

/dev/sdcl on /app type ext4 (ro,relatime,seclabel,data=ordered)

Output 3

/dev/sdcl /app ext4 defaults 0 0

Output 4

[302.048075] Buffer I/O error on dev sdcl, logical block 0, async page read

[302.048490] EXT4-fs (sdcl): Attempt to read block from filesystem resulted in short read while trying to re-open /dev/sdcl

Which of the following actions will resolve this issue?

A.

umount /app fsck -y /dev/sdcl mount /app

B.

xfs_repair /dev/sdcl mount -o rw,remount /app

C.

umount /app xfs_repair /dev/sdcl mount /app

D.

fsck -y /dev/sdcl mount -o rw,remount /app

Full Access
Question # 109

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.

systemct1 analyze network

B.

systemct1 info network

C.

sysctl -a network

D.

journalctl -xu network

Full Access
Question # 110

A systems administrator is configuring a Linux system so that network traffic from the internal network 172.17.0.0/16 going out through the eth0 interface would appear as if it was sent directly from this interface. Which of the following commands will accomplish this task?

A.

iptables -A POSTROUTING -s 172.17.0.0/16 -o eth0 -j MASQUERADE

B.

firewalld -A OUTPUT -s 172.17.0.0/16 -o eth0 -j DIRECT

C.

nmcli snasq-traffic eth0 -s 172.17.0.0/16 -j MASQUERADE

D.

ifconfig --nat eth0 -s 172.17.0.0/16 -j DIRECT

Full Access
Question # 111

Linux system users report that over the past few months, a server has stopped responding at least twice each day. Every time this happens, the users have to restart the server to recover it. A systems administrator diagnosing the issue collects the following outputs:

csharp

Output 1

[Tue Aug 31 16:36:42 2021] oom-killer invoked by java: gfp_mask=0x280da2 order=0, oom_score_adj=0

[Tue Aug 31 16:36:42 2021] java cpuset=/ mems_allowed=0

makefile

Output 2

[root@server]# free -m

total used free shared buff/cache available

Mem: 15819 15026 174 92 619 134

Swap: 0 0 0

Which of the following is the best permanent resolution for the system?

A.

More memory resources

B.

More CPU resources

C.

More network bandwidth

D.

Extended root filesystem

Full Access
Question # 112

A Linux systems administrator is working to obtain the installed kernel version of several hundred systems. Which of the following utilities should the administrator use for this task?

A.

Ansible

B.

Git

C.

Docker

D.

Bash

Full Access
Question # 113

A Linux administrator was informed that the server time zone is incorrect. Which of the following commands should the administrator use to correct the time zone?

A.

timedatectl set-timezone America/New_York

B.

systemd-timezone set Asia/Tokyo

C.

systemctl configure-timezone Africa/Nairobi

D.

tzconfig configure Europe/London

Full Access
Question # 114

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.

tr '(A-Z}' '{a-z}' < testfile > uppercase

B.

echo testfile | tr "[Z-A]" "[z-a]" < testfile > uppercase

C.

cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase

D.

tr '[a-z]' '[A-Z]' < testfile > uppercase

Full Access
Question # 115

A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?

A.

systemct1 cancel nginx

B.

systemct1 disable nginx

C.

systemct1 mask nginx

D.

systemct1 stop nginx

Full Access
Question # 116

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 push images -a

C.

docker rmi -a images

D.

docker images rmi --all

Full Access
Question # 117

An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?

Full Access
Question # 118

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

A.

rpm -s

B.

rрm -d

C.

rpm -q

D.

rpm -e

Full Access
Question # 119

A Linux systems administrator is setting up a new web server and getting 404 - NOT FOUND errors while trying to access the web server pages from the browser. While working on the diagnosis of this issue, the Linux systems administrator executes the following commands:

Which of the following commands will BEST resolve this issue?

A.

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

B.

restorecon -R -v /var/www/html

C.

setenforce 0

D.

setsebool -P httpd_can_network_connect_db on

Full Access
Question # 120

A Linux administrator is troubleshooting SSH connection issues from one of the workstations.

When users attempt to log in from the workstation to a server with the IP address 104.21.75.76, they receive the following message:

The administrator reviews the information below:

Which of the following is causing the connectivity issue?

A.

The workstation has the wrong IP settings.

B.

The sshd service is disabled.

C.

The server’s firewall is preventing connections from being made.

D.

The server has an incorrect default gateway configuration.

Full Access