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

XK0-005 CompTIA Linux+ Exam Questions and Answers

Questions 4

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 5

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

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

Which of the following commands will help unlock the account?

Options:

A.

Pam_tally2 --user=dev2 —-quiet

B.

pam_ tally2 --user=dev2

C.

pam_tally2 -–user+dev2 —-quiet

D.

pam_tally2 --user=dev2 —-reset

Buy Now
Questions 6

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

Options:

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Buy Now
Questions 7

A systems administrator is cloning a system partition /dev/sda1 to /dev/sdc1. Which of the following commands would allow the administrator to accomplish this task most efficiently?

Options:

A.

dd if=/dev/sda1 of=/dev/sdc1

B.

cat /dev/sda1 > /dev/sdc1

C.

cp -R /dev/sda1 /dev/sdc1

D.

rsync -av /dev/sda1 /dev/sdc1

Buy Now
Questions 8

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 9

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

Buy Now
Questions 10

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

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 11

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 12

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 13

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

Options:

A.

tuned

B.

tune2fs

C.

tuned-adm

D.

turbostat

Buy Now
Questions 14

An administrator changed the default port of an SSH server to 2222 on myhost, and clients are not able to connect. The administrator runs some commands and receives the following output:

vbnet

Copy code

$ ssh -p 2222 myhost

ssh:connect to host myhost on port 2222: No route to host

Which of the following commands should be run on myhost?

Options:

A.

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

B.

firewall-cmd --zone=public --add-port=2222

C.

iptables --zone=public --add-service=ssh

D.

iptables --zone=public --add-port=2222

Buy Now
Questions 15

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?

Options:

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

Buy Now
Questions 16

A Linux administrator needs to expose port 9000 for a container to listen during runtime. The Linux administrator creates a Dockerfile with the following entries:

sql

FROM node:9-alpine

WORKDIR /usr/src/app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 9000

CMD ["npm", "start"]

Which of the following commands should the administrator use to accomplish this task? (Select two).

Options:

A.

docker build -t Test-Container

B.

docker tag Test-Container

C.

docker inspect Test-Container

D.

docker run -p 5000:80 Test-Container

E.

docker push Test-Container

F.

docker run -p 80:9000 Test-Container

Buy Now
Questions 17

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 18

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

Options:

A.

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

B.

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

C.

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

D.

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

E.

Install the sudo command using the unprivileged user’s account

F.

Add the user to the wheel group

Buy Now
Questions 19

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

Options:

A.

/etc/resolv.conf

B.

/etc/hosts

C.

/etc/sysconfig/network-scripts

D.

/etc/nsswitch.conf

Buy Now
Questions 20

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 21

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 22

A Linux administrator needs to create a new user named user02. However, user02 must be in a different home directory, which is under /comptia/projects. Which of the following commands will accomplish this task?

Options:

A.

useradd -d /comptia/projects user02

B.

useradd -m /comptia/projects user02

C.

useradd -b /comptia/projects user02

D.

useradd -s /comptia/projects user02

Buy Now
Questions 23

An administrator deployed a Linux server that is running a web application on port 6379/tcp.

SELinux is in enforcing mode based on organization policies.

The port is open on the firewall.

Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.

The administrator ran some commands that resulted in the following output:

Which of the following commands should be used to resolve the issue?

Options:

A.

semanage port -d -t http_port_t -p tcp 6379

B.

semanage port -a -t http_port_t -p tcp 6379

C.

semanage port -a http_port_t -p top 6379

D.

semanage port -l -t http_port_tcp 6379

Buy Now
Questions 24

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?

Options:

A.

SQL

B.

YAML

C.

HTML

D.

JSON

Buy Now
Questions 25

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

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

Options:

A.

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

B.

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

C.

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

D.

Restart the computer to enable the new service.

E.

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

F.

Shut down the computer to enable the new service.

Buy Now
Questions 26

A systems administrator wants to check for running containers. Which of the following commands can be used to show this information?

Options:

A.

docker pull

B.

docker stats

C.

docker ps

D.

docker list

Buy Now
Questions 27

A Linux administrator needs to check extended permissions applied to the directory test. Which of the following commands should the administrator use to help with this task?

Options:

A.

getsebool test/

B.

getenforce test/

C.

getfacl test/

D.

ls -al test/

Buy Now
Questions 28

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 29

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

Options:

A.

rmmod

B.

Is -11 /etc

C.

Ishw —class disk

D.

pvdisplay

E.

rmdir /dev

F.

dmesg

Buy Now
Questions 30

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 31

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

Buy Now
Questions 32

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?

Options:

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

Buy Now
Questions 33

A systems administrator needs to check if the service systemd-resolved.service is running without any errors. Which of the following commands will show this information?

Options:

A.

systemct1 status systemd-resolved.service

B.

