Winter Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: netbudy65

XK0-005 CompTIA Linux+ Exam Questions and Answers

Questions 4

A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task?

Options:

A.

git reflog

B.

git pull

C.

git status

D.

git push

Buy Now
Questions 5

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?

Options:

A.

Puppet

B.

Git

C.

Ansible

D.

Terraform

Buy Now
Questions 6

A Linux administrator needs to create a new cloud.cpio archive containing all the files from the current directory. Which of the following commands can help to accomplish this task?

Options:

A.

ls | cpio -iv > cloud.epio

B.

ls | cpio -iv < cloud.epio

C.

ls | cpio -ov > cloud.cpio

D.

ls cpio -ov < cloud.cpio

Buy Now
Questions 7

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

Buy Now
Questions 8

An administrator is running a web server in a container named WEB, but none of the error output is showing. Which of the following should the administrator use to generate the errors on the container?

Options:

A.

docker-compose inspect WEB

B.

docker logs WEB

C.

docker run --name WEB --volume /dev/stdout:/var/log/nginx/error.log

D.

docker ps WEB -f

Buy Now
Questions 9

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

Buy Now
Questions 10

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

Buy Now
Questions 11

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

Buy Now
Questions 12

A Linux administrator has been tasked with installing the most recent versions of packages on a RPM-based OS. Which of the following commands will accomplish this task?

Options:

A.

apt-get upgrade

B.

rpm -a

C.

yum updateinfo

D.

dnf update

E.

yum check-update

Buy Now
Questions 13

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

Options:

A.

dnf list and dnf remove last

B.

dnf remove and dnf check

C.

dnf info and dnf upgrade

D.

dnf history and dnf history undo last

Buy Now
Questions 14

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

Buy Now
Questions 15

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.

Buy Now
Questions 16

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

Options:

A.

ping -c 50

B.

tcpdump -p 443

C.

mtr -T -P 443

D.

traceroute -p 443

Buy Now
Questions 17

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 —

Buy Now
Questions 18

Application code is stored in Git. Due to security concerns, the DevOps engineer does not want to keep a sensitive configuration file, app . conf, in the

repository. Which of the following should the engineer do to prevent the file from being uploaded to the repository?

Options:

A.

Run git exclude app. conf.

B.

Run git stash app. conf.

C.

Add app . conf to . exclude.

D.

Add app . conf to . gitignore.

Buy Now
Questions 19

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

Buy Now
Questions 20

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

Buy Now
Questions 21

A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

file filename

B.

touch filename

C.

grep filename

D.

lsof filename

Buy Now
Questions 22

A Linux administrator has defined a systemd script docker-repository.mount to mount a volume for use by the Docker service. The administrator wants to ensure that the Docker service does not start until the volume is mounted. Which of the following configurations needs to be added to the Docker service definition to best accomplish this task?

Options:

A.

After=docker-repository.mount

B.

ExecStart=/usr/bin/mount -a

C.

Requires=docker-repository.mount

D.

RequiresMountsFor=docker-repository.mount

Buy Now
Questions 23

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

Buy Now
Questions 24

A Linux systems administrator receives reports from various users that an application hosted on a server has stopped responding at similar times for several days in a row. The administrator logs in to the system and obtains the following output:

Output 1:

Output 2:

Output 3:

Which of the following should the administrator do to provide the BEST solution for the reported issue?

Options:

A.

Configure memory allocation policies during business hours and prevent the Java process from going into a zombie state while the server is idle.

B.

Configure a different nice value for the Java process to allow for more users and prevent the Java process from restarting during business hours.

C.

Configure more CPU cores to allow for the server to allocate more processing and prevent the Java process from consuming all of the available resources.

D.

Configure the swap space to allow for spikes in usage during peak hours and prevent the Java process from stopping due to a lack of memory.

Buy Now
Questions 25

A Linux administrator is troubleshooting a systemd mount unit file that is not working correctly. The file contains:

[root@system] # cat mydocs.mount

[Unit]

Description=Mount point for My Documents drive

[Mount]

What=/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34

Where=/home/user1/My Documents

Options=defaults

Type=xfs

[Install]

WantedBy=multi-user.target

The administrator verifies the drive UUID correct, and user1 confirms the drive should be mounted as My Documents in the home directory. Which of the following can the administrator

do to fix the issues with mounting the drive? (Select two).

Options:

A.

Rename the mount file to home-user1-My\x20Documents.mount.

