Labour Day Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > CompTIA > Linux+ > XK0-005

XK0-005 CompTIA Linux+ Exam Question and Answers

Question # 4

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?

A.

docker rm --all

B.

docker rm $(docker ps -aq)

C.

docker images prune *

D.

docker rm --state exited

Full Access
Question # 5

A development team asks an engineer to guarantee the persistency of journal log files across system reboots. Which of the following commands would accomplish this task?

A.

grep -i auto /etc/systemd/journald.conf && systemct1 restart systemd-journald.service

B.

cat /etc/systemd/journald.conf | awk '(print $1,$3)'

C.

sed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/ˆ#//q' /etc/systemd/journald.conf

D.

journalctl --list-boots && systemct1 restart systemd-journald.service

Full Access
Question # 6

A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)

A.

Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.

B.

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

C.

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

D.

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

E.

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

F.

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

Full Access
Question # 7

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?

A.

systemctl mask httpd

B.

systemctl disable httpd

C.

systemctl stop httpd

D.

systemctl reload httpd

Full Access
Question # 8

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

A.

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

B.

sysctl -w net.ipv4.ip_forward=1

C.

firewall-cmd --enable ipv4_forwarding

D.

systemct1 start ipv4_forwarding

Full Access
Question # 9

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

A.

Kerberos

B.

SELinux

C.

PAM

D.

PKI

Full Access
Question # 10

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?

A.

git branch —m staging

B.

git commit —m staging

C.

git status —b staging

D.

git checkout —b staging

Full Access
Question # 11

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?

A.

if [ -f "$filename" ]; then

B.

if [ -d "$filename" ]; then

C.

if [ -f "$filename" ] then

D.

if [ -f "$filename" ]; while

Full Access
Question # 12

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?

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.

Full Access
Question # 13

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

A.

ss -pint

B.

tcpdump -nL

C.

netstat -pn

D.

lsof -It

Full Access
Question # 14

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.

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

A.

chattr +a /opt/app/logs

B.

chattr +d /opt/app/logs

C.

chattr +i /opt/app/logs

D.

chattr +c /opt/app/logs

Full Access
Question # 15

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

A.

Kubernetes

B.

Ansible

C.

Podman

D.

Terraform

Full Access
Question # 16

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?

A.

telinit 0

B.

systemct1 reboot

C.

systemct1 get-default

D.

systemct1 emergency

Full Access
Question # 17

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?

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.

Full Access
Question # 18

A systems administrator wants to list all local accounts in which the UID is greater than 500. Which of the following commands will give the correct

output?

A.

find /etc/passwd —size +500

B.

cut —d: fl / etc/ passwd > 500

C.

awk -F: ‘$3 > 500 {print $1}' /etc/passwd

D.

sed '/UID/' /etc/passwd < 500

Full Access
Question # 19

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?

A.

chown -s 755 devops

B.

chown 1755 devops

C.

chmod -s 755 devops

D.

chmod 1755 devops

Full Access
Question # 20

A Linux administrator is troubleshooting the root cause of a high CPU load and average.

Which of the following commands will permanently resolve the issue?

A.

renice -n -20 6295

B.

pstree -p 6295

C.

iostat -cy 1 5

D.

kill -9 6295

Full Access
Question # 21

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

Given the following analysis:

Which of the following is causing the error message?

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.

Full Access
Question # 22

A developer reported an incident involving the application configuration file /etc/httpd/conf/httpd.conf that is missing from the server. Which of the following identifies the RPM package that installed the configuration file?

A.

rpm -qf /etc/httpd/conf/httpd.conf

B.

rpm -ql /etc/httpd/conf/httpd.conf

C.

rpm —query /etc/httpd/conf/httpd.conf

D.

rpm -q /etc/httpd/conf/httpd.conf

Full Access
Question # 23

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

A.

systemct1 isolate multi-user.target

sh script.sh

systemct1 isolate graphical.target

B.

systemct1 isolate graphical.target

sh script.sh

systemct1 isolate multi-user.target

C.

sh script.sh