systemct1 enable systemd-resolved.service

C.

systemct1 mask systemd-resolved.service

D.

systemct1 show systemd-resolved.service

Buy Now
Questions 34

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

Options:

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

Buy Now
Questions 35

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 36

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

Options:

A.

git pull

B.

git push

C.

git branch

D.

git tag

Buy Now
Questions 37

A Linux administrator is tasked with creating resources using containerization. When deciding how to create this type of deployment, the administrator identifies some key features, including portability, high availability, and scalability in production. Which of the following should the Linux administrator choose for the new design?

Options:

A.

Docker

B.

On-premises systems

C.

Cloud-based systems

D.

Kubernetes

Buy Now
Questions 38

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?

Options:

A.

vmstat

B.

strace

C.

htop

D.

lsof

Buy Now
Questions 39

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

Options:

A.

partprobe

vgcreate

lvextend

B.

lvcreate

fdisk

partprobe

C.

fdisk

partprobe

mkfs

D.

fdisk

pvcreate

vgextend

Buy Now
Questions 40

Which of the following paths stores the configuration files in a Linux filesystem?

Options:

A.

/proc

B.

/home

C.

/root

D.

/etc

Buy Now
Questions 41

An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct

version of this file?

Options:

A.

rpm -qa | grep kernel; uname -a

B.

yum -y update; shutdown -r now

C.

cat /etc/centos-release; rpm -Uvh --nodeps

D.

telinit 1; restorecon -Rv /boot

Buy Now
Questions 42

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

yaml

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

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

Average: 0 937242 32.39 0 63.21 32.39 app_prd

Average: 0 937245 44.97 0.31 51.57 45.28 app_prd

Average: 0 937244 23.62 0 63.55 28.62 app_prd

[root@comptia]# vmstat 1

procs memory swap io system cpu

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

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

[root@comptia]# free -m

total used free shared buff/cache available

Mem: 15533 5063 365 164 10104 9975

Swap: 7931 955 6976

Which of the following is causing the performance issue?

Options:

A.

The server does not have enough memory

B.

Too many processes are running on the server

C.

The server CPU is receiving too much load

D.

The server is swapping

Buy Now
Questions 43

A systems administrator wants to list all local account names and their respective UIDs. Which of the following commands will provide output containing this information?

Options:

A.

cut -c: -f3,1 /etc/passwd

B.

cut -d: -s2,3 /etc/passwd

C.

cut -d: -f1,3 /etc/passwd

D.

cut -n: -f1,2 /etc/passwd

Buy Now
Questions 44

A systems engineer is adding a new 1GB XFS filesystem that should be temporarily mounted under /ops/app. Which of the following is the correct list of commands to achieve this goal?

Options:

A.

B.

C.

D.

Buy Now
Questions 45

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 46

A DevOps engineer wants to allow the same Kubernetes container configurations to be deployed in development, testing, and production environments. A key requirement is that the containers should be configured so that developers do not have to statically configure custom, environment-specific locations. Which of the following should the engineer use to meet this requirement?

Options:

A.

Custom scheduler

B.

Node affinity

C.

Overlay network

D.

Ambassador container

Buy Now
Questions 47

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 48

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 49

A Linux engineer finds multiple failed login entries in the security log file for application users. The Linux engineer performs a security audit and discovers a security issue. Given the following:

# grep -iE '*www*|db' /etc/passwd

www-data:x:502:502:www-data:/var/www:/bin/bash

db:x: 505:505:db: /opt/db:/bin/bash

Which of the following commands would resolve the security issue?

Options:

A.

usermod -d /srv/www-data www-data && usermod -d /var/lib/db db

B.

passwd -u www-data && passwd -u db

C.

renice -n 1002 -u 502 && renice -n 1005 -u 505

D.

chsh -s /bin/false www-data && chsh -s /bin/false db

Buy Now
Questions 50

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

Buy Now
Questions 51

A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?

Options:

A.

chmod 775

B.

umask. 002

C.

chactr -Rv

D.

chown -cf

Buy Now
Questions 52

The MySQL database process that was running on a Linux server suddenly stopped, and the process was killed. Which of the following commands can help identify whether this issue was produced by the OOM killer?

Options:

A.

grep /proc/oom_score

B.

grep -ir "out of memory" /var/log

C.

cat /var/run/initramfs/overlayroot.log | grep "out of memory"

D.

cat /sys/block/loop0/events

Buy Now
Questions 53

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

Options:

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.

Buy Now
Questions 54

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

System Properties:

CPU: 4 vCPU

Memory: 40GB

Disk maximum IOPS: 690

Disk maximum throughput: 44Mbps | 44000Kbps

Based on the above output, which of the following BEST describes the root cause?

Options:

A.

The system has reached its maximum IOPS, causing the system to be slow.

B.