B.

Rename the mount file to home-user1-my-documents.mount.

C.

Change the What entry to /dev/drv/disk/by-uuid/94afc9b2\-ac34\-ccff\-88ae\-297ab3c7ff34.

D.

Change the Where entry to Where=/home/user1/my\ documents.

E.

Change the Where entry to Where=/home/user1/My\x20Documents.

F.

Add quotes to the What and Where entries, such as What="/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34" and Where="/home/user1/My Documents".

Buy Now
Questions 26

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

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

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.

Buy Now
Questions 27

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

Options:

A.

xargs -f cat toDelete.txt -rm

B.

rm -d -r -f toDelete.txt

C.

cat toDelete.txt | rm -frd

D.

cat toDelete.txt | xargs rm -rf

Buy Now
Questions 28

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

Buy Now
Questions 29

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

Options:

A.

Creating the /etc/nologin file

B.

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

C.

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

D.

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

Buy Now
Questions 30

An organization's business office needs to collaborate on quarterly reports and asks the systems administrator to create a finance group. The administrator creates the following directory: drwxrwxr-x Business Business |j096 Oct 15 16:40 Q1

Which of the following commands will allow all members of the finance group to have group ownership of all files created in the Q1 directory while ensuring that members of the business group preserve access? (Select two).

Options:

A.

chmod g+s Q1/

B.

chmod u+s Q1/

C.

chmod a+x Q1/

D.

chown Finance Q1/

E.

chmod g+x Q1/

Buy Now
Questions 31

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

Options:

A.

TFTP

B.

SSH

C.

SCP

D.

SFTP

Buy Now
Questions 32

A systems administrator notices the process list on a mission-critical server has a large number of processes that are in state "Z" and marked as "defunct." Which of the following should the administrator do in an attempt to safely remove these entries from the process list?

Options:

A.

Kill the process with PID 1.

B.

Kill the PID of the processes.

C.

Kill the parent PID of the processes.

D.

Reboot the server.

Buy Now
Questions 33

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

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

Options:

A.

After=docker-respository.mount

B.

ExecStart=/usr/bin/mount -a

C.

Requires=docker-repository.mount

D.

RequiresMountsFor=docker-repository.mount

Buy Now
Questions 34

Which of the following directories contains binaries that only a root user should run?

Options:

A.

/sbin

B.

/bin

C.

/root

D.

/lib

Buy Now
Questions 35

A Linux administrator wants a permission bit on a shared folder that allows only the owner of the file within that directory or the root user to delete or rename the file. Which of the following commands will help achieve this goal?

Options:

A.

chmod u-w /directory/

B.

chmod a-r /directory/

C.

chmod o-t /directory/

D.

chmod +t /directory/

Buy Now
Questions 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:

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

Buy Now
Questions 37

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?

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

Buy Now
Questions 38

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

Buy Now
Questions 39

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

Buy Now
Questions 40

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?

Options:

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

Buy Now
Questions 41

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

Options:

A.

systemct1 isolate multi-user.target

sh script.sh

systemct1 isolate graphical.target

B.

systemct1 isolate graphical.target

sh script.sh

systemct1 isolate multi-user.target

C.

sh script.sh

systemct1 isolate multi-user.target

systemct1 isolate graphical.target

D.

systemct1 isolate multi-user.target

systemct1 isolate graphical.target

sh script.sh

Buy Now
Questions 42

An administrator wants to execute a long-running script in the terminal while troubleshooting another issue. Which of the following options will achieve this goal?

Options:

A.

bash script.sh &

B.

source script.sh

C.

sh script.sh | jobs

D.

nice -10 ./script.sh

Buy Now
Questions 43

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.

Buy Now
Questions 44

A Linux system is having issues. Given the following outputs:

# dig @192.168.2.2 mycomptiahost

; << >> DiG 9.9.4-RedHat-9.9.4-74.el7_6.1 << >> @192.168.2.2 mycomptiahost

; (1 server found)

;; global options: +cmd

;; connection timed out; no servers could be reached

# nc -v 192.168.2.2 53

