Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70percent

CompTIA XK0-005 CompTIA Linux+ Exam Exam Practice Test

Demo: 112 questions
Total 376 questions

CompTIA Linux+ Exam Questions and Answers

Question 1

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

Options:

A.

git pull

B.

git push

C.

git branch

D.

git tag

Question 2

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

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

Which of the following commands will help unlock the account?

Options:

A.

Pam_tally2 --user=dev2 —-quiet

B.

pam_ tally2 --user=dev2

C.

pam_tally2 -–user+dev2 —-quiet

D.

pam_tally2 --user=dev2 —-reset

Question 3

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 4

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 5

One leg of an LVM-mirrored volume failed due to the underlying physical volume, and a systems administrator is troubleshooting the issue. The following output has been provided:

Given this scenario, which of the following should the administrator do to recover this volume?

Options:

A.

Reboot the server. The volume will automatically go back to linear mode.

B.

Replace the failed drive and reconfigure the mirror.

C.

Reboot the server. The volume will revert to stripe mode.

D.

Recreate the logical volume.

Question 6

A Linux user is trying to execute commands with sudo but is receiving the following error:

$ sudo visudo

>>> /etc/sudoers: syntax error near line 28 <<<

sudo: parse error in /etc/sudoers near line 28

sudo: no valid sudoers sources found, quitting

The following output is provided:

# grep root /etc/shadow

root :* LOCK *: 14600 ::::::

Which of the following actions will resolve this issue?

Options:

A.

Log in directly using the root account and comment out line 28 from /etc/sudoers.

B.

Boot the system in single user mode and comment out line 28 from /etc/sudoers.

C.

Comment out line 28 from /etc/sudoers and try to use sudo again.

D.

Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc/sudoers.

Question 7

A Linux administrator updated the configuration file for the httpd web service. The administrator needs to apply the updated changes to the service without interrupting any running sessions. Which of the following commands should the administrator run to accomplish this task?

Options:

A.

systemctl reload httpd

B.

systemctl restart httpd

C.

systemctl status httpd

D.

systemctl mask httpd

Question 8

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?

Options:

A.

apt-get upgrade

B.

rpm -a

C.

yum updateinfo

D.

dnf update

E.

yum check-update

Question 9

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

Options:

A.

chmod 755 filename.log

B.

chmod 640 filename.log

C.

chmod 740 filename.log

D.

chmod 744 filename.log

Question 10

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?

Options:

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.

Question 11

As part of the requirements for installing a new application, the swappiness parameter needs to be changed to O. This change needs to persist across re-boots and be applied immediately. A Linux systems administrator is performing this change. Which of the following steps should the administrator complete to accomplish this task?

Options:

A.

echo "vm. swappiness—()" >> /etc/sysctl . conf && sysctl —p

B.

echo "vrn. >> / proc/meminfo && sysctl —a

C.

sysctl —v >> / proc/meminfo & & echo "vm. swapiness=0"

D.

sysctl —h "vm. swapiness—O" && echo / etc/vmswapiness

Question 12

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

Options:

A.

git clone https://github.com/comptia/linux+-.git

git push origin

B.

git clone https://qithub.com/comptia/linux+-.git

git fetch New-Branch

C.

git clone https://github.com/comptia/linux+-.git

git status

D.

git clone https://github.com/comptia/linuxt+-.git

git checkout -b

Question 13

A diagnostic tool reports a "host seems down" event for a server with an IP address of 192.168.47.44. Which of the following commands should the administrator use to confirm the host down event?

Options:

A.

nmap 192.168.47.0/32

B.

netcat 192.168.47.44

C.

nmap 192.168.47.44 -Pn

D.

ping -c 1 192.168.47.44

Question 14

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 15

A systems administrator is customizing a new Linux server. Which of the following settings for umask would ensure that new files have the default permissions of -rw-r--r--?

Options:

A.

0017

B.

0027

C.

0038

D.

0640

Question 16

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 17

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 18

What is the main objective when using Application Control?

Options:

A.

To filter out specific content.

B.