The system has reached its maximum permitted throughput, therefore iowait is increasing.

C.

The system is mostly idle, therefore the iowait is high.

D.

The system has a partitioned disk, which causes the IOPS to be doubled.

Buy Now
Questions 55

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

Buy Now
Questions 56

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 57

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 58

A systems administrator wants to test the route between IP address 10.0.2.15 and IP address 192.168.1.40. Which of the following commands will accomplish this task?

Options:

A.

route -e get to 192.168.1.40 from 10.0.2.15

B.

ip route get 192.163.1.40 from 10.0.2.15

C.

ip route 192.169.1.40 to 10.0.2.15

D.

route -n 192.168.1.40 from 10.0.2.15

Buy Now
Questions 59

Linux system users report that over the past few months, a server has stopped responding at least twice each day. Every time this happens, the users have to restart the server to recover it. A systems administrator diagnosing the issue collects the following outputs:

csharp

Output 1

[Tue Aug 31 16:36:42 2021] oom-killer invoked by java: gfp_mask=0x280da2 order=0, oom_score_adj=0

[Tue Aug 31 16:36:42 2021] java cpuset=/ mems_allowed=0

makefile

Output 2

[root@server]# free -m

total used free shared buff/cache available

Mem: 15819 15026 174 92 619 134

Swap: 0 0 0

Which of the following is the best permanent resolution for the system?

Options:

A.

More memory resources

B.

More CPU resources

C.

More network bandwidth

D.

Extended root filesystem

Buy Now
Questions 60

A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?

Options:

A.

systemct1 cancel nginx

B.

systemct1 disable nginx

C.

systemct1 mask nginx

D.

systemct1 stop nginx

Buy Now
Questions 61

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 62

A DevOps engineer needs to download a Git repository from https://git.company.com/admin/project.git. Which of the following commands will achieve this goal?

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 63

A Linux administrator is creating a user that can run the FTP service but cannot log in to the system. The administrator sets /bin/false as a login shell for the user. When the user tries to run the FTP service, it is rejected with an "invalid shell: /bin/false" message. Which of the following is the best way to resolve the issue?

Options:

A.

Change ownership of /bin/false to the FTP user

B.

Add /bin/false entry to the /etc/shells file

C.

Make /bin/false an executable file

D.

Change the user’s default shell to /bin/bash

Buy Now
Questions 64

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

Options:

A.

systemctl reload httpd

B.

systemctl restart httpd

C.

systemctl status httpd

D.

systemctl mask httpd

Buy Now
Questions 65

A systems administrator wants to delete app . conf from a Git repository. Which of the following commands will delete the file?

Options:

A.

git tag app. conf

B.

git commit app . conf

C.

git checkout app . conf

D.

git rm app. conf

Buy Now
Questions 66

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 67

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

Which of the following commands should the administrator use to terminate all of the identified processes?

Options:

A.

pkill -9 -f "upload*.sh"

B.

kill -9 "upload*.sh"

C.

killall -9 -upload*.sh"

D.

skill -9 "upload*.sh"

Buy Now
Questions 68

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

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 69

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 70

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 71

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 72

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

Options:

A.

systemctlstatus httpd

B.

systemctlmask httpd

C.

systemctlreload httpd

D.

systemctlrestart httpd

Buy Now
Questions 73

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 74

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

Buy Now
Questions 75

A systems administrator is tasked with preventing logins from accounts other than root, while the file /etc/nologin exists. Which of the following PAM modules will accomplish this task?

Options:

A.

pam_login.so

B.

pam_access.so

C.

pam_logindef.so

D.

pam_nologin.so

Buy Now
Questions 76

A Linux administrator copied a Git repository locally, created a feature branch, and committed some changes to the feature branch. Which of the following Git actions should the Linux administrator use to publish the changes to the main branch of the remote repository?

Options:

A.

rebase

B.

tag

C.

commit

D.

push

Buy Now
Questions 77

A systems administrator identifies multiple processes in a zombie state. Which of the following signals would be best for the administrator to send to the PPID?

Options:

A.

SIGTERM

B.

SIGHUP

C.

SIGQUIT

D.

SIGSTOP

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 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 80

Which of the following options describes the purpose of YAML?

Options:

A.

YAML is a binary format used to ensure data transfer in a non-human-readable format

B.

YAML is used for configuration files and data serialization in IaC tools in a human-readable format

C.

YAML is like HTML and is used to create web page structure content for web deployment

D.

YAML is designed for web development and has libraries for infrastructure automation

Buy Now
Questions 81

A systems administrator created a new directory with specific permissions. Given the following output:

# file: comptia

# owner: root

# group: root

user: : rwx

group :: r-x

other: :---

default:user :: rwx

default:group :: r-x

default:group:wheel: rwx

default:mask :: rwx

