Pre-Summer Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: myex65

Home > CompTIA > Linux+ > XK0-005

XK0-005 CompTIA Linux+ Exam Question and Answers

Question # 4

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 # 5

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 # 6

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
Question # 7

A Linux systems administrator is trying to execute a particular shell script on a server. The administrator reviews the following outputs:

shell

$ ./startup.sh

bash: ./startup.sh: Permission denied

$ ls -l startup.sh

-rw-rw-r-- 1 companyabc companyabc 18 October 15:35 startup.sh

Which of the following commands should the administrator use to allow the script to run?

A.

chown rootstartup.sh

B.

chmod 750 startup.sh

C.

chmod -x startup.sh

D.

chmod 400 startup.sh

Full Access
Question # 8

A newly hired junior administrator is studying the format of the /var/log/messages file. Which of the following commands should the administrator use to preserve the contents of the original file while also creating an identical file in the /home/admin directory?

A.

touch /var/log/messages /home/admin

B.

mv /var/log/messages /home/admin

C.

cat /var/log/messages > /home/admin/messages

D.

ln -s /var/log/messages /home/admin

Full Access
Question # 9

A systems administrator is tasked with configuring a repository on an RPM-based Linux system. Which of the following need to be reviewed and modified? (Select two).

A.

/etc/yum.conf

B.

/etc/apt/sources.list.d

C.

/etc/pam.d

D.

/etc/apt.conf

E.

/etc/yum.repos.d

F.

/etc/ssh/ssh_config

Full Access
Question # 10

A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task?

A.

echo 1 > /proc/sys/net/ipv4/ipv_forward

B.

sysctl -w net.ipv4.ip_forward=1

C.

firewall-cmd --enable ipv4_forwarding

D.

systemct1 start ipv4_forwarding

Full Access
Question # 11

The journald entries have filled a Linux machine’s /var volume. Which of the following is the best command for a systems administrator to use to free up the disk space occupied by these entries?

A.

journalctl --rotatejournalctl --vacuum-time=1s

B.

systemctl stop systemd-journaldsystemctl start systemd-journald

C.

rm -rf /var/log/journalsystemctl restart systemd-journald

D.

pkill -HUP systemd-journaldsystemctl restart systemd-journald

Full Access
Question # 12

An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output:

Which of the following commands would resolve the issue?

A.

restorecon .ssh/authorized_keys

B.

ssh_keygen -t rsa -o .ssh/authorized_keys

C.

chown root:root .ssh/authorized_keys

D.

chmod 600 .ssh/authorized_keys

Full Access
Question # 13

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

A.

docker-compose inspect WEB

B.

docker logs WEB

C.

docker run --name WEB --volume /dev/stdout:/var/log/nginx/error.log

D.

docker ps WEB -f

Full Access
Question # 14

A Linux administrator needs to remove all local firewall rules on a Linux system. Which of the following commands should the administrator run?

A.

iptables -D

B.

iptables -L

C.

iptables -F

D.

iptables -A

Full Access
Question # 15

A server administrator has scheduled a cron job to run YUM updates on all servers without manual intervention, but kernel packages must be excluded from the updates at all times. Which of the following configuration files needs to be modified to make these changes persistent?

A.

/etc/yum.conf

B.

/etc/dnf/dnf.conf

C.

/etc/yum/pluginconf.d/packages.conf

D.

/etc/yum.repo.d/kernel.repo

Full Access
Question # 16

A Linux systems administrator is resolving a privileged access issue for users who are members of an admin group. Which of the following configuration files should the administrator update so the users in the admin group will have root privileged access to the Linux system?

A.

/etc/sudoers

B.

/etc/login.defs

C.

/etc/group

D.

/etc/shadow

Full Access
Question # 17

A security analyst is monitoring the network to identify latency or slowdowns during a vulnerability scan. Which of the following functions will best achieve this?

bash

function x() {

info=$(ping -c 1 $1 | awk -F "/" 'END {print $5}')

echo "$1 | $info"

}