Ncat: Version 7.70 ( https://nmap.org/ncat )

Ncat: Connection timed out.

# ping 192.168.2.2

PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.

64 bytes from 192.168.2.2: icmp_seq=1 ttl=117 time=4.94 ms

64 bytes from 192.168.2.2: icmp_seq=2 ttl=117 time=10.5 ms

Which of the following best describes this issue?

Options:

A.

The DNS host is down.

B.

The name mycomptiahost does not exist in the DNS.

C.

The Linux engineer is using the wrong DNS port.

D.

The DNS service is currently not available or the corresponding port is blocked.

Buy Now
Questions 45

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.

Buy Now
Questions 46

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

Buy Now
Questions 47

A systems administrator pressed Ctrl+Z after starting a program using the command line, and the shell prompt was presented. In order to go back to the program, which of the following commands can the administrator use?

Options:

A.

fg

B.

su

C.

bg

D.

ed

Buy Now
Questions 48

A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

Options:

A.

podman run -d -p 443:8443 httpd

B.

podman run -d -p 8443:443 httpd

C.

podman run –d -e 443:8443 httpd

D.

podman exec -p 8443:443 httpd

Buy Now
Questions 49

A Linux administrator encounters the following error in the Apache log files:

css

SQLSTATE[HY000] [2002] Permission denied

Which of the following commands should the administrator run to safely fix this issue?

Options:

A.

chcon -c httpd_sys_content_t /home/apache

B.

setsebool -F httpd_can_network_connect_db on

C.

setenforce 0

D.

touch /.autorelabel

Buy Now
Questions 50

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

Which of the following is causing the issue?

Options:

A.

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

B.

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

C.

Wired connection 1 is offline.

D.

No default route is defined.

Buy Now
Questions 51

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

Options:

A.

rpm -Ufperl

B.

rpm -ivperl

C.

rpm -qaperl

D.

rpm -ehperl

Buy Now
Questions 52

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?

Options:

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

Buy Now
Questions 53

A systems administrator is investigating a service that is not starting up. Given the following information:

Which of the following systemd commands should the administrator use in order to obtain more details about the failing service?

Options:

A.

systemct1 analyze network

B.

systemct1 info network

C.

sysctl -a network

D.

journalctl -xu network

Buy Now
Questions 54

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

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 55

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

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

Options:

A.

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

B.

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

C.

The network interface eth0 is using an old kernel module.

D.

The network interface cable is not connected to a switch.

Buy Now
Questions 56

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.

Buy Now
Questions 57

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

Options:

A.

git pull

B.

git log

C.

git fetch

D.

git checkout main

Buy Now
Questions 58

A Linux administrator needs to obtain a list of all volumes that are part of a volume group. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

vgs

B.

lvs

C.

fdisk -1

D.

pvs

Buy Now
Questions 59

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?

Options:

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

Buy Now
Questions 60

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

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

Options:

A.

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

B.

The ftpusers filesystem does not have enough space.

C.

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

D.

ftpusers is mounted as read only.

Buy Now
Questions 61

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

Options:

A.

Kerberos

B.

SELinux

C.

PAM

D.

PKI

Buy Now
Questions 62

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 .

Buy Now
Questions 63

Users are reporting that a Linux server is responding slowly. A systems administrator troubleshooting the server issue sees the following iostat output, with %iowait at 50.38. Which of the following is most likely the issue?

Options:

A.

The CPU is mostly waiting for I/O operations.

B.

/ filesystem does not have enough storage allocated.

C.

/var filesystem is almost full.

D.

The CPU capacity is inadequate.

Buy Now
Questions 64

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

Buy Now
Questions 65

A systems administrator needs to remove a disk from a Linux server. The disk size is 500G, and it is the only one that size on that machine. Which of the following commands can the

administrator use to find the corresponding device name?

Options:

A.

fdisk -V

B.

partprobe -a

C.

lsusb -t

D.

lsscsi -s

Buy Now
Questions 66

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.

Buy Now
Questions 67

An administrator would like to securely connect to a server and forward port 8080 on a local machine to port 80 on the server. Which of the following commands should the administrator use to satisfy both requirements?

Options:

A.

ssh —L 8080: localhost:80 admin@server

B.

ssh —R 8080: localhost:80 admin@server

C.

ssh —L 80 : localhost:8080 admin@server

D.

ssh —R 80 : localhost:8080 admin@server

Buy Now
Questions 68

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

Buy Now
Questions 69

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

Options:

A.

Isscsi

B.

fdisk

C.

blkid

D.

partprobe

Buy Now
Questions 70

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

Buy Now
Questions 71

A developer needs to launch an Nginx image container, name it Web001, and ex-pose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?

Options:

A.

docker exec —it -p 8080: 80 ——name Web001 nginx

B.

docker load -it -p 8080:80 ——name Web001 nginx

C.

docker run -it -P 8080:80 ——name Web001 nginx

D.

docker pull -it -p 8080:80 —name Web00l nginx

Buy Now
Questions 72

As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:

Add relevant content to /tmp/script.sh, so that it finds and compresses rotated files in /var/log without recursion.

INSTRUCTIONS

Fill the blanks to build a script that performs the actual compression of rotated log files.

If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.

Options:

Buy Now
Questions 73

A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a reposito-ry to share with the systems team. A junior Linux administrator needs to re-trieve the scripts and make them available on a local workstation. Which of the following Git commands should the junior Linux administrator use to accom-plish this task?

Options:

A.

fetch

B.

checkout

C.

clone

D.

branch

Buy Now
Questions 74

A systems administrator is troubleshooting a connectivity issue pertaining to access to a system named db.example.com. The system IP address should be 192.168.20.88. The administrator issues the dig command and receives the following output:

The administrator runs grep db.example.com /etc/hosts and receives the following output:

Given this scenario, which of the following should the administrator do to address this issue?

Options:

A.

Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.

B.

Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.

C.

Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.

D.

Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.

Buy Now
Questions 75

A junior systems administrator recently installed an HBA card in one of the servers that is deployed for a production environment. Which of the following

commands can the administrator use to confirm on which server the card was installed?

Options:

A.

lspci | egrep 'hba| fibr'

B.

lspci | zgrep 'hba | fibr'

C.

lspci | pgrep 'hba| fibr'

D.

lspci | 'hba | fibr'

Buy Now
Questions 76

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

Buy Now
Questions 77

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

Buy Now
Questions 78

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

Options:

A.

During the primary Security Management Server installation process.

B.

Upon creation of a certificate.

C.

When an administrator decides to create one.

D.

When an administrator initially logs into SmartConsole.

Buy Now
Questions 79

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

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

Options:

A.

kinit

B.

klist

C.

kexec

D.

kioad

E.

pkexec

F.

realm

Buy Now
Questions 80

A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?

Options:

A.

tar -cvzf /dev/sdd1 /dev/sdc1

B.

rsync /dev/sdc1 /dev/sdd1

C.

dd if=/dev/sdc1 of=/dev/sdd1

D.

scp /dev/sdc1 /dev/sdd1

Buy Now
Questions 81

A security team discovers that a web server has been running with elevated privileges and identifies it as a security violation. Which of the following items needs to be added to the webserver.service file to remediate the issue?

Options:

A.

In the [Service] section of the webserver.service file, add User=comptia.

B.

In the [Unit] section of the webserver.service file, add AllowIsolate=true.

C.

In the [Install] section of the webserver.service file, add WantedBy=single.target.

D.

Add After=network.target to the [Install] section of the webserver.service file.

Buy Now
Questions 82

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.

Buy Now
Questions 83

A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task:

Which of the following technologies is the administrator using?

Options:

A.

Ansible

B.

Puppet

C.

Chef

D.

Terraform

Buy Now
Questions 84

A network administrator issues the dig www.foo.com 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

Buy Now
Questions 85

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

Buy Now
Questions 86

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

Buy Now
Questions 87

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

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

Options:

A.

fsck.ext4 /dev/sda1

B.

partprobe /dev/sda1

C.

fdisk /dev/sda1

D.

mkfs.ext4 /dev/sda1

Buy Now
Questions 88

A cloud engineer needs to check the link status of a network interface named eth1 in a Linux server. Which of the following commands can help to achieve the goal?

Options:

A.

ifconfig hw eth1

B.

netstat -r eth1

C.

ss -ti eth1

D.

ip link show eth1

Buy Now
Questions 89

Users are reporting that a Linux server is responding slowly. A systems administrator troubleshooting the server issue sees the following:

# iostat -m 2

Linux 3.10.0-1160.66.1.el7.x86_64 (myhost) 10/19/2022 x86_64 (4 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle

24.30 0.01 0.29 50.38 4.00 19.01

Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn

sdd 15.65 0.48 0.83 4936250 8513501

# df -h

Filesystem Size Used Avail Use% Mounted on

devtmpfs 16G 0 16G 0% /dev

tmpfs 16G 64K 16G 1% /dev/shm

/dev/mapper/root 35G 8.8G 26G 26% /

/dev/sda2 497M 144M 354M 29% /boot

/dev/mapper/tmp 10G 38M 10G 1% /tmp

/dev/mapper/var 15G 13G 2.2G 86% /var

/dev/mapper/varlib 650G 397G 254G 62% /var/lib

/dev/mapper/varlog 15G 9.5G 5.5G 64% /var/log

/dev/mapper/varaudit 15G 72M 15G 1% /var/log/audit

Which of the following is most likely the issue?

Options:

A.

The CPU is mostly waiting for I/O operations.

B.

/ filesystem does not have enough storage allocated.

C.

/var filesystem is almost full.

D.

The CPU capacity is inadequate.

Buy Now
Questions 90

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

Buy Now
Questions 91

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.

Buy Now
Questions 92

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

Options:

A.

Configure a sidecar to perform log shipping

B.

Run docker exec to access the logs within the container

C.

Execute docker inspect and run a log rsync replication

D.

Set up a custom task scheduler via kubectl

Buy Now
Questions 93

A newly created container has been unable to start properly, and a Linux administrator is analyzing the cause of the failure. Which of the following will allow the administrator to determine the FIRST command that is executed inside the container right after it starts?

Options:

A.

docker export

B.

docker info

C.

docker start

D.

docker inspect

Buy Now
Questions 94

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

Buy Now
Questions 95

A systems administrator is configuring a Linux system so that 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 snasq-traffic eth0 -s 172.17.0.0/16 -j MASQUERADE

D.

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

Buy Now
Questions 96

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

well as any related dependencies?

Options:

A.

modprobe kvm

B.

insmod kvm

C.

depmod kvm

D.

hotplug kvm

Buy Now
Questions 97

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

Buy Now
Questions 98

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.

Buy Now
Questions 99

Which of the following commands is used to tune kernel parameters?

Options:

A.

sysctl

B.

ss

C.

mkinitrd

D.

lsof

Buy Now
Questions 100

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

go

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

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

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

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

css

Output 1

NAME FSTYPE UUID MOUNTPOINT

sda ext4 02ae47-fe457-45bc /

sdb xfs 347c7056 /var/www/html

Output 2

DocumentRoot "/var/www/html"

Output 3

httpd.service - The Apache HTTP Server

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

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

Main PID: 252 (httpd)

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

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 101

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/

Buy Now
Questions 102

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

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

Options:

A.

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

B.

Replace the failed drive and reconfigure the mirror.

C.

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

D.

Recreate the logical volume.

Buy Now
Questions 103

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

Buy Now
Questions 104

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

Options:

A.

dnf clean all

B.

rpm -e httpd

C.

apt-get clean

D.

yum history undo last

Buy Now
Questions 105

A systems administrator is receiving complaints about slow performance and system crashes. The administrator suspects memory and CPU issues. Which of the following is the first action the administrator should take to troubleshoot and resolve these issues?

Options:

A.

Run resource monitoring tools like top or htop to view the current CPU and memory use.

B.

Look through the system logs and error messages to find any faults involving the CPU and memory.

C.

Remove and replace the CPU and memory components to address hardware issues.

D.

Reboot the server to clear any CPU and memory congestion.

Buy Now
Questions 106

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

Buy Now
Questions 107

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

The systems administrator makes additional checks:

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

Options:

A.

iptables is conflicting with firewalld.

B.

The wrong system target is activated.

C.

FIREWALL_ARGS has no value assigned.

D.

The firewalld service is not enabled.

Buy Now
Questions 108

A junior administrator updated the PostgreSQL service unit file per the data-base administrator's recommendation. The service has been restarted, but changes have not been applied. Which of the following should the administrator run for the changes to take effect?

Options:

A.

Systemct1 get—default

B.

systemct1 daemon—reload

C.

systemct1 enable postgresq1

D.

systemct1 mask postgresq1

Buy Now
Questions 109

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.

Buy Now
Questions 110

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

Buy Now
Questions 111

A systems administrator is working on a security report from the Linux servers. Which of the following commands can the administrator use to display all the firewall rules applied to the Linux servers? (Select two).

Options:

A.

ufw limit

B.

iptables —F

C.

systemct1 status firewalld

D.

firewall—cmd ——1ist—a11

E.

ufw status

F.

iptables —A

Buy Now
Questions 112

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

Buy Now
Exam Code: XK0-005
Exam Name: CompTIA Linux+ Exam
Last Update: Nov 21, 2024
Questions: 376

PDF + Testing Engine

$140

Testing Engine

$105

PDF (Q&A)

$90