default:other ::-

Which of the following permissions are enforced on /comptia?

Options:

A.

Members of the wheel group can read files in /comptia.

B.

Newly created files in /comptia will have the sticky bit set.

C.

Other users can create files in /comptia.

D.

Only root can create files in /comptia.

Buy Now
Questions 82

A Linux administrator needs to create a symlink for /usr/local/bin/app-a, which was installed in /usr/local/share/app-a. Which of the following commands should the administrator use?

Options:

A.

In -s /usr/local/bin/app-a /usr/local/share/app-a

B.

mv -f /usr/local/share/app-a /usr/local/bin/app-a

C.

cp -f /usr/local/share/app-a /usr/local/bin/app-a

D.

rsync -a /usr/local/share/app-a /usr/local/bin/app-a

Buy Now
Questions 83

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 84

A Linux administrator logs in to a system and identifies that an important backup has been started. The backup process is consuming a considerable amount of CPU time but needs to continue. Which of the following should the administrator use to reduce the impact this process has on other services?

Options:

A.

renice -n 15 -p

B.

nice -n 15 -p

C.

renice -n -15 -p

D.

nice -n -15 -p

Buy Now
Questions 85

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
Questions 86

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

Options:

A.

sysctl

B.

ss

C.

mkinitrd

D.

lsof

Buy Now
Questions 87

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

Options:

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

Buy Now
Questions 88

Which of the following is a function of a bootloader?

Options:

A.

It initializes all the devices that are required to load the OS.

B.

It mounts the root filesystem that is required to load the OS.

C.

It helps to load the different kernels to initiate the OS startup process.

D.

It triggers the start of all the system services.

Buy Now
Questions 89

What is the main objective when using Application Control?

Options:

A.

To filter out specific content.

B.

To assist the firewall blade with handling traffic.

C.

To see what users are doing.

D.

Ensure security and privacy of information.

Buy Now
Questions 90

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

Buy Now
Questions 91

The development team created a new branch with code changes that a Linux administrator needs to pull from the remote repository. When the administrator looks for the branch in Git, the branch in question is not visible. Which of the following commands should the Linux administrator run to refresh the branch information?

Options:

A.

git fetch

B.

git checkout

C.

git clone

D.

git branch

Buy Now
Questions 92

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 93

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 94

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

arduino

Error: cannot open display:

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

Options:

A.

Disconnect from the SSH session and reconnect using the ssh -X command

B.

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

C.

Open port 6000 on the workstation and restart the firewalld service

D.

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

Buy Now
Questions 95

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 96

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=1s

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 97

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?

Options:

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.

Buy Now
Questions 98

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

[user@workstation ~]$ ssh admin@srv1

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

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

Error: cannot open display:

[admin@srv1 ~] $

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

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 99

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 100

The development team created a new branch with code changes that a Linux administrator needs to pull from the remote repository. When the administrator looks for the branch in Git, the branch in question is not visible. Which of the following commands should the Linux administrator run to refresh the branch information?

Options:

A.

git fetch

B.

git checkout

C.

git clone

D.

git branch

Buy Now
Questions 101

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

Options:

A.

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

B.

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

C.

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

D.

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

Buy Now
Questions 102

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?

Options:

A.

The administrator is not using a highly privileged account.

B.

The filesystem is mounted with the wrong options.

C.

SELinux file context is denying the ACL changes.

D.

File attributes are preventing file modification.

Buy Now
Questions 103

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 104

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

Buy Now
Questions 105

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

Options:

A.

LDAP

B.

MFA

C.

SSO

D.

PAM

Buy Now
Questions 106

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 107

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?

Options:

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

Buy Now
Questions 108

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

Buy Now
Questions 109

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 110

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 111

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

Options:

A.

unzip -v

B.

bzip2 -z

C.

gzip

D.

funzip

Buy Now
Questions 112

A Linux administrator is configuring a log collector agent to monitor logs in /var/log/collector. The agent is reporting that it cannot write to the directory. The agent runs as the logger user account. The administrator runs a few commands and reviews the following output:

makefile

Output 1:

drwxr-xr-x. 1 root root 0 Oct 20:13 collector

Output 2:

file: /var/log/collector

owner: root

group: root

user::rwx

group::r-x

mask::rwx

other::r-x

Output 3:

uid=1010(logger) gid=1010(monitor) groups=1010(monitor)

Which of the following is the best way to resolve the issue?

Options:

A.

setfacl -Rm u:logger

/var/log/collector

B.

usermod -aG root logger

C.

chmod 644 /var/log/collector

D.

chown -R logger

/var/log

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

XK0-005 PDF

$28  $80
XK0-005 Engine

XK0-005 Testing Engine

$33.25  $95
XK0-005 PDF + Engine

XK0-005 PDF + Testing Engine

$45.5  $130