A.

function x() { info=$(dig $(dig -x $1 | grep ptr | tail -n 1 | awk -F ".in-addr" '{print $1}').origin.asn.cymru.com TXT +short); echo "$1 | $info" }

B.

function x() { info=$(ping -c 1 $1 | awk -F "/" 'END {print $5}'); echo "$1 | $info" }

C.

function x() { info=$(nc -m 40 $1 | awk 'END {print $1}'); echo "$1 | $info" }

D.

function x() { info=$(geoiplookup $1); echo "$1 | $info" }

Full Access
Question # 18

A Linux administrator is implementing a stateful firewall on the Linux server. Which of the following iptables options will be required to build the stateful rules? (Select two).

A.

--name established

B.

-m recent

C.

-m conntrack

D.

--state

E.

--remove

F.

-j DROP

Full Access
Question # 19

Which of the following options describes the purpose of YAML?

A.

YAML is a binary format used to ensure data transfer in a non-human-readable format

B.

YAML is used for configuration files and data serialization in IaC tools in a human-readable format

C.

YAML is like HTML and is used to create web page structure content for web deployment

D.

YAML is designed for web development and has libraries for infrastructure automation

Full Access
Question # 20

A new drive was recently added to a Linux system. Using the environment and tokens provided, complete the following tasks:

• Create an appropriate device label.

• Format and create an ext4 file system on the new partition.

The current working directory is /.

Full Access
Question # 21

NO: 54:

A new hard drive /dev/sdd was added to a server. Which of the following commands will create a partition table with a single partition /dev/sdd1 that consumes the entire disk?

A.

echo 'type=83' | sudo sfdisk /dev/sdd

B.

sudo sfdisk /dev/sdd -t=83

C.

echo 'auto' | sudo fdisk /dev/sdd

D.

sudo fdisk /dev/sdd -1 -t=83

Full Access
Question # 22

The applications team is reporting issues when trying to access the web service hosted in a Linux system. The Linux systems administrator is reviewing the following outputs:

Output 1:

* httpd.service = The Apache HTTPD Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

Active: inactive (dead)

Docs: man:httpd(8) man:apachectl(8)

Output 2:

16:51:16 up 28 min, 1 user, load average: 0.00, 0.00, 0.07

Which of the following statements best describe the root cause? (Select two).

A.

The httpd service is currently started.

B.

The httpd service is enabled to auto start at boot time, but it failed to start.

C.

The httpd service was manually stopped.

D.

The httpd service is not enabled to auto start at boot time.

E.

The httpd service runs without problems.

F.

The httpd service did not start during the last server reboot.

Full Access
Question # 23

An administrator wants to execute a long-running script in the terminal while troubleshooting another issue. Which of the following options will achieve this goal?

A.

bash script.sh &

B.

source script.sh

C.

sh script.sh | jobs

D.

nice -10 ./script.sh

Full Access
Question # 24

A network administrator issues the dig ww. comptia. org command and receives an NXDOMAIN response. Which of the following files should the administrator check first?

A.

/etc/resolv.conf

B.

/etc/hosts

C.

/etc/sysconfig/network-scripts

D.

/etc/nsswitch.conf

Full Access
Question # 25

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 # 26

Which of the following is the best tool for dynamic tuning of kernel parameters?

A.

tuned

B.

tune2fs

C.

tuned-adm

D.

turbostat

Full Access
Question # 27

A Linux administrator needs to set the permissions on a server. The administrator wants to have the files within the directory set to read-write permissions and the directory set to read-write-execute permissions. Which of the following commands should the administrator use?

A.

chmod 0022

B.

chown 0027

C.

setfacl 0007

D.

umask 0077

Full Access
Question # 28

An administrator needs to get network information from a group of statically assigned workstations before they are reconnected to the network. Which of the following should the administrator use to obtain this information?

A.

ip show

B.

ifcfg —a

C.

ifcfg —s

D.

i fname —s

