Black Friday Biggest Discount Flat 70% Offer - Ends in 0d 00h 00m 00s - Coupon code: 70diswrap

CompTIA XK0-005 Dumps

Page: 1 / 38
Total 376 questions

CompTIA Linux+ Exam Questions and Answers

Question 1

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?

Options:

A.

pull -> push -> add -> checkout

B.

pull -> add -> commit -> push

C.

checkout -> push -> add -> pull

D.

pull -> add -> push -> commit

Question 2

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.)

Options:

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.

Question 3

A systems administrator is investigating why one of the servers has stopped connecting to the internet.

as

Which of the following is causing the issue?

Options:

A.

The DNS address has been commented out in the configuration file.

B.

The search entry in the /etc/resolv.conf file is incorrect.

C.

Wired connection 1 is offline.

D.

No default route is defined.

Question 4

Which of the following is a benefit of a service mesh?

Options:

A.

Encrypted communication between two services in a Kubernetes environment

B.

Direct access to the Kubernetes API services through the use of tokens

C.

Elevated privileges in a Kubernetes pod to allow root access in a hardened cluster

D.

Creating PVCs in a Kubernetes cluster to store and manage persistent data

Question 5

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).

Options:

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

Question 6

An administrator created an initial Git repository and uploaded the first files. The administrator sees the following when listing the repository:

as

The administrator notices the file . DS STORE should not be included and deletes it from the online repository. Which of the following should the administrator run from the root of the local repository before the next commit to ensure the file is not uploaded again in future commits?

Options:

A.

rm -f .DS STORE && git push

B.

git fetch && git checkout .DS STORE

C.

rm -f .DS STORE && git rebase origin main

D.

echo .DS STORE >> .gitignore

Question 7

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"

}

Options:

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" }

Question 8

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.

as

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

Options:

A.

systemct1 isolate multi-user.target

B.

systemct1 isolate graphical.target

C.

systemct1 isolate network.target

D.

systemct1 isolate basic.target

Question 9

A cloud engineer wants to delete all unused networks that are not referenced by any container. Which of the following commands will achieve this goal?

Options:

A.

docker network erase

B.

docker network clear

C.

docker network prune

D.

docker network rm

Question 10

A Linux administrator needs to transfer a local file named accounts . pdf to a remote / tmp directory of a server with the IP address 10.10.10.80. Which of the following commands needs to be executed to transfer this file?

Options:

A.

rsync user@10.10.10.80: /tmp accounts.pdf

B.

scp accounts.pdf user@10.10.10.80:/tmp

C.

cp user@10.10.10. 80: /tmp accounts.pdf

D.

ssh accounts.pdf user@10.10.10.80: /tmp

Question 11

Which of the following commands should a technician use to create an administrative account for the username Joe?

Options:

A.

sudo useradd -G wheel joe

B.

sudo useradd joe; sudo passwd -l joe

C.

sudo useradd joe; sudo cat key.pem > ~/.ssh/authorized_keys

D.

sudo useradd joe; groupadd admin joe

Question 12

A Linux administrator is enabling root log-in over SSH on a server. Which of the following combinations of files and parameters should the administrator modify to accomplish this task?

Options:

A.

/etc/ssh/ssh_config - PermitRootLogin

B.

/etc/ssh/ssh_config - AllowRootLogin

C.

/etc/ssh/sshd_config - PermitRootLogin

D.

/etc/ssh/sshd_config - AllowRootLogin

Question 13

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?

Options:

A.

telinit 0

B.

systemct1 reboot

C.

systemct1 get-default

D.

systemct1 emergency

Question 14

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?

Options:

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

Question 15

A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command:

as

The following output is returned

as

Which of the following is MOST likely the issue?

Options:

A.

The service does not have permissions to read write the startupfile.

B.

The service startupfile size cannot be 81k.

C.

The service startupfile cannot be owned by root.

D.

The service startupfile should not be owned by the root group.

Question 16

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).

Options:

A.

ufw limit

B.

iptables —F

C.

systemct1 status firewalld

D.

firewall—cmd ——1ist—a11

E.

ufw status

F.

iptables —A