To assist the firewall blade with handling traffic.

C.

To see what users are doing.

D.

Ensure security and privacy of information.

Question 19

A Linux administrator needs to ensure that Java 7 and Java 8 are both locally available for developers to use when deploying containers. Currently only Java 8 is available. Which of the following commands should the administrator run to ensure both versions are available?

Options:

A.

docker image load java:7

B.

docker image pull java:7

C.

docker image import java:7

D.

docker image build java:7

Question 20

A Linux administrator wants to prevent the httpd web service from being started both manually and automatically on a server. Which of the following should the administrator use to accomplish this task?

Options:

A.

systemctl mask httpd

B.

systemctl disable httpd

C.

systemctl stop httpd

D.

systemctl reload httpd

Question 21

A Linux administrator has defined a systemd script docker-repository.mount to mount a volume for use by the Docker service. The administrator wants to ensure that Docker

service does not start until the volume is mounted. Which of the following configurations needs to be added to the Docker service definition to best accomplish this task?

Options:

A.

After=docker-respository.mount

B.

ExecStart=/usr/bin/mount -a

C.

Requires=docker-repository.mount

D.

RequiresMountsFor=docker-repository.mount

Question 22

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?

Options:

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

Question 23

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 24

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?

Options:

A.

chgrp system accountname

B.

passwd –s accountname

C.

chmod -G system account name

D.

chage -E -1 accountname

Question 25

Which of the following tools is commonly used for creating CI/CD pipelines?

Options:

A.

Chef

B.

Puppet

C.

Jenkins

D.

Ansible

Question 26

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?

Options:

A.

/etc/yum.conf

B.

/etc/ssh/sshd.conf

C.

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

D.

/etc/resolv.conf

Question 27

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 28

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?

Options:

A.

git clone https://git.company.com/admin/project.git

B.

git checkout https://git.company.com/admin/project.git

C.

git pull https://git.company.com/admin/project.git

D.

git branch https://git.company.com/admin/project.git

Question 29

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

Options:

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

Question 30

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 31

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 32

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 33

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 34

Users in the human resources department are trying to access files in a newly created directory. Which of the following commands will allow the users access to the files?

Options:

A.

chattr

B.

chgrp

C.

chage

D.

chcon

Question 35

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 36

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

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

Options:

A.

accounting localhost=/opt/acc/report

B.

accounting ALL=/opt/acc/report

C.

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

D.

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

Question 37

An engineer needs to insert a character at the end of the current line in the vi text editor. Which of the following will allow the engineer to complete this task?

Options:

A.

p

B.

r

C.

bb

D.

A

E.

i

Question 38

A Linux administrator would like to measure possible packet loss between a workstation and a remote web application that is running on port 443. Which of the following would be the best command for the administrator to use to display this information?

Options:

A.

ping -c 50

B.

tcpdump -p 443

C.

mtr -T -P 443

D.

traceroute -p 443

Question 39

A systems administrator intends to use a UI-JID to mount a new partition per-manently on a Linux system. Which of the following commands can the adminis-trator run to obtain information about the UUlDs of all disks attached to a Linux system?

Options:

A.

fcstat

B.

blkid

C.

dmsetup

D.

Isscsi

Question 40

A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?

Options:

A.

scp ~/.ssh/id_rsa user@server:~/

B.

rsync ~ /.ssh/ user@server:~/

C.

ssh-add user server

D.

ssh-copy-id user@server

Question 41

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

Which of the following command would resolve the issue?

Options:

A.

usermod -s /bin/bash joe

B.

pam_tally2 -u joe -r

C.

passwd -u joe

D.

chage -E 90 joe

Question 42

A user (userA) has reported issues while logging in to the system. The following output has been provided:

bash

Could not chdir to home directory /home/userA: Permission denied

-bash: /home/userA/.bash_profile: Permission denied

# cat /etc/passwd | grep userA

userA:x:1234:3400:userA account:/home/userA/:/bin/bash

# passwd -S userA

userA PS 2022-10-17 1 99999 0 (Password set. SHA512 crypt.)

# groups userA