systemct1 isolate multi-user.target

systemct1 isolate graphical.target

D.

systemct1 isolate multi-user.target

systemct1 isolate graphical.target

sh script.sh

Full Access
Question # 24

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?

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

Full Access
Question # 25

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

A.

sysctl net.ipv4.ip_forward

B.

sysctl -w net.ipv4.ip_forward=1

C.

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

D.

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

E.

sysctl –p

F.

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

Full Access
Question # 26

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?

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

Full Access
Question # 27

A systems administrator made some changes in the ~/.bashrc file and added an alias command. When the administrator tried to use the alias command, it did not work. Which of the following should be executed FIRST?

A.

source ~/.bashrc

B.

read ~/.bashrc

C.

touch ~/.bashrc

D.

echo ~/.bashrc

Full Access
Question # 28

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

A.

rpm -Ufperl

B.

rpm -ivperl

C.

rpm -qaperl

D.

rpm -ehperl

Full Access
Question # 29

A Linux user reported the following error after trying to connect to the system remotely:

ssh: connect to host 10.0.1.10 port 22: Resource temporarily unavailable

The Linux systems administrator executed the following commands in the Linux system while trying to diagnose this issue:

Which of the following commands will resolve this issue?

A.

firewall-cmd --zone=public --permanent --add-service=22

B.

systemct1 enable firewalld; systemct1 restart firewalld

C.

firewall-cmd --zone=public --permanent --add-service=ssh

D.

firewall-cmd --zone=public --permanent --add-port=22/udp

Full Access
Question # 30

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

accomplish this task?

A.

renice —n —15 2274

B.

nice -15 2274

C.

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

D.

ps —ef I grep 2274

Full Access
Question # 31

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

A.

unzip -v

B.

bzip2 -z

C.

gzip

D.

funzip

Full Access
Question # 32

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

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

A.

Puppet

B.

Git

C.

Ansible

D.

Terraform

Full Access
Question # 33

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?

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Full Access
Question # 34

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?

A.

grub-install /dev/hda

B.

grub-install /dev/sda

C.

grub-install /dev/sr0

D.

grub-install /dev/hd0,0

Full Access
Question # 35

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?

A.

docker image load java:7

B.

docker image pull java:7

C.

docker image import java:7

D.

docker image build java:7

Full Access
Question # 36

A systems administrator configured firewall rules using firewalld. However, after the system is rebooted, the firewall rules are not present:

The systems administrator makes additional checks:

Which of the following is the reason the firewall rules are not active?

A.

iptables is conflicting with firewalld.

B.

The wrong system target is activated.

C.

FIREWALL_ARGS has no value assigned.

D.

The firewalld service is not enabled.

Full Access
Question # 37

A Linux administrator is tasked with moving files in a database server. The administrator must not overwrite any existing files. Which of the following commands would indicate that the file already exists?

A.

mv-ifilename/tmp/backup

B.

mv-bfilename/tmp/backup

C.

mv-nfilename/tmp/backup

D.

mv-ffilename/tmp/backup

Full Access
Question # 38

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?

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.

Full Access
Question # 39

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?

A.

nslookup

B.

route

C.

netstat

D.

ifconfig

Full Access
Question # 40

A systems administrator is tasked with creating an Ansible playbook to automate the installation of patches on several Linux systems. In which of the following languages should the playbook be written?

A.

SQL

B.

YAML

C.

HTML

D.

JSON

Full Access
Question # 41

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?

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.

Full Access
Question # 42

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

A.

Chef

B.

Puppet

C.

Jenkins

D.

Ansible

Full Access
Question # 43

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?

A.

pam_login.so

B.

pam_access.so

C.

pam_logindef.so

D.

pam_nologin.so

Full Access
Question # 44

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:

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

A.

vmstat

B.

strace

C.

htop

D.

lsof

Full Access
Question # 45

A junior systems administrator has just generated public and private authentication keys for passwordless login. Which of the following files will be moved to the remote servers?

A.

id_dsa.pem

B.

id_rsa

C.

id_ecdsa