Question 17

At what point is the Internal Certificate Authority (ICA) created?

Options:

A.

During the primary Security Management Server installation process.

B.

Upon creation of a certificate.

C.

When an administrator decides to create one.

D.

When an administrator initially logs into SmartConsole.

Question 18

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?

Options:

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Question 19

An administrator accidentally installed the httpd RPM package along with several dependencies. Which of the following options is the best way for the administrator to revert the package installation?

Options:

A.

dnf clean all

B.

rpm -e httpd

C.

apt-get clean

D.

yum history undo last

Question 20

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?

Options:

A.

Docker

B.

On-premises systems

C.

Cloud-based systems

D.

Kubernetes

Question 21

An administrator started a long-running process in the foreground that needs to continue without interruption. Which of the following keystrokes should the administrator use to continue running the process in the background?

Options:

A.

bg

B.

bg

C.

jobs -1

D.

bg &

Question 22

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.)

Options:

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

Question 23

A systems administrator is checking the system logs. The administrator wants to look at the last 20 lines of a log. Which of the following will execute the command?

Options:

A.

tail -v 20

B.

tail -n 20

C.

tail -c 20

D.

tail -l 20

Question 24

Which of the following will prevent non-root SSH access to a Linux server?

Options:

A.

Creating the /etc/nologin file

B.

Creating the /etc/nologin.allow file containing only a single line root

C.

Creating the /etc/nologin/login.deny file containing a single line +all

D.

Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so

Question 25

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?

Options:

A.

ifconfig hw eth1

B.

netstat -r eth1

C.

ss -ti eth1

D.

ip link show eth1

Question 26

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the Is command. The

output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?

Options:

A.

su - Joe

B.

sudo Joe

C.

visudo Joe

D.

pkexec joe

Question 27

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

as

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

Options:

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.

Question 28

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

Options:

A.

Windows Management Instrumentation (WMI)

B.

Hypertext Transfer Protocol Secure (HTTPS)

C.

Lightweight Directory Access Protocol (LDAP)

D.

Remote Desktop Protocol (RDP)

Question 29

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:

as

Which of the following commands will BEST resolve this issue?

Options:

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

Question 30

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:

as

The local machine DNS settings are:

as

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

Options:

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

Question 31

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?

Options:

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

Question 32

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?

Options:

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

Question 33

A Linux administrator cloned an existing Linux server and built a new server from that clone. The administrator encountered the following error after booting the cloned server:

as

The administrator performed the commands listed below to further troubleshoot and mount the missing filesystem:

as

Which of the following should administrator use to resolve the device mismatch issue and mount the disk?

Options:

A.

mount disk by device-id

B.

fsck -A

C.

mount disk by-label

D.

mount disk by-blkid

Question 34

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:

as

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

Options:

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

Question 35

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?

Options:

A.

git branch —m staging

B.

git commit —m staging

C.

git status —b staging

D.

git checkout —b staging

Question 36

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?

Options:

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

Question 37

A Linux administrator is installing a web server and needs to check whether web traffic has already been allowed through the firewall. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

firewalld query-service-http

B.

firewall-cmd --check-service http

C.

firewall-cmd --query-service http

D.

firewalld --check-service http

Question 38

An administrator added the port 2222 for the SSH server on myhost and restarted the SSH server. The administrator noticed issues during the startup of the service. Given the following outputs:

as

Which of the following commands will fix the issue?

Options:

A.

semanage port -a -t ssh_port_t -p tcp 2222

B.