Full Access
Question # 29

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 # 30

A systems administrator created a new directory with specific permissions. Given the following output:

# file: comptia

# owner: root

# group: root

user: : rwx

group :: r-x

other: :---

default:user :: rwx

default:group :: r-x

default:group:wheel: rwx

default:mask :: rwx

default:other ::-

Which of the following permissions are enforced on /comptia?

A.

Members of the wheel group can read files in /comptia.

B.

Newly created files in /comptia will have the sticky bit set.

C.

Other users can create files in /comptia.

D.

Only root can create files in /comptia.

Full Access
Question # 31

The group named support is unable to make changes to the config file. An administrator is reviewing the permissions and sees the following:

S Is -1 config

-rw-rw----. 1 root app 4682 02-15 11:25 config

Which of the following should the administrator execute in order to give the support group access to modify the file while preserving the current ownership?

A.

chown :support config

B.

setfacl -m g:support:rw- config

C.

chmod 664 config

D.

chmod g+s config

Full Access
Question # 32

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 # 33

A systems technician needs to install a third-party software package. Which of the following commands would allow the technician to download this software package from a remote server?

A.

netstat

B.

nc

C.

telnet

D.

wget

Full Access
Question # 34

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

A.

sysctl

B.

ss

C.

mkinitrd

D.

lsof

Full Access
Question # 35

A Linux system is having issues. Given the following outputs:

# dig @192.168.2.2 mycomptiahost

; << >> DiG 9.9.4-RedHat-9.9.4-74.el7_6.1 << >> @192.168.2.2 mycomptiahost

; (1 server found)

;; global options: +cmd

;; connection timed out; no servers could be reached

# nc -v 192.168.2.2 53