D.

id_rsa.pub

Full Access
Question # 46

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?

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.

Full Access
Question # 47

The administrator comptia is not able to perform privileged functions on a newly deployed system. Given the following command outputs:

Which of the following is the reason that the administrator is unable to perform the assigned duties?

A.

The administrator needs a password reset.

B.

The administrator is not a part of the correct group.

C.

The administrator did not update the sudo database.

D.

The administrator's credentials need to be more complex.

Full Access
Question # 48

A Linux administrator wants to find out whether files from the wget package have been altered since they were installed. Which of the following commands will provide the correct information?

A.

rpm -i wget

B.

rpm -qf wget

C.

rpm -F wget

D.

rpm -V wget

Full Access
Question # 49

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?

A.

top -p 8321

B.

kill -9 8321

C.

renice -10 8321

D.

free 8321

Full Access
Question # 50

A non-privileged user is attempting to use commands that require elevated account permissions, but the commands are not successful. Which of the following most likely needs to be updated?

A.

/etc/passwd

B.

/etc/shadow

C.

/etc/sudoers

D.

/etc/bashrc

Full Access
Question # 51

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?

A.

git fetch

B.

git checkout

C.

git clone

D.

git branch

Full Access
Question # 52

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?

A.

/sbin/nologin

B.

/bin/ sh

C.

/sbin/ setenforce

D.

/bin/bash

Full Access
Question # 53

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

S Is -1 config

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

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

A.

chown :support config

B.

setfacl -m g:support:rw- config

C.

chmod 664 config

D.

chmod g+s config

Full Access
Question # 54

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?

A.

chgrp reet files

B.

chacl -R 644 files

C.

chown users files

D.

chmod -t files

Full Access
Question # 55

A Linux systems administrator is configuring a new filesystem that needs the capability to be mounted persistently across reboots. Which of the following commands will accomplish this task? (Choose two.)

A.

df -h /data

B.

mkfs.ext4 /dev/sdc1

C.

fsck /dev/sdc1

D.

fdisk -l /dev/sdc1

E.

echo "/data /dev/sdc1 ext4 defaults 0 0" >> /etc/fstab

F.

echo "/dev/sdc1 /data ext4 defaults 0 0" >> /etc/fstab

Full Access
Question # 56

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

A.

nslookup

B.

rsynс

C.

netstat

D.

host

Full Access
Question # 57

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

A.

dnf list and dnf remove last

B.

dnf remove and dnf check

C.

dnf info and dnf upgrade

D.

dnf history and dnf history undo last

Full Access
Question # 58

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?

A.

docker ps -a

B.

docker list

C.

docker image ls

D.

docker inspect image

Full Access
Question # 59

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

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

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

A.

The IP address 0.0.0.0 is not valid.

B.

The application is listening on the loopback interface.

C.

The application is listening on port 1234.

D.

The application is not running.

Full Access
Question # 60

A systems administrator is tasked with mounting a USB drive on a system. The USB drive has a single partition, and it has been mapped by the system to the device /dev/sdb. Which of the following commands will mount the USB to /media/usb?

A.

mount /dev/sdb1 /media/usb

B.

mount /dev/sdb0 /media/usb

C.

mount /dev/sdb /media/usb

D.

mount -t usb /dev/sdb1 /media/usb

Full Access
Question # 61

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?

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

Full Access
Question # 62

A systems administrator received a request to change a user's credentials. Which of the following commands will grant the request?

A.

sudo passwd

B.

sudo userde 1

C.

sudo chage

D.

sudo usermod

Full Access
Question # 63

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?

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.

Full Access
Question # 64

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

A.

LDAP

B.

MFA

C.

SSO

D.

PAM

Full Access
Question # 65

A Linux administrator is trying to start the database service on a Linux server but is not able to run it. The administrator executes a few commands and receives the following output:

Which of the following should the administrator run to resolve this issue? (Select two).

A.

systemctl unmask mariadb

B.

journalctl —g mariadb

C.

dnf reinstall mariadb

D.

systemctl start mariadb

