Labour Day Special Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

CompTIA XK0-005 CompTIA Linux+ Exam Exam Practice Test

Page: 1 / 29
Total 292 questions

CompTIA Linux+ Exam Questions and Answers

Question 1

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 2

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 3

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 4

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 5

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

Output 1:

* httpd.service = The Apache HTTPD Server

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

Active: inactive (dead)

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

Output 2:

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

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

Options:

A.

The httpd service is currently started.

B.

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

C.

The httpd service was manually stopped.

D.

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

E.

The httpd service runs without problems.

F.

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

Question 6

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

Options:

A.

docker builder -f —name web-01 httpd

B.

docker load --name web-01 httpd

C.

docker ps -a --name web-01 httpd

D.

docker run -d --name web-01 httpd

Question 7

Which of the following actions are considered good security practices when hardening a Linux server? (Select two).

Options:

A.

Renaming the root account to something else

B.

Removing unnecessary packages

C.

Changing the default shell to /bin/csh

D.

Disabling public key authentication

E.

Disabling the SSH root login possibility

F.

Changing the permissions on the root filesystem to 600

Question 8

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 9

A Linux engineer needs to create a custom script, cleanup.sh, to run at boot as part of the system services. Which of the following processes would accomplish this task?

Options:

A.

Create a unit file in the /etc/default/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

B.

Create a unit file in the /etc/ske1/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

C.

Create a unit file in the /etc/systemd/system/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

D.

Create a unit file in the /etc/sysctl.d/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

Question 10

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

S Is -1 config

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

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

Options:

A.

chown :support config

B.

setfacl -m g:support:rw- config

C.

chmod 664 config

D.

chmod g+s config

Question 11

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 12

An administrator is trying to diagnose a performance issue and is reviewing the following output:

Question # 12

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 13

A Linux administrator reviews a set of log output files and needs to identify files that contain any occurrence of the word denied. All log files containing entries in uppercase or lowercase letters should be included in the list. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

find . -type f -print | xrags grep -ln denied

B.

find . -type f -print | xrags grep -nv denied

C.

find . -type f -print | xrags grep -wL denied

D.

find . -type f -print | xrags grep -li denied

Question 14

A Linux system is failing to boot. The following error is displayed in the serial console:

[[1;33mDEPEND[Om] Dependency failed for /data.

[[1;33mDEPEND[Om] Dependency failed for Local File Systems

...

Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemct1 reboot" to reboot, "systemct1 default" to try again to boot into default mode.

Give root password for maintenance

(or type Control-D to continue}

Which of the following files will need to be modified for this server to be able to boot again?

Options:

A.

/etc/mtab

B.

/dev/sda

C.

/etc/fstab

D.

/ete/grub.conf

Question 15

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 16

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 17

An application developer received a file with the following content:

##This is a sample Image ##

FROM ubuntu:18.04

MAINTAINER demohut@gtmail.com.hac

COPY . /app

RUN make /app

CMD python /app/app.py

RUN apt-get update

RUN apt-get install -y nginx

CMD ["echo","Image created"]

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

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

Options:

A.

docker build -t myimage:1.0 .

B.

docker build -t myimage: .

C.

docker build -t myimage-1.0 .

D.

docker build -i myimage:1.0 .

Question 18

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 19

A systems administrator frequently connects to a remote host via SSH and a non-standard port. The systems administrator would like to avoid passing the port parameter on the command line every time. Which of the following files can be used to set a different port value for that host?

Options:

A.

/etc/ssh/sshd_config

B.

/etc/ssh/moduli

C.

~/.ssh/config

D.

~/.ssh/authorized_keys

Question 20

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

[user@workstation ~]$ ssh admin@srv1

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

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

Error: cannot open display:

[admin@srv1 ~] $

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

Options:

A.

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

B.

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

C.

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

D.

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

Question 21

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 22

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

Options:

A.

ufw allow out dns

B.

systemct1 reload firewalld

C.

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

D.

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

Question 23

A User on a Linux workstation needs to remotely start an application on a Linux server and then forward the graphical display of that application back to the Linux workstation. Which of the following would enable the user to perform this action?

Options:

A.

ssh -X user@server application

B.

ssh -y user@server application

C.

ssh user@server application

D.

ssh -D user@server application

Question 24

A Linux administrator is creating a primary partition on the replacement hard drive for an application server. Which of the following commands should the administrator issue to verify the device name of this partition?

Options:

A.

sudo fdisk /dev/sda

B.

sudo fdisk -s /dev/sda

C.

sudo fdisk -l

D.

sudo fdisk -h

Question 25

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

Options:

A.

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

B.

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

C.

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

D.

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

Question 26

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 27

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

Question 28

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

Options:

A.

docker rm -- all

B.

docker rm $ (docker ps -aq)

C.

docker images prune *

D.

docker rm -- state exited

Question 29

A systems administrator receives reports that several virtual machines in a host are responding slower than expected. Upon further investigation, the administrator obtains the following output from one of the affected systems:

Question # 29

Which of the following best explains the reported issue?

Options:

A.

The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines.

B.

The physical host has enough CPU cores, leading to users running more processes to compensate for the slower response times.

C.

The virtual machine has enough CPU cycles, leading to the system use percentage being higher than expected.

D.

The virtual machine is running out of CPU resources, leading to users experiencing longer response times.

Question 30

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

Options:

A.

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

B.

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

C.

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

D.

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

Question 31

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

Question # 31

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

Options:

A.

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

B.

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

C.

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

D.

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

Question 32

A Linux administrator created a new file system. Which of the following files must be updated to ensure the filesystem mounts at boot time?

Options:

A.

/etc/sysctl

B.

/etc/filesystems

C.

/etc/fstab

D.

/etc/nfsmount.conf

Question 33

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

Question # 33

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

Options:

A.

The system is running out of swap space.

B.

The CPU is overloaded.

C.

The memory is exhausted.

D.

The processes are paging.

Question 34

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

Options:

A.

docker cp container_id/deployment.yaml deployment.yaml

B.

docker cp container_id:/deployment.yaml deployment.yaml

C.

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

D.

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

Question 35

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

Options:

A.

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

B.

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

C.

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

D.

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

Question 36

Employees in the finance department are having trouble accessing the file /opt/work/file. All IT employees can read and write the file. Systems administrator reviews the following output:

Question # 36

Which of the following commands would permanently fix the access issue while limiting access to IT and finance department employees?

Options:

A.

chattr +i file

B.

chown it:finance file

C.

chmod 666 file

D.

setfacl -m g:finance:rw file

Question 37

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

Question # 37

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 38

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 39

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 40

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 41

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 42

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 43

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 44

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 45

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 46

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 47

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 48

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:

Question # 48

The administrator reviews the information below:

Question # 48

Question # 48

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 49

A developer has been unable to remove a particular data folder that a team no longer uses. The developer escalated the issue to the systems administrator. The following output was received:

Question # 49

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

Options:

A.

chgrp -R 755 data/

B.

chmod -R 777 data/

C.

chattr -R -i data/

D.

chown -R data/

Question 50

Due to performance issues on a server, a Linux administrator needs to terminate an unresponsive process. Which of the following commands should the administrator use to terminate the process immediately without waiting for a graceful shutdown?

Options:

A.

kill -SIGKILL 5545

B.

kill -SIGTERM 5545

C.

kill -SIGHUP 5545

D.

kill -SIGINT 5545

Question 51

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

Question # 51

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

Options:

A.

Puppet

B.

Git

C.

Ansible

D.

Terraform

Question 52

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 53

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

Question # 53

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

Question # 53

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 54

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 55

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 56

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 57

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

Options:

A.

rsyslog

B.

cp

C.

rsync

D.

reposync

E.

scp

F.

ssh

Question 58

When trying to log in remotely to a server, a user receives the following message:

Question # 58

The server administrator is investigating the issue on the server and receives the following outputs:

Question # 58

Which of the following is causing the issue?

Options:

A.

The wrong permissions are on the user’s home directory.

B.

The account was locked out due to three failed logins.

C.

The user entered the wrong password.

D.

The user has the wrong shell assigned to the account.

Question 59

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 60

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

Options:

A.

ip show

B.

ifcfg —a

C.

ifcfg —s

D.

i fname —s

Question 61

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 62

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 63

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 64

A systems administrator received a notification that a system is performing slowly. When running the top command, the systems administrator can see the following values:

Question # 64

Which of the following commands will the administrator most likely run NEXT?

Options:

A.

vmstat

B.

strace

C.

htop

D.

lsof

Question 65

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 66

A user created the following script file:

# ! /bin/bash

# FILENAME: /home/user/ script . sh

echo "hello world"

exit 1

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

order for the script to run properly?

Options:

A.

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

B.

chmod 600 /home/user/script . sh

C.

chmod /home/user/script . sh

D.

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

Question 67

Which of the following should be used to verify the integrity of a file?

Options:

A.

sha256sum

B.

fsck

C.

gpg —d

D.

hashcat

Question 68

A Linux administrator is trying to remove the ACL from the file /home/user/data. txt but receives the following error message:

Question # 68

Given the following analysis:

Question # 68

Which of the following is causing the error message?

Options:

A.

The administrator is not using a highly privileged account.

B.

The filesystem is mounted with the wrong options.

C.

SELinux file context is denying the ACL changes.

D.

File attributes are preventing file modification.

Question 69

A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries.

Question # 69

Which of the following commands would be BEST to use to accomplish this task?

Options:

A.

chattr +a /opt/app/logs

B.

chattr +d /opt/app/logs

C.

chattr +i /opt/app/logs

D.

chattr +c /opt/app/logs

Question 70

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 71

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 72

A junior administrator is trying to set up a passwordless SSH connection to one of the servers. The administrator follows the instructions and puts the key in the authorized_key file at the server, but the administrator is still asked to provide a password during the connection.

Given the following output:

Question # 72

Which of the following commands would resolve the issue and allow an SSH connection to be established without a password?

Options:

A.

restorecon -rv .ssh/authorized_key

B.

mv .ssh/authorized_key .ssh/authorized_keys

C.

systemct1 restart sshd.service

D.

chmod 600 mv .ssh/authorized_key

Question 73

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

Options:

A.

rpm -s

B.

rрm -d

C.

rpm -q

D.

rpm -e

Question 74

Which of the following would significantly help to reduce data loss if more than one drive fails at the same time?

Options:

A.

Server clustering

B.

Load balancing

C.

RAID

D.

VDI

Question 75

A Linux administrator is troubleshooting an SSHD issue on a server. Users are receiving error messages stating the connection is refused. Which of the following commands should be used to verify whether the service is listening?

Options:

A.

nslookup

B.

route

C.

netstat

D.

ifconfig

Question 76

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 77

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.

Question # 77

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 78

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 79

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 80

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

Question # 80

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 81

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

Options:

A.

partprobe

vgcreate

lvextend

B.

lvcreate

fdisk

partprobe

C.

fdisk

partprobe

mkfs

D.

fdisk

pvcreate

vgextend

Question 82

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

Options:

A.

~/.sshd/authkeys

B.

~/.ssh/keys

C.

~/.ssh/authorized_keys

D.

~/.ssh/keyauth

Question 83

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:

Question # 83

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 84

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 85

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 86

A file called testfile has both uppercase and lowercase letters:

$ cat testfile

ABCDEfgH

IJKLmnoPQ

abcdefgH

ijklLMNopq

A Linux administrator is tasked with converting testfile into all uppercase and writing it to a new file with the name uppercase. Which of the following commands will achieve

this task?

Options:

A.

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

B.

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

C.

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

D.

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

Question 87

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

Page: 1 / 29
Total 292 questions