admin dev usergrp

# ls -lth /home/

drwx------ 7 root admin 9 Jan 17 2019 userA

drwxr-xr-x 4 userC app 9 Jan 23 2020 userC

Which of the following describes the issue userA is having?

Options:

A.

The password for userA is not set

B.

The group for userA is not assigned correctly

C.

The account password for userA has expired

D.

The assigned home directory is not owned by userA

Question 43

A user is cleaning up a directory because it has more than 100,000 files that were generated from an experiment. When the user tries to remove the unneeded experiment files, the user receives an error:

arduino

cannot execute [Argument list too long]

Which of the following should the user execute to remove these files?

Options:

A.

find . -name "experiment*.txt" -exec rm "{}" ;

B.

rm -rf experiment*.txt

C.

rm --force experiment*.txt

D.

for i in experiment*.txt; do find . -name $i -exec rmdir "{}" ; done

Question 44

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 45

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?

Options:

A.

useradd -d /comptia/projects user02

B.

useradd -m /comptia/projects user02

C.

useradd -b /comptia/projects user02

D.

useradd -s /comptia/projects user02

Question 46

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 47

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

Options:

A.

visudo -c

B.

test -f /etc/sudoers

C.

sudo vi check

D.

cat /etc/sudoers | tee test

Question 48

A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect?

Options:

A.

scp -p /data remote:/backup/data

B.

ssh -i /remote:/backup/ /data

C.

rsync -a /data remote:/backup/

D.

cp -r /data /remote/backup/

Question 49

A Linux administrator recently downloaded a software package that is currently in a compressed file. Which of the following commands will extract the files?

Options:

A.

unzip -v

B.

bzip2 -z

C.

gzip

D.

funzip

Question 50

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?

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 51

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 52

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

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 53

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?

Options:

A.

pkill -9 -f "upload*.sh"

B.

kill -9 "upload*.sh"

C.

killall -9 -upload*.sh"

D.

skill -9 "upload*.sh"

Question 54

After starting an Apache web server, the administrator receives the following error:

Apr 23 localhost.localdomain httpd 4618] : (98) Address already in use: AH00072: make_sock: could not bind to address [: :]80

Which of the following commands should the administrator use to further trou-bleshoot this issue?

Options:

A.

Ss

B.

Ip

C.

Dig

D.

Nc

Question 55

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 56

A Linux administrator has installed a web server, a database server, and a web application on a server. The web application should be active in order to render the web pages. After the administrator restarts the server, the website displays the following message in the browser: Error establishing a database connection. The Linux administrator reviews the following relevant output from the systemd init files:

The administrator needs to ensure that the database is available before the web application is started. Which of the following should the administrator add to the HTTP server .service file to accomplish this task?

Options:

A.

TRIGGERS=mariadb.service

B.

ONFAILURE=mariadb.service

C.

WANTEDBY=mariadb.service

D.

REQUIRES=mariadb.service

Question 57

A user is attempting to log in to a Linux server that has Kerberos SSO ena-bled. Which of the following commands should the user run to authenticate

and then show the ticket grants? (Select TWO).

Options:

A.

kinit

B.

klist

C.

kexec

D.

kioad

E.

pkexec

F.

realm

Question 58

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?

Options:

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.

Question 59

A hardened physical Linux system allows regular, unprivileged users to remotely connect to the server using SSH only. No sudo tool has been installed. Which of the following should the Linux administrator use to perform administrative tasks on this host? (Select two).

Options:

A.

Create an SSH key and copy it to the remote server to allow passwordless login

B.

Access the server’s physical console and use the root user's password to log in

C.

Install the telnet server on this system to be able to use a root account

D.

Use the su command and enter the root user’s password

E.

Install the sudo command using the unprivileged user’s account

F.

Add the user to the wheel group

Question 60

Users are reporting that writes on a system configured with SSD drives have been taking longer than expected, but reads do not seem to be affected. A Linux systems administrator is investigating this issue and working on a solution. Which of the following should the administrator do to help solve the issue?

Options:

A.

