Labour Day Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

CompTIA Linux+ Exam Question and Answers

CompTIA Linux+ Exam

Last Update May 1, 2024
Total Questions : 292

We are offering FREE XK0-005 CompTIA exam questions. All you do is to just go and sign up. Give your details, prepare XK0-005 free exam questions and then go for complete pool of CompTIA Linux+ Exam test questions that will help you more.

XK0-005 pdf

XK0-005 PDF

$35  $99.99
XK0-005 Engine

XK0-005 Testing Engine

$42  $119.99
XK0-005 PDF + Engine

XK0-005 PDF + Testing Engine

$56  $159.99
Questions 1

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

Discussion 0
Questions 2

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

Discussion 0
Questions 3

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

Discussion 0
Questions 4

An administrator thinks that a package was installed using a snap. Which of the following commands can the administrator use to verify this information?

Options:

A.  

snap list

B.  

snap find

C.  

snap install

D.  

snap try

Discussion 0
Questions 5

A user is asking the systems administrator for assistance with writing a script to verify whether a file exists. Given the following:

Which of the following commands should replace the string?

Options:

A.  

if [ -f "$filename" ]; then

B.  

if [ -d "$filename" ]; then

C.  

if [ -f "$filename" ] then

D.  

if [ -f "$filename" ]; while

Discussion 0
Questions 6

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

Discussion 0
Questions 7

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

Options:

A.  

/etc/named.conf.rpmnew

B.  

/etc/named.conf.rpmsave

C.  

/etc/named.conf

D.  

/etc/bind/bind.conf

Discussion 0
Questions 8

A technician just fixed a few issues in some code and is ready to deploy the code into production. Which of the following steps should the technician take next?

Options:

A.  

Create a new branch using git checkout.

B.  

Perform a git clone to pull main down.

C.  

Create a git pull request to merge into main.

D.  

Perform a git pull to update the local copy of the code.

Discussion 0
Questions 9

A Linux administrator is reviewing changes to a configuration file that includes the following section:

The Linux administrator is trying to select the appropriate syntax formatter to correct any issues with the configuration file. Which of the following should the syntax formatter support to meet this goal?

Options:

A.  

Markdown

B.  

XML

C.  

YAML

D.  

JSON

Discussion 0
Questions 10

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.

Discussion 0
Questions 11

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

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

Options:

A.  

chgrp -R 755 data/

B.  

chmod -R 777 data/

C.  

chattr -R -i data/

D.  

chown -R data/

Discussion 0
Questions 12

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

Discussion 0
Questions 13

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

Discussion 0
Questions 14

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

Discussion 0
Questions 15

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

Discussion 0
Questions 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.

Discussion 0
Questions 17

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

Discussion 0
Questions 18

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

Discussion 0
Questions 19

Which of the following data structures is written in JSON?

A)

B)

C)

D)

Options:

A.  

Option A

B.  

Option B

C.  

Option C

D.  

Option D

Discussion 0
Questions 20

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

Discussion 0
Questions 21

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

Discussion 0
Questions 22

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

Discussion 0
Questions 23

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

Discussion 0
Questions 24

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

Discussion 0
Questions 25

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

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

Discussion 0
Questions 26

A junior Linux administrator is tasked with installing an application. The installation guide states the application should only be installed in a run level 5 environment.

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

Options:

A.  

systemct1 isolate multi-user.target

B.  

systemct1 isolate graphical.target

C.  

systemct1 isolate network.target

D.  

systemct1 isolate basic.target

Discussion 0
Questions 27

An administrator has source code and needs to rebuild a kernel module. Which of the following command sequences is most commonly used to rebuild this

type of module?

Options:

A.  

./configure

make

make install

B.  

wget

gcc

cp

C.  

tar xvzf

build

cp

D.  

build

install

configure

Discussion 0
Questions 28

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 .

Discussion 0
Questions 29

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

Discussion 0
Questions 30

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

Discussion 0
Questions 31

A Linux administrator is troubleshooting an issue in which users are not able to access https://portal.comptia.org from a specific workstation. The

administrator runs a few commands and receives the following output:

Which of the following tasks should the administrator perform to resolve this issue?

Options:

A.  

Update the name server in resolv. conf to use an external DNS server.

B.  

Remove the entry for portal . comptia.org from the local hosts file.

C.  

Add a network route from the 10.10.10.0/24 to the 192.168.0.0/16.

D.  

Clear the local DNS cache on the workstation and rerun the host command.

Discussion 0
Questions 32

A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value?

Options:

A.  

/etc/host.conf

B.  

/etc/hostname

C.  

/etc/services

D.  

/etc/ssh/sshd_config

Discussion 0
Questions 33

A server is experiencing intermittent connection issues. Some connections to the Internet work as intended, but some fail as if there is no connectivity. The systems administrator inspects the server configuration:

Which of the following is MOST likely the cause of the issue?

Options:

A.  

An internal-only DNS server is configured.

B.  

The IP netmask is wrong for ens3.

C.  

Two default routes are configured.

D.  

The ARP table contains incorrect entries.

Discussion 0
Questions 34

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:

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.

Discussion 0
Questions 35

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.

Discussion 0
Questions 36

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/

Discussion 0
Questions 37

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

Discussion 0
Questions 38

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

Discussion 0
Questions 39

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

Options:

A.  

journalctl —rotate

journalctl --vacuum-time=ls

B.  

systemctl stop systemd-journald

systemctl start systemd-journald

C.  

rm -rf /var/log/journal

systemctl restart systemd-journald

D.  

pkill -HUP systemd-journald

systemctl restart systemd-journald

Discussion 0
Questions 40

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

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.