Ncat: Version 7.70 ( https://nmap.org/ncat )

Ncat: Connection timed out.

# ping 192.168.2.2

PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.

64 bytes from 192.168.2.2: icmp_seq=1 ttl=117 time=4.94 ms

64 bytes from 192.168.2.2: icmp_seq=2 ttl=117 time=10.5 ms

Which of the following best describes this issue?

A.

The DNS host is down.

B.

The name mycomptiahost does not exist in the DNS.

C.

The Linux engineer is using the wrong DNS port.

D.

The DNS service is currently not available or the corresponding port is blocked.

Full Access
Question # 36

An administrator would like to securely connect to a server and forward port 8080 on a local machine to port 80 on the server. Which of the following commands should the administrator use to satisfy both requirements?

A.

ssh —L 8080: localhost:80 admin@server

B.

ssh —R 8080: localhost:80 admin@server

C.

ssh —L 80 : localhost:8080 admin@server

D.

ssh —R 80 : localhost:8080 admin@server

Full Access
Question # 37

An administrator is investigating why a Linux workstation is not resolving a website. The output of dig and nslookup shows that IPv4 resolution is working, but IPv6 resolution fails.

The administrator executes:

nslookup -querytype=AAAA www.comptia.org

Can't find www.comptia.org: No answer

The workstation has a static entry in /etc/hosts:

CopyEdit

104.18.99.101 www.comptia.org

Which of the following is the most likely cause?

A.

The static entry needs to be removed from /etc/hosts.

B.

The remote website does not support IPv6, and the workstation requires it.

C.

The firewall needs to be modified to allow outbound HTTP and HTTPS.

D.

The nameserver in /etc/resolv.conf needs to be updated to 8.8.8.8.

Full Access
Question # 38

An administrator runs ping comptia.org. The result of the command is:

ping: comptia.org: Name or service not known

Which of the following files should the administrator verify?

A.

/etc/ethers

B.

/etc/services

C.

/etc/resolv.conf

D.

/etc/sysctl.conf

Full Access
Question # 39

An administrator needs to increase the system priority of a process with PID 2274. Which of the following commands should the administrator use to

accomplish this task?

A.

renice —n —15 2274

B.

nice -15 2274

C.

echo "—15" > /proc/PID/2274/priority

D.

ps —ef I grep 2274

Full Access
Question # 40

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 # 41

Joe, a user, is unable to log in to the system. The Linux administrator checks the /etc/passwd file and reviews the following output:

Joe:x:1002:1002::/home/Joe:/sbin/nologin

Which of the following should the administrator do to fix this issue?

A.

Remove the x entry in the /etc/passwd file for Joe

B.

Change the /sbin/nologin entry to /bin/sh for Joe

C.

Issue the usermod -l Joe command

D.

Ensure that a corresponding entry is in the /etc/shadow file for Joe

Full Access
Question # 42

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 # 43

A Linux administrator needs to determine whether a hostname is in the DNS. Which of the following would supply the information that is needed?

A.

nslookup

B.

rsynс

C.

netstat

D.

host

Full Access
Question # 44

A Linux administrator changed a systemd configuration. However, the change was not applied after the system was restarted. Which of the following commands is required to apply the change?

A.

systemctl enable

B.

[Option missing]

C.

systemctl daemon-reload

D.

systemctl restart

Full Access
Question # 45

A Linux administrator needs to expose port 9000 for a container to listen during runtime. The Linux administrator creates a Dockerfile with the following entries:

sql

FROM node:9-alpine

WORKDIR /usr/src/app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 9000

CMD ["npm", "start"]

Which of the following commands should the administrator use to accomplish this task? (Select two).

A.

docker build -t Test-Container

B.

docker tag Test-Container

C.

docker inspect Test-Container

D.

docker run -p 5000:80 Test-Container

E.

docker push Test-Container

F.

docker run -p 80:9000 Test-Container

Full Access
Question # 46

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

A.

iptables -F INPUT -j 192.168.10.50 -m DROP

B.

iptables -A INPUT -s 192.168.10.30 -j DROP

C.

iptables -i INPUT --ipv4 192.168.10.50 -z DROP

D.

iptables -j INPUT 192.168.10.50 -p DROP

Full Access
Question # 47

A Linux administrator has set up a new DNS forwarder and is configuring all internal servers to use the new forwarder to look up external DNS requests. The administrator needs to modify the firewall on the server for the DNS forwarder to allow the internal servers to communicate to it and make the changes persistent between server reboots. Which of the following commands should be run on the DNS forwarder server to accomplish this task?

A.

ufw allow out dns

B.

systemct1 reload firewalld

C.

iptables -A OUTPUT -p udp -ra udp -dport 53 -j ACCEPT

D.

flrewall-cmd --zone-public --add-port-53/udp --permanent

Full Access
Question # 48

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

Full Access
Question # 49

A systems administrator is investigating an issue in which one of the servers is not booting up properly. The journalctl entries show the following:

Which of the following will allow the administrator to boot the Linux system to normal mode quickly?

A.

Comment out the /opt/app filesystem in /etc/fstab and reboot.

B.

Reformat the /opt/app filesystem and reboot.

C.

Perform filesystem checks on local filesystems and reboot.

D.

Trigger a filesystem relabel and reboot.

Full Access
Question # 50

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 # 51

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 # 52

A systems administrator is receiving tickets from users who cannot reach the application app that should be listening on port 9443/tcp on a Linux server.

To troubleshoot the issue, the systems administrator runs netstat and receives the following output:

Based on the information above, which of the following is causing the issue?

A.

The IP address 0.0.0.0 is not valid.

B.

The application is listening on the loopback interface.

C.

The application is listening on port 1234.

D.

The application is not running.

Full Access
Question # 53

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 # 54

A systems administrator is troubleshooting a connectivity issue pertaining to access to a system named db.example.com. The system IP address should be 192.168.20.88. The administrator issues the dig command and receives the following output:

The administrator runs grep db.example.com /etc/hosts and receives the following output:

Given this scenario, which of the following should the administrator do to address this issue?

A.

Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.

B.

Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.

C.

Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.

D.

Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.

Full Access
Question # 55

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 # 56

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

A.

/var

B.

/tmp

C.

/etc

D.

/opt

Full Access
Question # 57

A systems administrator checked out the code from the repository, created a new branch, made changes to the code, and then updated the main branch. The systems administrator wants to ensure that the Terraform state files do not appear in the main branch. Which of following should the administrator use to meet this requirement?

A.

clone

B.

gitxgnore

C.

get

D.

.ssh

Full Access
Question # 58

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 # 59

A database administrator requested the installation of a custom database on one of the servers. Which of the following should the Linux administrator configure so the requested packages can be installed?

A.

/etc/yum.conf

B.

/etc/ssh/sshd.conf

C.

/etc/yum.repos.d/db.repo

D.

/etc/resolv.conf

Full Access
Question # 60

A systems administrator wants to delete app . conf from a Git repository. Which of the following commands will delete the file?

A.

git tag app. conf

B.

git commit app . conf

C.

git checkout app . conf

D.

git rm app. conf

Full Access
Question # 61

A Linux administrator is configuring a two-node cluster and needs to be able to connect the nodes to each other using SSH keys from the root account. Which of the following commands will accomplish this task?

A.

[root@nodea ssh —i ~/ . ssh/±d rsa root@nodeb

B.

[root@nodea scp -i . ssh/id rsa root@nodeb

C.

[root@nodea ssh—copy-id —i .ssh/id rsa root@nodeb

D.

[root@nodea # ssh add -c ~/ . ssh/id rsa root@nodeb

E.

[root@nodea # ssh add -c ~/. ssh/id rsa root@nodeb

Full Access
Question # 62

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 # 63

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.

systemct1 isolate multi-user.target

B.

systemct1 isolate graphical.target

C.

systemct1 isolate network.target

D.

systemct1 isolate basic.target

Full Access
Question # 64

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 # 65

A Linux administrator wants to set the SUID of a file named dev_team.text with 744 access rights. Which of the following commands will achieve this goal?

A.

chmod 4744 dev_team.txt

B.

chmod 744 --setuid dev_team.txt

C.

chmod -c 744 dev_team.txt

D.

chmod -v 4744 --suid dev_team.txt

Full Access
Question # 66

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 # 67

A systems administrator made some unapproved changes prior to leaving the company. The newly hired administrator has been tasked with revealing the system to a compliant state. Which of the following commands will list and remove the correspondent packages?

A.

dnf list and dnf remove last

B.

dnf remove and dnf check

C.

dnf info and dnf upgrade

D.

dnf history and dnf history undo last

Full Access
Question # 68

A Linux administrator is scheduling a system job that runs a script to check available disk space every hour. The Linux administrator does not want users to be able to start the job. Given the following:

The Linux administrator attempts to start the timer service but receives the following error message:

Which of the following is MOST likely the reason the timer will not start?

A.

The checkdiskspace.timer unit should be enabled via systemct1.

B.

The timers.target should be reloaded to get the new configuration.

C.

The checkdiskspace.timer should be configured to allow manual starts.

D.

The checkdiskspace.timer should be started using the sudo command.

Full Access
Question # 69

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 # 70

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 # 71

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

Full Access
Question # 72

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 # 73

A systems administrator wants to test the route between IP address 10.0.2.15 and IP address 192.168.1.40. Which of the following commands will accomplish this task?

A.

route -e get to 192.168.1.40 from 10.0.2.15

B.

ip route get 192.163.1.40 from 10.0.2.15

C.

ip route 192.169.1.40 to 10.0.2.15

D.

route -n 192.168.1.40 from 10.0.2.15

Full Access
Question # 74

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

A.

LDAP

B.

MFA

C.

SSO

D.

PAM

Full Access
Question # 75

Some servers in an organization have been compromised. Users are unable to access to the organization’s web page and other services. While reviewing the system log, a systems administrator notices messages from the kernel regarding firewall rules:

Which of the following commands will remediate and help resolve the issue?

A.

B.

C.

D.

Full Access
Question # 76

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?

Full Access
Question # 77

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.

B.

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

C.

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

D.

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

E.

Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.

F.

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

Full Access
Question # 78

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_dsa.pem

B.

id_rsa

C.

id_ecdsa

D.

id_rsa.pub

Full Access
Question # 79

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 # 80

Due to low disk space, a Linux administrator finding and removing all log files that were modified more than 180 days ago. Which of the following commands will accomplish this task?

A.

find /var/log -type d -mtime +180 -print -exec rm {} \;

B.

find /var/log -type f -modified +180 -rm

C.

find /var/log -type f -mtime +180 -exec rm {} \

D.

find /var/log -type c -atime +180 –remove

Full Access
Question # 81

A Linux administrator booted up the server and was presented with a non-GUI terminal. The administrator ran the command systemct1 isolate graphical.target and rebooted the system by running systemct1 reboot, which fixed the issue. However, the next day the administrator was presented again with a non-GUI terminal. Which of the following is the issue?

A.

The administrator did not reboot the server properly.

B.

The administrator did not set the default target to basic.target.

C.

The administrator did not set the default target to graphical.target.

D.

The administrator did not shut down the server properly.

Full Access
Question # 82

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 # 83

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 # 84

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 # 85

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 # 86

A Linux administrator needs to expand a volume group using a new disk. Which of the following options presents the correct sequence of commands to accomplish the task?

A.

partprobevgcreatelvextend

B.

lvcreatefdiskpartprobe

C.

fdiskpartprobemkfs

D.

fdiskpvcreatevgextend

Full Access
Question # 87

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.

SQL

B.

YAML

C.

HTML

D.

JSON

Full Access
Question # 88

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 # 89

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 # 90

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 # 91

A Linux administrator needs to obtain a list of all volumes that are part of a volume group. Which of the following commands should the administrator use to accomplish this task?

A.

vgs

B.

lvs

C.

fdisk -1

D.

pvs

Full Access
Question # 92

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 # 93

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 # 94

A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?

A.

chmod 775

B.

umask. 002

C.

chactr -Rv

D.

chown -cf

Full Access
Question # 95

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 # 96

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 # 97

Users have been unable to reach www.comptia.org from a Linux server. A systems administrator is troubleshooting the issue and does the following:

Based on the information above, which of the following is causing the issue?

A.

The name www.comptia.org does not point to a valid IP address.

B.

The server 192.168.168.53 is unreachable.

C.

No default route is set on the server.

D.

The network interface eth0 is disconnected.

Full Access
Question # 98

A Linux administrator was notified that a virtual server has an I/O bottleneck. The Linux administrator analyzes the following output:

Given there is a single CPU in the sever, which of the following is causing the slowness?

A.

The system is running out of swap space.

B.

The CPU is overloaded.

C.

The memory is exhausted.

D.

The processes are paging.

Full Access
Question # 99

A Linux administrator has physically added a new RAID adapter to a system. Which of the following commands should the Linux administrator run to confirm that the device has been recognized? (Select TWO).

A.

rmmod

B.

Is -11 /etc

C.

Ishw —class disk

D.

pvdisplay

E.

rmdir /dev

F.

dmesg

Full Access
Question # 100

A systems administrator wants to check for running containers. Which of the following commands can be used to show this information?

A.

docker pull

B.

docker stats

C.

docker ps

D.

docker list

Full Access
Question # 101

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 # 102

A user created the following script file:

# ! /bin/bash

# FILENAME: /home/user/ script . sh

echo "hello world"

exit 1

However, when the user tried to run the script file using the command "script . sh, an error returned indicating permission was denied. Which of the follow-ing should the user execute in

order for the script to run properly?

A.

chmod u+x /home/user/script . sh

B.

chmod 600 /home/user/script . sh

C.

chmod /home/user/script . sh

D.

chmod 0+r /horne/user/script. sh

Full Access
Question # 103

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 # 104

A systems administrator is compiling a report containing information about processes that are listening on the network ports of a Linux server. Which of the following commands will allow the administrator to obtain the needed information?

A.

ss -pint

B.

tcpdump -nL

C.

netstat -pn

D.

lsof -It

Full Access
Question # 105

A cloud engineer needs to check the link status of a network interface named eth1 in a Linux server. Which of the following commands can help to achieve the goal?

A.

ifconfig hw eth1

B.

netstat -r eth1

C.

ss -ti eth1

D.

ip link show eth1

Full Access
Question # 106

The security team has identified a web service that is running with elevated privileges A Linux administrator is working to change the systemd service file to meet security compliance standards. Given the following output:

Which of the following remediation steps will prevent the web service from running as a privileged user?

A.

Removing the ExecStarWusr/sbin/webserver -D SOPTIONS from the service file

B.

Updating the Environment File line in the [Service] section to/home/webservice/config

C.

Adding the User-webservice to the [Service] section of the service file

D.

Changing the:nulti-user.target in the [Install] section to basic.target

Full Access
Question # 107

Which of the following tools is BEST suited to orchestrate a large number of containers across many different servers?

A.

Kubernetes

B.

Ansible

C.

Podman

D.

Terraform

Full Access
Question # 108

After listing the properties of a system account, a systems administrator wants to remove the expiration date of a user account. Which of the following commands will accomplish this task?

A.

chgrp system accountname

B.

passwd –s accountname

C.

chmod -G system account name

D.

chage -E -1 accountname

Full Access
Question # 109

An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct

version of this file?

A.

rpm -qa | grep kernel; uname -a

B.

yum -y update; shutdown -r now

C.

cat /etc/centos-release; rpm -Uvh --nodeps

D.

telinit 1; restorecon -Rv /boot

Full Access
Question # 110

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

Full Access
Question # 111

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 has reached its maximum IOPS, causing the system to be slow.

B.

The system has reached its maximum permitted throughput, therefore iowait is increasing.

C.

The system is mostly idle, therefore the iowait is high.

D.

The system has a partitioned disk, which causes the IOPS to be doubled.

Full Access
Question # 112

A Linux systems administrator needs to persistently enable IPv4 forwarding in one of the Linux systems. Which of the following commands can be used together to accomplish this task? (Choose two.)

A.

sysctl net.ipv4.ip_forward

B.

sysctl -w net.ipv4.ip_forward=1

C.

echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf

D.

echo 1 > /proc/sys/net/ipv4/ip_forward

E.

sysctl –p

F.

echo "net.ipv6.conf.all.forwarding=l" >> /etc/sysctl.conf

Full Access
Question # 113

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 # 114

A Linux administrator is tasked with creating resources using containerization. When deciding how to create this type of deployment, the administrator identifies some key features, including portability, high availability, and scalability in production. Which of the following should the Linux administrator choose for the new design?

A.

Docker

B.

On-premises systems

C.

Cloud-based systems

D.

Kubernetes

Full Access
Question # 115

Junior system administrator had trouble installing and running an Apache web server on a Linux server. You have been tasked with installing the Apache web server on the Linux server and resolving the issue that prevented the junior administrator from running Apache.

INSTRUCTIONS

Install Apache and start the service. Verify that the Apache service is running with the defaults.

Typing “help” in the terminal will show a list of relevant event commands.

If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.

Full Access
Question # 116

Which of the following is a function of a bootloader?

A.

It initializes all the devices that are required to load the OS.

B.

It mounts the root filesystem that is required to load the OS.

C.

It helps to load the different kernels to initiate the OS startup process.

D.

It triggers the start of all the system services.

Full Access
Question # 117

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 # 118

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 # 119

A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers. Which of the following commands can be used to copy a key file to remote servers? (Choose two.)

A.

wget

B.

ssh-keygen

C.

ssh-keyscan

D.

ssh-copy-id

E.

ftpd

F.

scp

Full Access
Question # 120

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