Run the corresponding command to trim the SSD drives.

B.

Use fsck on the filesystem hosted on the SSD drives.

C.

Migrate to high-density SSD drives for increased performance.

D.

Reduce the amount of files on the SSD drives.

Question 61

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 62

To harden one of the servers, an administrator needs to remove the possibility of remote administrative login via the SSH service. Which of the following should the administrator do?

Options:

A.

Add the line DenyUsers root to the /etc/hosts.deny file.

B.

Set PermitRootLogin to no in the /etc/ssh/sshd_config file.

C.

Add the line account required pam_nologin. so to the /etc/pam.d/sshd file.

D.

Set PubKeyAuthentication to no in the /etc/ssh/ssh_config file.

Question 63

A Linux administrator deployed a large-scale application service as a containerized pod. The Linux administrator needs to continually send the application's log file to the company’s central log store. Which of the following should the Linux administrator do to efficiently perform this task?

Options:

A.

Configure a sidecar to perform log shipping

B.

Run docker exec to access the logs within the container

C.

Execute docker inspect and run a log rsync replication

D.

Set up a custom task scheduler via kubectl

Question 64

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?

Options:

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

Question 65

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

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

Options:

A.

fsck.ext4 /dev/sda1

B.

partprobe /dev/sda1

C.

fdisk /dev/sda1

D.

mkfs.ext4 /dev/sda1

Question 66

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?

Options:

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

Question 67

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 68

A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:

Based on the output above, which of following is the MOST probable cause of the issue?

Options:

A.

The address ac:00:11:22:33:cd is not a valid Ethernet address.

B.

The Ethernet broadcast address should be ac:00:11:22:33:ff instead.

C.

The network interface eth0 is using an old kernel module.

D.

The network interface cable is not connected to a switch.

Question 69

An administrator attempts to rename a file on a server but receives the following error.

The administrator then runs a few commands and obtains the following output:

Which of the following commands should the administrator run NEXT to allow the file to be renamed by any user?

Options:

A.

chgrp reet files

B.

chacl -R 644 files

C.

chown users files

D.

chmod -t files

Question 70

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

bash

$ cd /app

$ touch file

touch: cannot touch 'file': Readonly file system

Output 2

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

Output 3

/dev/sdcl /app ext4 defaults 0 0

Output 4

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

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

Which of the following actions will resolve this issue?

Options:

A.

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

B.

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

C.

umount /app xfs_repair /dev/sdcl mount /app

D.

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

Question 71

Users are unable to create new files on the company's FTP server, and an administrator is troubleshooting the issue. The administrator runs the following commands:

Which of the following is the cause of the issue based on the output above?

Options:

A.

The users do not have the correct permissions to create files on the FTP server.

B.

The ftpusers filesystem does not have enough space.

C.

The inodes is at full capacity and would affect file creation for users.

D.

ftpusers is mounted as read only.

Question 72

A Linux systems administrator needs to compress a file named passwords.txt. The compressed file should be saved as passwords.txt.gz. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

gzip -c passwords.txt > passwords.txt.gz

B.

gzip -d passwords.txt | passwords.txt.gz

C.

gzip -n passwords.txt > passwords.txt.gz

D.

gzip -n passwords.txt < passwords.txt.gz

Question 73

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

Options:

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Question 74

A DevOps engineer needs to allow incoming traffic to ports in the range of 4000 to 5000 on a Linux server. Which of the following commands will enforce this rule?

Options:

A.

iptables -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT

B.

iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT

C.

iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT

D.

iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT

Question 75

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 76

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 77

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

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

Mem:373635988824829

Swap:20471824223

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

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 78

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 79

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

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

Options:

A.

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

B.

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

C.

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

D.

Restart the computer to enable the new service.

E.

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

F.

Shut down the computer to enable the new service.

Question 80

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

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

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 81

A new disk was presented to a server as /dev/ sdd. The systems administrator needs to check if a partition table is on that disk. Which of the following commands can show this information?

Options:

A.

Isscsi

B.

fdisk

C.

blkid

D.

partprobe

Question 82

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