Discussion 0
Questions 41

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

Discussion 0
Questions 42

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

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

Discussion 0
Questions 43

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:

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

Discussion 0
Questions 44

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

Discussion 0
Questions 45

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

Which of the following is most likely causing the issue?

Options:

A.  

server 1 is not in the DNS.

B.  

sshd is running on a non-standard port.

C.  

sshd is not an active service.

D.  

serverl is using an incorrect IP address.

Discussion 0
Questions 46

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

Discussion 0
Questions 47

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

Discussion 0
Questions 48

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 —

Discussion 0
Questions 49

The development team wants to prevent a file from being modified by all users in a Linux system, including the root account. Which of the following commands can be used to accomplish this objective?

Options:

A.  

chmod / app/conf/file

B.  

setenforce / app/ conf/ file

C.  

chattr +i /app/conf/file

D.  

chmod 0000 /app/conf/file

Discussion 0
Questions 50

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

Discussion 0
Questions 51

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

Options:

A.  

iptables -F INPUT -j 192.168.10.50 -m DROP

B.  

iptables -A INPUT -s 192.168.10.30 -j DROP

C.  

iptables -i INPUT --ipv4 192.168.10.50 -z DROP

D.  

iptables -j INPUT 192.168.10.50 -p DROP

Discussion 0
Questions 52

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

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

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

Options:

A.  

The IP address 0.0.0.0 is not valid.

B.  

The application is listening on the loopback interface.

C.  

The application is listening on port 1234.

D.  

The application is not running.

Discussion 0
Questions 53

A systems administrator requires that all files that are created by the user named web have read-only permissions by the owner. Which of the following commands will satisfy this requirement?

Options:

A.  

chown web:web /home/web

B.  

chmod -R 400 /home/web

C.  

echo "umask 377" >> /home/web/.bashrc

D.  

setfacl read /home/web

Discussion 0
Questions 54

A Linux engineer needs to block an incoming connection from the IP address 2.2.2.2 to a secure shell server and ensure the originating IP address receives a response that a firewall is blocking the connection. Which of the following commands can be used to accomplish this task?

Options:

A.  

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j DROP

B.  

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j RETURN

C.  

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j REJECT

D.  

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j QUEUE

Discussion 0
Questions 55

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

Options:

A.  

Sync the mount units.

B.  

Mount the filesystem manually.

C.  

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

D.  

Remount all the missing filesystems

Discussion 0
Questions 56

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)

Discussion 0
Questions 57

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.

Discussion 0
Questions 58

Users report that connections to a MariaDB service are being closed unexpectedly. A systems administrator troubleshoots the issue and finds the following message in /var/log/messages:

Which of the following is causing the connection issue?

Options:

A.  

The process mysqld is using too many semaphores.

B.  

The server is running out of file descriptors.

C.  

Something is starving the server resources.

D.  

The amount of RAM allocated to the server is too high.

Discussion 0
Questions 59

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

Discussion 0
Questions 60

A systems administrator created a new Docker image called test. After building the image, the administrator forgot to version the release. Which of the following will allow the administrator to assign the v1 version to the image?

Options:

A.  

docker image save test test:v1

B.  

docker image build test:vl

C.  

docker image tag test test:vl

D.  

docker image version test:v1

Discussion 0
Questions 61

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

Discussion 0
Questions 62

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

Discussion 0
Questions 63

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

Discussion 0
Questions 64

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

Discussion 0
Questions 65

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

Discussion 0
Questions 66

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

Which of the following commands will BEST resolve this issue?

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

Discussion 0
Questions 67

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:

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

Discussion 0
Questions 68

Which of the following directories is the mount point in a UEFI system?

Options:

A.  

/sys/efi

B.  

/boot/efi

C.  

/efi

D.  

/etc/efi

Discussion 0
Questions 69

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

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

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

Discussion 0
Questions 70

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

Discussion 0
Questions 71

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.

Discussion 0
Questions 72

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

Discussion 0
Questions 73

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

Options:

A.  

parted

B.  

df

C.  

mount

D.  

du

E.  

fdisk

F.  

dd

G.  

ls

Discussion 0
Questions 74

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

Options:

A.  

wget

B.  

ssh-keygen

C.  

ssh-keyscan

D.  

ssh-copy-id

E.  

ftpd

F.  

scp

Discussion 0
Questions 75

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

Discussion 0
Questions 76

A systems technician is working on deploying several microservices to various RPM-based systems, some of which could run up to two hours. Which of the following commands will allow the technician to execute those services and continue deploying other microservices within the same terminal section?

Options:

A.  

gedit & disown

B.  

kill 9 %1

C.  

fg %1

D.  

bg %1 job name

Discussion 0
Questions 77

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

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

Options:

A.  

dmidecode -s system-version

B.  

lscpu

C.  

sysctl -a

D.  

cat /sys/device/system/cpu/possible

Discussion 0
Questions 78

An administrator would like to list all current containers, regardless of their running state. Which of the following commands would allow the administrator to accomplish this task?

Options:

A.  

docker ps -a

B.  

docker list

C.  

docker image ls

D.  

docker inspect image

Discussion 0
Questions 79

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

Discussion 0
Questions 80

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

Options:

A.  

tuned

B.  

tune2fs

C.  

tuned-adm

D.  

turbostat

Discussion 0
Questions 81

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

Discussion 0
Questions 82

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.

Discussion 0
Questions 83

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

Discussion 0
Questions 84

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

Options:

Discussion 0
Questions 85

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

Discussion 0
Questions 86

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

Options:

A.  

clone

B.  

gitxgnore

C.  

get

D.  

.ssh

Discussion 0
Questions 87

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

Discussion 0