E.

chkconfig mariadb on

F.

service mariadb reload

Full Access
Question # 66

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

A.

rmmod

B.

Is -11 /etc

C.

Ishw —class disk

D.

pvdisplay

E.

rmdir /dev

F.

dmesg

Full Access
Question # 67

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?

A.

systemctlstatus httpd

B.

systemctlmask httpd

C.

systemctlreload httpd

D.

systemctlrestart httpd

Full Access
Question # 68

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

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 69

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

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.

Full Access
Question # 70

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

A.

chmod 4744 dev_team.txt

B.

chmod 744 --setuid dev_team.txt

C.

chmod -c 744 dev_team.txt

D.

chmod -v 4744 --suid dev_team.txt

Full Access
Question # 71

A Linux administrator is providing a new Nginx image from the registry to local cache. Which of the following commands would allow this to happen?

A.

docker pull nginx

B.

docker attach nginx

C.

docker commit nginx

D.

docker import nginx

Full Access
Question # 72

A Linux administrator is adding a new configuration file to a Git repository. Which of the following describes the correct order of Git commands to accomplish the task successfully?

A.

pull -> push -> add -> checkout

B.

pull -> add -> commit -> push

C.

checkout -> push -> add -> pull

D.

pull -> add -> push -> commit

Full Access
Question # 73

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

A.

tuned

B.

tune2fs

C.

tuned-adm

D.

turbostat

Full Access
Question # 74

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?

A.

bg

B.

bg

C.

jobs -1

D.

bg &

Full Access
Question # 75

A file called testfile has both uppercase and lowercase letters:

$ cat testfile

ABCDEfgH

IJKLmnoPQ

abcdefgH

ijklLMNopq

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

this task?

A.

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

B.

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

C.

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

D.

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

Full Access
Question # 76

A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?

A.

docker run -ti app /bin/sh

B.

podman exec -ti app /bin/sh

C.

podman run -d app /bin/bash

D.

docker exec -d app /bin/bash

Full Access
Question # 77

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

A.

chmod g+X / GroupOODEV/

B.

chmod g+W / GroupOODEV/

C.

chmod g+r / GroupOODEV/

D.

chmod g+s / GroupOODEV/

Full Access
Question # 78

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?

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.

Full Access
Question # 79

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

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

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

A.

The checkdiskspace.timer unit should be enabled via systemct1.

B.

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

C.

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

D.

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

Full Access
Question # 80

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?

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.

Full Access
Question # 81

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

A.

ufw allow out dns

B.

systemct1 reload firewalld

C.

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

D.

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

Full Access
Question # 82

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

A.

/etc/resolv.conf

B.

/etc/hosts

C.

/etc/sysconfig/network-scripts

D.

/etc/nsswitch.conf

Full Access
Question # 83

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?

A.

chattr

B.

chgrp

C.

chage

D.

chcon

Full Access
Question # 84

A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users’ access will be disabled once the project is over. The expiration date should be 2021-09-30. Which of the following commands will accomplish this task?

A.

sudo useradd -e 2021-09-30 Project_user

B.

sudo useradd -c 2021-09-30 Project_user

C.

sudo modinfo -F 2021-09-30 Project_uses

D.

sudo useradd -m -d 2021-09-30 Project_user

Full Access
Question # 85

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

A.

/sys/efi

B.

/boot/efi

C.

/efi

D.

/etc/efi

Full Access
Question # 86

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?

A.

scp

B.

ssh-copy-id

C.

ssh-agent

D.

ssh-keyscan

Full Access
Question # 87

An application developer received a file with the following content:

##This is a sample Image ##

FROM ubuntu:18.04

MAINTAINER demohut@gtmail.com.hac

COPY . /app

RUN make /app

CMD python /app/app.py

RUN apt-get update

RUN apt-get install -y nginx

CMD ["echo","Image created"]

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

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

A.

docker build -t myimage:1.0 .

B.

docker build -t myimage: .

C.

docker build -t myimage-1.0 .

D.

docker build -i myimage:1.0 .

Full Access