Options:

A.

tuned

B.

tune2fs

C.

tuned-adm

D.

turbostat

Question 83

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 84

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.

Options:

Question 85

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?

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 86

An administrator is provisioning an Apache web server. When the administrator visits the server website, the browser displays a message indicating the website cannot be reached. Which of the following commands should the administrator use to verify whether the service Is running?

Options:

A.

systemctlstatus httpd

B.

systemctlmask httpd

C.

systemctlreload httpd

D.

systemctlrestart httpd

Question 87

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

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

Options:

A.

/sbin/nologin

B.

/bin/ sh

C.

/sbin/ setenforce

D.

/bin/bash

Question 88

An administrator installed an application from source into /opt/operations1/ and has received numerous reports that users are not able to access the application without having to use the full path /opt/operations1/bin/*. Which of the following commands should be used to resolve this issue?

Options:

A.

echo 'export PATH=$PATH:/opt/operations1/bin' >> /etc/profile

B.

echo 'export PATH=/opt/operations1/bin' >> /etc/profile

C.

echo 'export PATH=$PATH/opt/operations1/bin' >> /etc/profile

D.

echo 'export $PATH:/opt/operations1/bin' >> /etc/profile

Question 89

Users are reporting that a production application has slow performance. A systems administrator logs in to the server and performs some basic checks. Given the following:

yaml

[root@comptia]# ps -o pcpu; pidstat 1

Average: UID PID %usr %system %wait %CPU Command

Average: 0 937242 32.39 0 63.21 32.39 app_prd

Average: 0 937245 44.97 0.31 51.57 45.28 app_prd

Average: 0 937244 23.62 0 63.55 28.62 app_prd

[root@comptia]# vmstat 1

procs memory swap io system cpu

r b swpd free buff cache si so bi bo in cs us sy id wa st

16 0 978912 376320 50804 10296312 0 0 0 44 5503 2962 98 2 0 0 0

[root@comptia]# free -m

total used free shared buff/cache available

Mem: 15533 5063 365 164 10104 9975

Swap: 7931 955 6976

Which of the following is causing the performance issue?

Options:

A.

The server does not have enough memory

B.

Too many processes are running on the server

C.

The server CPU is receiving too much load

D.

The server is swapping

Question 90

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 91

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

Options:

A.

The checkdiskspace.service is not running.

B.

The checkdiskspace.service needs to be enabled.

C.

The OnCalendar schedule is incorrect in the timer definition.

D.

The system-daemon services need to be reloaded.

Question 92

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

Options:

A.

--name established

B.

-m recent

C.

-m conntrack

D.

--state

E.

--remove

F.

-j DROP

Question 93

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

Options:

A.

Kubernetes

B.

Ansible

C.

Podman

D.

Terraform

Question 94

A systems administrator receives the following errors via email from the system log:

go

XFS (loop0): Metadata CRC error detected at xfs_agi_read_verify+0xcb/0xfe

XFS (loop0): First 128 bytes of corrupted metadata buffer

XFS (loop0): metadata I/O error in "xfs_trans_read_buf_map" at daddr 0x2 len 1 error 74

A few minutes later, the administrator starts receiving reports that some of the images in the company's website are not loading properly. The systems administrator runs some commands and receives the following outputs:

css

Output 1

NAME FSTYPE UUID MOUNTPOINT

sda ext4 02ae47-fe457-45bc /

sdb xfs 347c7056 /var/www/html

Output 2

DocumentRoot "/var/www/html"

Output 3

httpd.service - The Apache HTTP Server

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

Active: active (running) since Sun 1991-05-24 16:12:43 UTC; 30y ago

Main PID: 252 (httpd)

Which of the following would be the appropriate steps to take to solve this issue?

Options:

A.

systemctl stop httpd umount /dev/sdb1 xfs_repair /dev/sdb1 mount /dev/sdb1 /var/www/html systemctl start httpd

B.

umount /dev/sdb1 xfs_repair /dev/sdb1 xfs_metadump /dev/sdb1 mount /dev/sdb1 /var/www/html systemctl restart httpd

C.

umount /dev/sdb1 systemctl stop httpd xfs_metadump /dev/sdb1 mount /dev/sdb1 /var/www/html systemctl start httpd

D.

systemctl stop httpd xfs_check -L /dev/sdb umount /var/www/html systemctl start httpd

Question 95

An administrator would like to mirror the website files on the primary web server, www1, to the backup web server, www2. Which of the following commands

should the administrator use to most efficiently accomplish this task?

Options:

A.

[wwwl ] rsync —a —e ssh /var/www/html/ user1@www2 : /var/www/html

B.

[ wwwl ] scp —r /var/www/html user1@www2 : / var/www/html

C.

[www2 ] cd /var/www/html; wget —m http: //wwwl/

D.

[wwwl ] cd /var/www/html && tar cvf —

Question 96

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 97

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 98

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?

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 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 Linux administrator is configuring network traffic forwarding. Despite having proper iptables rules, the traffic forwarding is not working. Which of the following commands will allow Linux to pass network traffic between different interfaces?

Options:

A.

nmcli allow-forwarding eth0

B.

echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf; sysctl -p

C.

ip route forward allow --all-interfaces; systemctl restart network

D.

modprobe ip_forward

Question 101

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?

Options:

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

Question 102

A Linux administrator created the directory /project/access2all. By creating this directory, the administrator is trying to avoid the deletion or modification of files from non-owners. Which of the following will accomplish this goal?

Options:

A.

chmod +t /project/access2all

B.

chmod +rws /project/access2all

C.

chmod 2770 /project/access2all

D.

chmod ugo+rwx /project/access2all

Question 103

Following the migration from a disaster recovery site, a systems administrator wants a server to require a user to change credentials at initial login. Which of the following commands should

be used to ensure the aging attribute?

Options:

A.

chage -d 2 user

B.

chage -d 0 user

C.

chage -E 0 user

D.

chage -d 1 user

Question 104

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

Options:

A.

systemctl restart networkd

B.

systemctl enable networkd

C.

systemctl status networkd

D.

systemctl isolate networkd

Question 105

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 106

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 107

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 108

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 109

A new application container was built with an incorrect version number. Which of the following commands should be used to rename the image to match the correct version 2.1.2?

Options:

A.

docker tag comptia/app:2.1.1 comptia/app:2.1.2

B.

docker push comptia/app:2.1.1 comptia/app:2.1.2

C.

docker rmi comptia/app:2.1.1 comptia/app:2.1.2

D.

docker update comptia/app:2.1.1 comptia/app:2.1.2

Question 110

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?

Options:

A.

rebase

B.

tag

C.

commit

D.

push

Question 111

A Linux administrator was tasked with deleting all files and directories with names that are contained in the sobelete.txt file. Which of the following commands will accomplish this task?

Options:

A.

xargs -f cat toDelete.txt -rm

B.

rm -d -r -f toDelete.txt

C.

cat toDelete.txt | rm -frd

D.

cat toDelete.txt | xargs rm -rf

Question 112

A systems administrator is creating new user accounts on several Linux machines and wants to automate the process from a Linux system used for operations. In this operations system, the list of servers is located in the /home/user/serverslist file and the list of user accounts is located in the /home/user/userslist file. Which of the following scripts will help accomplish this task?

Options:

A.

bash

for server in $(cat /home/user/serverslist)

do

for user in $(cat /home/user/userslist)

do

sudo useradd $user

done

done

B.

bash

for server in $(cat /home/user/serverslist)

do

ssh -i user@$server "for user in $(cat /home/user/userslist)

do

sudo useradd $user

done; exit"

done

C.

bash

for server in $(cat /home/user/serverslist)

do

scp /home/user/userslist user@$server:/tmp

ssh -i user@$server "for user in $(cat /tmp/userslist)

do

sudo useradd $user

done; exit"

done

D.

bash

ssh user@$(cat /home/user/serverslist) "sudo useradd $(cat /home/user/userslist); exit"

Demo: 112 questions
Total 376 questions