chcon system_u:object_r:ssh_home_t /etc/ssh/*

C.

iptables -A INPUT -p tcp -- dport 2222 -j ACCEPT

D.

firewall-cmd -- zone=public -- add-port=2222/tcp

Question 39

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?

Options:

A.

grub-install /dev/hda

B.

grub-install /dev/sda

C.

grub-install /dev/sr0

D.

grub-install /dev/hd0,0

Question 40

A systems administrator creates a public key for authentication. Which of the following tools is most suitable to use when uploading the key to the remote

servers?

Options:

A.

scp

B.

ssh-copy-id

C.

ssh-agent

D.

ssh-keyscan

Question 41

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

yaml

total used free shared buff/cache available

Mem: 3736 3538 33 2 48 25

Swap: 2047 1824 223

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

Options:

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

Question 42

A Linux administrator is troubleshooting a memory-related issue. Based on the output of the commands:

as

Which of the following commands would address the issue?

Options:

A.

top -p 8321

B.

kill -9 8321

C.

renice -10 8321

D.

free 8321

Question 43

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?

Options:

A.

$RHOST

B.

SETENV

C.

$SHELL

D.

$DISPLAY

Question 44

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?

Options:

A.

git reflog

B.

git pull

C.

git status

D.

git push

Question 45

After installing some RPM packages, a systems administrator discovers the last package that was installed was not needed. Which of the following commands can be used to remove the package?

Options:

A.

dnf remove packagename

B.

apt-get remove packagename

C.

rpm -i packagename

D.

apt remove packagename

Question 46

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?

Options:

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

Question 47

A systems administrator is adding a Linux-based server and removing a Windows-based server from a cloud-based environment. The changes need to be validated before they are applied to the cloud-based environment. Which of the following tools should be used to meet this requirement?

Options:

A.

Ansible

B.

git clone

C.

git pull

D.

terraform plan

Question 48

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?

Options:

A.

fetch

B.

checkout

C.

clone

D.

branch

Question 49

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?

Options:

A.

docker export

B.

docker info

C.

docker start

D.

docker inspect

Question 50

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?

Options:

A.

SQL

B.

YAML

C.

HTML

D.

JSON

Question 51

An administrator attempts to connect to a remote server by running the following command:

$ nmap 192.168.10.36

Starting Nmap 7.60 ( https://nmap.org ) at 2022-03-29 20:20 UTC

Nmap scan report for www1 (192.168.10.36)

Host is up (0.000091s latency).

Not shown: 979 closed ports

PORT STATE SERVICE

21/tcp open ftp

22/tcp filtered ssh

631/tcp open ipp

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds

Which of the following can be said about the remote server?

Options:

A.

A firewall is blocking access to the SSH server.

B.

The SSH server is not running on the remote server.

C.

The remote SSH server is using SSH protocol version 1.

D.

The SSH host key on the remote server has expired.

Question 52

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.)

Options:

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

Question 53

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

Options:

A.

TFTP

B.

SSH

C.

SCP

D.

SFTP

Question 54

A systems administrator was tasked with assigning the temporary IP address/netmask 192.168.168.1/255.255.255.255 to the interface eth0 of a Linux server.

When adding the address, the following error appears:

# ip address add 192.168.168.1/33 dev eth0

Error: any valid prefix is expected rather than "192.168.168.1/33".

Based on the command and its output above, which of the following is the cause of the issue?

Options:

A.

The CIDR value /33 should be /32 instead.

B.

There is no route to 192.168.168.1/33.

C.

The interface eth0 does not exist.

D.

The IP address 192.168.168.1 is already in use.

Question 55

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?

Options:

A.

chown root

startup.sh

B.

chmod 750 startup.sh

C.

chmod -x startup.sh

D.

chmod 400 startup.sh

Question 56

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?

Options:

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

Question 57

A developer wants to ensure that all files and folders created inside a shared folder named /GroupOODEV inherit the group name of the parent folder. Which of the following commands will help achieve this goal?

Options:

A.

chmod g+X / GroupOODEV/

B.

chmod g+W / GroupOODEV/

C.

chmod g+r / GroupOODEV/

D.

chmod g+s / GroupOODEV/

Question 58

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?

Options:

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

Question 59

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?

Options:

A.

/etc/passwd

B.

/etc/shadow

C.

/etc/sudoers

D.

/etc/bashrc

Question 60

A systems administrator wants to upgrade /bin/ someapp to a new version, but the administrator does not know the package name. Which of the following will

show the RPM package name that provides that binary file?

Options:

A.

rpm —qf /bin/ someapp

B.

rpm —Vv / bin/ someapp

C.

rpm - P / bin/ some app

D.

rpm —i / bin/ someapp

Question 61

Rugged appliances are small appliances with ruggedized hardware and like Quantum Spark appliance they use which operating system?

Options:

A.

Centos Linux

B.

Gaia embedded

C.

Gaia

D.

Red Hat Enterprise Linux version 5

Question 62

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?

Options:

A.

/etc/resolv.conf

B.

/etc/hosts

C.

/etc/sysconfig/network-scripts

D.

/etc/nsswitch.conf

Question 63

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

Options:

A.

systemct1 stop sshd

B.

systemct1 mask sshd

C.

systemct1 reload sshd

D.

systemct1 start sshd

Question 64

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 ( )

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?

Options:

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.

Question 65

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 /.

as

Options:

Question 66

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

as

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

Options:

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.

Question 67

A senior administrator has placed a private key for user admin in your home directory.

The server you need to remotely access is server1 and SSH is listening on port 2222.

INSTRUCTIONS

Part 1

Review the command output and build the correct command to place the private key

into your SSH folder.

Part 2

Review the command output and build the correct command to set the file

permissions.

Part 3

Review the command output and build the correct command to set the correct

ownership.

In each part, click on objects to build a complete command. Command objects may

be used more than once, but not all will be used. Use _ as the spacebar. Click the

arrow to remove any unwanted objects from your command.

Part 4

Select the proper file to edit for remote server access. Then, build the correct

configuration output based on the server name, ports, and files.

as

as

as

as

as

as

as

as

as

as

as

as

as

Options:

Question 68

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?

Options:

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.

Question 69

A Linux administrator is implementing a CI/CD process for the company’s internal accounting web application. Which of the following best defines the purpose of this process?

Options:

A.

To automate the process of building, testing, and deploying application components

B.

To perform security penetration tests on deployed applications to identify vulnerabilities

C.

To formalize the approval process of application releases and configuration changes

D.

To leverage code to document the infrastructure, configurations, and dependencies

Question 70

A systems administrator needs to know the mail exchange (MX) record for the foo.com domain. Which of the following commands will accomplish this task?

Options:

A.

telnet mx foo.com

B.

dig mx foo.com

C.

nslookup mx foo.com

D.

host mx foo.com

Question 71

A cloud engineer is installing packages during VM provisioning. Which of the following should the engineer use to accomplish this task?

Options:

A.

Cloud-init

B.

Bash

C.

Docker

D.

Sidecar

Question 72

The development team created a new branch with code changes that a Linux administrator needs to pull from the remote repository. When the administrator looks for the branch in Git, the branch in question is not visible. Which of the following commands should the Linux administrator run to refresh the branch information?

Options:

A.

git fetch

B.

git checkout

C.

git clone

D.

git branch

Question 73

The group owner of the / home/ test directory would like to preserve all group permissions on files created in the directory. Which of the following

commands should the group owner execute?

Options:

A.

chmod g+s /home/test

B.

chgrp test /home/test

C.

chmod 777 /home/test

D.

chown —hR test /home/test

Question 74

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?

Options:

A.

lsblk

B.

fdisk

C.

df -h

D.

du -ah

Question 75

A DevOps engineer pushed the updated configuration to an existing branch of a remote Git repository. Which of the following commands should the Linux administrator use to obtain these configuration changes?

Options:

A.

git pull

B.

git log

C.

git fetch

D.

git checkout main

Question 76

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

arduino

$ ls -ld /comptia

drwxr-x--- 2 root root 4096 Oct 20 20:13 /comptia

$ getfacl /comptia

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

Options:

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.

Question 77

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?

Options:

A.

docker pull nginx

B.

docker attach nginx

C.

docker commit nginx

D.

docker import nginx

Question 78

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).

Options:

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".

Question 79

A Linux administrator intends to start using KVM on a Linux server. Which of the following commands will allow the administrator to load the KVM module as

well as any related dependencies?

Options:

A.

modprobe kvm

B.

insmod kvm

C.

depmod kvm

D.

hotplug kvm

Question 80

An administrator needs to make an application change via a script that must be run only in console mode. Which of the following best represents the sequence the administrator should execute to accomplish this task?

Options:

A.

systemct1 isolate multi-user.target

sh script.sh

systemct1 isolate graphical.target

B.

systemct1 isolate graphical.target

sh script.sh

systemct1 isolate multi-user.target

C.

sh script.sh

systemct1 isolate multi-user.target

systemct1 isolate graphical.target

D.

systemct1 isolate multi-user.target

systemct1 isolate graphical.target

sh script.sh

Question 81

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

Options:

A.

nslookup

B.

rsynс

C.

netstat

D.

host

Question 82

A systems administrator is tasked with preventing logins from accounts other than root, while the file /etc/nologin exists. Which of the following PAM modules will accomplish this task?

Options:

A.

pam_login.so

B.

pam_access.so

C.

pam_logindef.so

D.

pam_nologin.so

Question 83

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

Options:

A.

LDAP

B.

MFA

C.

SSO

D.

PAM

Question 84

A Linux system is failing to boot with the following error:

as

Which of the following actions will resolve this issue? (Choose two.)

Options:

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.

Question 85

A Linux engineer needs to download a ZIP file and wants to set the nice of value to -10 for this new process. Which of the following commands will help to accomplish the task?

Options:

A.

$ nice -v -10 wget https://foo.com/installation.zip

B.

$ renice -v -10 wget https://foo.com/installation.2ip

C.

$ renice -10 wget https://foo.com/installation.zip

Question 86

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?

Options:

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

Question 87

A Linux administrator needs to determine if prerequisites are met. One of the application requirements is to install Perl on a system. Which of the following commands would accomplish this task?

Options:

A.

rpm -Ufperl

B.

rpm -ivperl

C.

rpm -qaperl

D.

rpm -ehperl

Question 88

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:

as

The administrator reviews the information below:

as

as

Which of the following is causing the connectivity issue?

Options:

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.

Question 89

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?

Options:

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

Question 90

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?

Options:

A.

B.

C.

D.

Question 91

A user reported issues when trying to log in to a Linux server. The following outputs were received:

Given the outputs above. which of the following is the reason the user is una-ble to log in to the server?

Options:

A.

User1 needs to set a long password.

B.

User1 is in the incorrect group.

C.

The user1 shell assignment incorrect.

D.

The user1 password is expired.

Question 92

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

Options:

A.

kill -1

B.

kill -3

C.

kill -15

D.

kill -HUP

E.

kill -TERM

Question 93

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?

Options:

A.

id_dsa.pem

B.

id_rsa

C.

id_ecdsa

D.

id_rsa.pub

Question 94

Which of the following enables administrators to configure and enforce MFA on a Linux system?

Options:

A.

Kerberos

B.

SELinux

C.

PAM

D.

PKI

Question 95

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).

Options:

A.

rmmod

B.

Is -11 /etc

C.

Ishw —class disk

D.

pvdisplay

E.

rmdir /dev

F.

dmesg

Question 96

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?

Options:

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

Question 97

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?

Options:

A.

chown -s 755 devops

B.

chown 1755 devops

C.

chmod -s 755 devops

D.

chmod 1755 devops

Question 98

A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?

Options:

A.

hostnamectl status --no-ask-password

B.

hostnamectl set-hostname "$(perl -le "print" "A" x 86)"

C.

hostnamectl set-hostname Comptia-WebNode -H root@192.168.2.14

D.

hostnamectl set-hostname Comptia-WebNode --transient

Question 99

A user is unable to log on to a Linux workstation. The systems administrator executes the following command:

cat /etc/shadow | grep user1

The command results in the following output:

user1 :! $6$QERgAsdvojadv4asdvaarC/9dj34GdafGVaregmkdsfa:18875:0:99999:7 :::

Which of the following should the systems administrator execute to fix the issue?

Options:

A.

chown -R userl:user1 /home/user1

B.

sed -i '/ ::: / :: /g' /etc/shadow

C.

chgrp user1:user1 /home/user1

D.

passwd -u user1

Question 100

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

as

The Linux server has the following system properties

CPU: 4 vCPU

Memory: 50GB

Which of the following accurately describes this situation?

Options:

A.

The system is under CPU pressure and will require additional vCPUs

B.

The system has been running for over a year and requires a reboot.

C.

Too many users are currently logged in to the system

D.

The system requires more memory

Question 101

A Linux administrator is configuring a log collector agent to monitor logs in /var/log/collector. The agent is reporting that it cannot write to the directory. The agent runs as the logger user account. The administrator runs a few commands and reviews the following output:

makefile

Output 1:

drwxr-xr-x. 1 root root 0 Oct 20:13 collector

Output 2:

file: /var/log/collector

owner: root

group: root

user::rwx

group::r-x

mask::rwx

other::r-x

Output 3:

uid=1010(logger) gid=1010(monitor) groups=1010(monitor)

Which of the following is the best way to resolve the issue?

Options:

A.

setfacl -Rm u:logger

/var/log/collector

B.

usermod -aG root logger

C.

chmod 644 /var/log/collector

D.

chown -R logger

/var/log

Question 102

A Linux administrator needs to connect securely to a remote server in order to install application software. Which of the following commands would allow this connection?

Options:

A.

scp "ABC-key.pem" root@10.0.0.1

B.

sftp rooteiO.0.0.1

C.

telnet 10.0.0.1 80

D.

ssh -i "ABC-key.pem" root@10.0.0.1

E.

sftp "ABC-key.pem" root@10.0.0.1

Question 103

A systems administrator needs to check if the service systemd-resolved.service is running without any errors. Which of the following commands will show this information?

Options:

A.

systemct1 status systemd-resolved.service

B.

systemct1 enable systemd-resolved.service

C.

systemct1 mask systemd-resolved.service

D.

systemct1 show systemd-resolved.service

Question 104

Which of the following is a function of a bootloader?

Options:

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.

Question 105

A systems administrator is trying to track down a rogue process that has a TCP listener on a network interface for remote command-and-control instructions.

Which of the following commands should the systems administrator use to generate a list of rogue process names? (Select two).

Options:

A.

netstat -antp | grep LISTEN

B.

lsof -iTCP | grep LISTEN

C.

lsof -i:22 | grep TCP

D.

netstat -a | grep TCP

E.

nmap -p1-65535 | grep -i tcp

F.

nmap -sS 0.0.0.0/0

Question 106

Joe, a user, is unable to log in to the Linux system. Given the following output:

as

Which of the following commands would resolve the issue?

Options:

A.

usermod -s /bin/bash joe

B.

pam_tally2 -u joe -r

C.

passwd -u joe

D.

chage -E 90 joe

Question 107

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?

Options:

A.

file filename

B.

touch filename

C.

grep filename

D.

lsof filename

Question 108

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?

Options:

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

Question 109

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?

Options:

A.

docker-compose inspect WEB

B.

dockerlogs WEB

C.

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

D.

dockerps WEB -f

Question 110

An administrator is troubleshooting a database service outage that was reported by a monitoring system. Given the following output:

$ systemctl status mariadb

Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Main process exited, code=killed, status=9/KILL

Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Failed with result 'signal'.

Oct 20 16:40:50 comptia systemd[1]: Stopped MariaDB 10.3 database server.

$ dmesg

[ 1061.491433] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom, task_memcg=/system.slice/mariadb.service, task=mysqld,pid=1981,uid=27

[ 1061.491453] Out of memory: Killed process 1981 (mysqld) total-vm:330668kB, anon-rss:31316kB, file-rss:OkB, shmem-rss:OkB, UID:27 pgtables:324kB oom_score_adj:0

Which of the following is the reason for the outage?

Options:

A.

The administrator sent a kill signal to the database

B.

The server is missing the DMA bus

C.

The database cannot write anything else to the storage

D.

The server does not have enough physical memory

Question 111

A Linux administrator needs to check extended permissions applied to the directory test. Which of the following commands should the administrator use to help with this task?

Options:

A.

getsebool test/

B.

getenforce test/

C.

getfacl test/

D.

ls -al test/

Question 112

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?

Options:

A.

renice —n —15 2274

B.

nice -15 2274

C.

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

D.

ps —ef I grep 2274

Page: 1 / 38
Total 376 questions