Winter Special Sale Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 713PS592

XK0-005 CompTIA Linux+ Exam Questions and Answers

Questions 4

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 5

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 6

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 7

Which of the following technologies provides load balancing, encryption, and observability in containerized environments?

Options:

A.

Virtual private network

B.

Sidecar pod

C.

Overlay network

D.

Service mesh

Buy Now
Questions 8

Based on an organization’s new cybersecurity policies, an administrator has been instructed to ensure that, by default, all new users and groups that are created fall within the specified values below.

XK0-005 Question 8

To which of the following configuration files will the required changes need to be made?

Options:

A.

/etc/login.defs

B.

/etc/security/limits.conf

C.

/etc/default/useradd

D.

/etc/profile

Buy Now
Questions 9

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 10

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 11

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

XK0-005 Question 11

Which of the following commands will permanently resolve the issue?

Options:

A.

renice -n -20 6295

B.

pstree -p 6295

C.

iostat -cy 1 5

D.

kill -9 6295

Buy Now
Questions 12

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 13

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 14

A new application container was built with an incorrect version number. Which of the following commands should be used to rename the image to match the correct version 2.1.2?

Options:

A.

docker tag comptia/app:2.1.1 comptia/app:2.1.2

B.

docker push comptia/app:2.1.1 comptia/app:2.1.2

C.

docker rmi comptia/app:2.1.1 comptia/app:2.1.2

D.

docker update comptia/app:2.1.1 comptia/app:2.1.2

Buy Now
Questions 15

A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?

Options:

A.

visudo -c

B.

test -f /etc/sudoers

C.

sudo vi check

D.

cat /etc/sudoers | tee test

Buy Now
Questions 16

A systems administrator is adding a Linux-based server and removing a Windows-based server from a cloud-based environment. The changes need to be validated before they are applied to the cloud-based environment. Which of the following tools should be used to meet this requirement?

Options:

A.

Ansible

B.

git clone

C.

git pull

D.

terraform plan

Buy Now
Questions 17

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.

XK0-005 Question 17 Option 1

B.

17

C.

17

D.

17

Buy Now
Questions 18

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:

XK0-005 Question 18

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 19

A Linux administrator is configuring a two-node cluster and needs to be able to connect the nodes to each other using SSH keys from the root account. Which of the following commands will accomplish this task?

Options:

A.

[root@nodea ssh —i ~/ . ssh/±d rsa root@nodeb

B.

[root@nodea scp -i . ssh/id rsa root@nodeb

C.

[root@nodea ssh—copy-id —i .ssh/id rsa root@nodeb

D.

[root@nodea # ssh add -c ~/ . ssh/id rsa root@nodeb

E.

[root@nodea # ssh add -c ~/. ssh/id rsa root@nodeb

Buy Now
Questions 20

A Linux administrator needs to harden a system and guarantee that the Postfix service will not run, even after a restart or system upgrade. Which of the following commands allows the administrator to fulfill the requirement?

Options:

A.

systemctl mask postfix.service

B.

systemctl disable postfix.service

C.

systemctl stop postfix.service

D.

systemctl -n restart postfix.service

Buy Now
Questions 21

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:

XK0-005 Question 21

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

XK0-005 Question 21

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 22

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 23

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 24

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 25

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

Options:

A.

docker pull nginx

B.

docker attach nginx

C.

docker commit nginx

D.

docker import nginx

Buy Now
Questions 26

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

Options:

A.

Renaming the root account to something else

B.

Removing unnecessary packages

C.

Changing the default shell to /bin/csh

D.

Disabling public key authentication

E.

Disabling the SSH root login possibility

F.

Changing the permissions on the root filesystem to 600

Buy Now
Questions 27

A Linux systems administrator is working to obtain the installed kernel version of several hundred systems. Which of the following utilities should the administrator use for this task?

Options:

A.

Ansible

B.

Git

C.

Docker

D.

Bash

Buy Now
Questions 28

A security analyst is monitoring the network to identify latency or slowdowns during a vulnerability scan. Which of the following functions will best achieve this?

bash

function x() {

info=$(ping -c 1 $1 | awk -F "/" 'END {print $5}')

echo "$1 | $info"

}

Options:

A.

function x() { info=$(dig $(dig -x $1 | grep ptr | tail -n 1 | awk -F ".in-addr" '{print $1}').origin.asn.cymru.com TXT +short); echo "$1 | $info" }

B.

function x() { info=$(ping -c 1 $1 | awk -F "/" 'END {print $5}'); echo "$1 | $info" }

C.

function x() { info=$(nc -m 40 $1 | awk 'END {print $1}'); echo "$1 | $info" }

D.

function x() { info=$(geoiplookup $1); echo "$1 | $info" }

Buy Now
Questions 29

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

XK0-005 Question 29

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 30

An administrator is troubleshooting a database service outage that was reported by a monitoring system. Given the following output:

$ systemctl status mariadb

Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Main process exited, code=killed, status=9/KILL

Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Failed with result 'signal'.

Oct 20 16:40:50 comptia systemd[1]: Stopped MariaDB 10.3 database server.

$ dmesg

[ 1061.491433] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom, task_memcg=/system.slice/mariadb.service, task=mysqld,pid=1981,uid=27

[ 1061.491453] Out of memory: Killed process 1981 (mysqld) total-vm:330668kB, anon-rss:31316kB, file-rss:OkB, shmem-rss:OkB, UID:27 pgtables:324kB oom_score_adj:0

Which of the following is the reason for the outage?

Options:

A.

The administrator sent a kill signal to the database

B.

The server is missing the DMA bus

C.

The database cannot write anything else to the storage

D.

The server does not have enough physical memory

Buy Now
Questions 31

A database administrator requested the installation of a custom database on one of the servers. Which of the following should the Linux administrator configure so the requested packages can be installed?

Options:

A.

/etc/yum.conf

B.

/etc/ssh/sshd.conf

C.

/etc/yum.repos.d/db.repo

D.

/etc/resolv.conf

Buy Now
Questions 32

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 33

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 34

A user (userA) has reported issues while logging in to the system. The following output has been provided:

bash

Could not chdir to home directory /home/userA: Permission denied

-bash: /home/userA/.bash_profile: Permission denied

# cat /etc/passwd | grep userA

userA:x:1234:3400:userA account:/home/userA/:/bin/bash

# passwd -S userA

userA PS 2022-10-17 1 99999 0 (Password set. SHA512 crypt.)

# groups userA

admin dev usergrp

# ls -lth /home/

drwx------ 7 root admin 9 Jan 17 2019 userA

drwxr-xr-x 4 userC app 9 Jan 23 2020 userC

Which of the following describes the issue userA is having?

Options:

A.

The password for userA is not set

B.

The group for userA is not assigned correctly

C.

The account password for userA has expired

D.

The assigned home directory is not owned by userA

Buy Now
Questions 35

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 36

Users have been unable to reach www.comptia.org from a Linux server. A systems administrator is troubleshooting the issue and does the following:

XK0-005 Question 36

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

Options:

A.

The name www.comptia.org does not point to a valid IP address.

B.

The server 192.168.168.53 is unreachable.

C.

No default route is set on the server.

D.

The network interface eth0 is disconnected.

Buy Now
Questions 37

A Linux administrator has installed a web server, a database server, and a web application on a server. The web application should be active in order to render the web pages. After the administrator restarts the server, the website displays the following message in the browser: Error establishing a database connection. The Linux administrator reviews the following relevant output from the systemd init files:

XK0-005 Question 37

The administrator needs to ensure that the database is available before the web application is started. Which of the following should the administrator add to the HTTP server .service file to accomplish this task?

Options:

A.

TRIGGERS=mariadb.service

B.

ONFAILURE=mariadb.service

C.

WANTEDBY=mariadb.service

D.

REQUIRES=mariadb.service

Buy Now
Questions 38

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 39

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 40

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

XK0-005 Question 40

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

XK0-005 Question 40

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 41

Several users reported that they were unable to write data to the /oracle1 directory. The following output has been provided:

XK0-005 Question 41

Which of the following commands should the administrator use to diagnose the issue?

Options:

A.

df -i /oracle1

B.

fdisk -1 /dev/sdb1

C.

lsblk /dev/sdb1

D.

du -sh /oracle1

Buy Now
Questions 42

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 43

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 44

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

Options:

A.

ssh -X user@server application

B.

ssh -y user@server application

C.

ssh user@server application

D.

ssh -D user@server application

Buy Now
Questions 45

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:

XK0-005 Question 45

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 46

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 47

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 48

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 49

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 50

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 51

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 52

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 53

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 54

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

Options:

A.

/etc/passwd

B.

/etc/shadow

C.

/etc/sudoers

D.

/etc/bashrc

Buy Now
Questions 55

The application team has reported latency issues that are causing the application to crash on the Linux server. The Linux administrator starts

troubleshooting and receives the following output:

XK0-005 Question 55

Which of the following commands will improve the latency issue?

Options:

A.

# echo 'net.core.net_backlog = 5000000' >> /etc/sysctl.conf

# sysctl -p

# systemctl daemon-reload

B.

# ifdown eth0

# ip link set dev eth0 mtu 800

# ifup eth0

C.

# systemctl stop network

# ethtool -g eth0 512

# systemctl start network

D.

# echo 'net.core.rmem max = 12500000' >> /etc/sysctl.conf

# echo 'net.core.wmem_max = 12500000' >> /etc/sysctl.conf

# sysctl -p

Buy Now
Questions 56

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 57

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 58

Joe, a user, is unable to log in to the system. The Linux administrator checks the /etc/passwd file and reviews the following output:

Joe:x:1002:1002::/home/Joe:/sbin/nologin

Which of the following should the administrator do to fix this issue?

Options:

A.

Remove the x entry in the /etc/passwd file for Joe

B.

Change the /sbin/nologin entry to /bin/sh for Joe

C.

Issue the usermod -l Joe command

D.

Ensure that a corresponding entry is in the /etc/shadow file for Joe

Buy Now
Questions 59

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the Is command. The

output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?

Options:

A.

su - Joe

B.

sudo Joe

C.

visudo Joe

D.

pkexec joe

Buy Now
Questions 60

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

Options:

A.

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

systemct1 enable cleanup

systemct1 is-enabled cleanup

B.

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

systemct1 enable cleanup

systemct1 is-enabled cleanup

C.

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

systemct1 enable cleanup

systemct1 is-enabled cleanup

D.

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

systemct1 enable cleanup

systemct1 is-enabled cleanup

Buy Now
Questions 61

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 62

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

XK0-005 Question 62

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

Options:

A.

systemct1 isolate multi-user.target

B.

systemct1 isolate graphical.target

C.

systemct1 isolate network.target

D.

systemct1 isolate basic.target

Buy Now
Questions 63

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 64

A systems administrator is installing various software packages using a pack-age manager. Which of the following commands would the administrator use on the Linux server to install the package?

Options:

A.

winget

B.

softwareupdate

C.

yum-config

D.

apt

Buy Now
Questions 65

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 66

A Linux administrator cloned an existing Linux server and built a new server from that clone. The administrator encountered the following error after booting the cloned server:

XK0-005 Question 66

The administrator performed the commands listed below to further troubleshoot and mount the missing filesystem:

XK0-005 Question 66

Which of the following should administrator use to resolve the device mismatch issue and mount the disk?

Options:

A.

mount disk by device-id

B.

fsck -A

C.

mount disk by-label

D.

mount disk by-blkid

Buy Now
Questions 67

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

XK0-005 Question 67

The systems administrator makes additional checks:

XK0-005 Question 67

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 68

A Linux administrator has logged in to a server for the first time and needs to know which services are allowed through the firewall. Which of the following options will return the results for which the administrator is looking?

Options:

A.

firewall-cmd —get-services

B.

firewall-cmd —check-config

C.

firewall-cmd —list-services

D.

systemct1 status firewalld

Buy Now
Questions 69

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

XK0-005 Question 69

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 70

A junior administrator is setting up a new Linux server that is intended to be used as a router at a remote site. Which of the following parameters will accomplish this goal?

Options:

A.

XK0-005 Question 70 Option 1

B.

70

C.

70

D.

70

Buy Now
Questions 71

While troubleshooting server issues, a Linux systems administrator obtains the following output:

[rootGhost ~]# totalfree -m usedfreesharedbuf f/cache available

Mem:373635988824829

Swap:20471824223

Which of the following best describes the state of the system?

Options:

A.

The system has consumed the system memory and swap space.

B.

The system has enough free memory space.

C.

The system has swap disabled.

D.

The system has allocated enough buffer space.

Buy Now
Questions 72

While troubleshooting server issues, a Linux systems administrator obtains the following output:

yaml

total used free shared buff/cache available

Mem: 3736 3538 33 2 48 25

Swap: 2047 1824 223

Which of the following best describes the state of the system?

Options:

A.

The system has consumed the system memory and swap space

B.

The system has enough free memory space

C.

The system has swap disabled

D.

The system has allocated enough buffer space

Buy Now
Questions 73

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 74

A systems administrator creates a public key for authentication. Which of the following tools is most suitable to use when uploading the key to the remote

servers?

Options:

A.

scp

B.

ssh-copy-id

C.

ssh-agent

D.

ssh-keyscan

Buy Now
Questions 75

User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?

Options:

A.

chown user2:accounting script.sh

chmod 750 script.sh

B.

chown user1:accounting script.sh

chmod 777 script.sh

C.

chown accounting:user1 script.sh

chmod 057 script.sh

D.

chown user2:accounting script.sh

chmod u+x script.sh

Buy Now
Questions 76

Using AD Query, the security gateway connections to the Active Directory Domain Controllers using what protocol?

Options:

A.

Windows Management Instrumentation (WMI)

B.

Hypertext Transfer Protocol Secure (HTTPS)

C.

Lightweight Directory Access Protocol (LDAP)

D.

Remote Desktop Protocol (RDP)

Buy Now
Questions 77

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 78

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 79

An administrator added the port 2222 for the SSH server on myhost and restarted the SSH server. The administrator noticed issues during the startup of the service. Given the following outputs:

XK0-005 Question 79

Which of the following commands will fix the issue?

Options:

A.

semanage port -a -t ssh_port_t -p tcp 2222

B.

chcon system_u:object_r:ssh_home_t /etc/ssh/*

C.

iptables -A INPUT -p tcp -- dport 2222 -j ACCEPT

D.

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

Buy Now
Questions 80

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 81

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 82

After installing some RPM packages, a systems administrator discovers the last package that was installed was not needed. Which of the following commands can be used to remove the package?

Options:

A.

dnf remove packagename

B.

apt-get remove packagename

C.

rpm -i packagename

D.

apt remove packagename

Buy Now
Questions 83

A systems administrator is customizing a new Linux server. Which of the following settings for umask would ensure that new files have the default permissions of -rw-r--r--?

Options:

A.

0017

B.

0027

C.

0038

D.

0640

Buy Now
Questions 84

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 85

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 86

A Linux systems administrator is troubleshooting an I/O latency on a single CPU server. The administrator runs a top command and receives the following output:

%Cpu(s): 0.2 us, 33.1 sy, 0.0 ni, 0.0 id, 52.4 wa, 0.0 hi, 0.2 si, 0.0 st

Which of the following is correct based on the output received from the exe-cuted command?

Options:

A.

The server's CPU is taking too long to process users' requests.

B.

The server's CPU shows a high idle-time value.

C.

The server's CPU is spending too much time waiting for data inputs.

D.

The server's CPU value for the time spent on system processes is low.

Buy Now
Questions 87

Which of the following commands is used to configure the default permissions for new files?

Options:

A.

setenforce

B.

sudo

C.

umask

D.

chmod

Buy Now
Questions 88

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

Options:

A.

~/.sshd/authkeys

B.

~/.ssh/keys

C.

~/.ssh/authorized_keys

D.

~/.ssh/keyauth

Buy Now
Questions 89

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

Options:

A.

docker-compose inspect WEB

B.

dockerlogs WEB

C.

dockerrun —nameWEB —volume/dev/stdout:/var/log/nginx/error.log

D.

dockerps WEB -f

Buy Now
Questions 90

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

XK0-005 Question 90

Which of the following commands would address the issue?

Options:

A.

top -p 8321

B.

kill -9 8321

C.

renice -10 8321

D.

free 8321

Buy Now
Questions 91

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

S Is -1 config

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

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

Options:

A.

chown :support config

B.

setfacl -m g:support:rw- config

C.

chmod 664 config

D.

chmod g+s config

Buy Now
Questions 92

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 93

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 94

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

XK0-005 Question 94

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 95

A systems administrator needs to verify whether the built container has the app.go file in its root directory. Which of the following can the administrator use to verify the root directory has this file?

Options:

A.

docker image inspect

B.

docker container inspect

C.

docker exec ls

D.

docker ps

Buy Now
Questions 96

A Linux administrator needs to remove all local firewall rules on a Linux system. Which of the following commands should the administrator run?

Options:

A.

iptables -D

B.

iptables -L

C.

iptables -F

D.

iptables -A

Buy Now
Questions 97

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 98

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

Options:

A.

docker image save test test:v1

B.

docker image build test:vl

C.

docker image tag test test:vl

D.

docker image version test:v1

Buy Now
Questions 99

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

Options:

A.

rpm -s

B.

rрm -d

C.

rpm -q

D.

rpm -e

Buy Now
Questions 100

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 101

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 102

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 103

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

XK0-005 Question 103

Which of the following is causing the connection issue?

Options:

A.

The process mysqld is using too many semaphores.

B.

The server is running out of file descriptors.

C.

Something is starving the server resources.

D.

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

Buy Now
Questions 104

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 105

A Linux administrator is enabling root log-in over SSH on a server. Which of the following combinations of files and parameters should the administrator modify to accomplish this task?

Options:

A.

/etc/ssh/ssh_config - PermitRootLogin

B.

/etc/ssh/ssh_config - AllowRootLogin

C.

/etc/ssh/sshd_config - PermitRootLogin

D.

/etc/ssh/sshd_config - AllowRootLogin

Buy Now
Questions 106

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 107

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

XK0-005 Question 107

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 108

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 109

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

XK0-005 Question 109

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 110

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

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

Options:

A.

Kubernetes

B.

Ansible

C.

Podman

D.

Terraform

Buy Now
Questions 112

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

Options:

A.

docker rm -- all

B.

docker rm $ (docker ps -aq)

C.

docker images prune *

D.

docker rm -- state exited

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

PDF + Testing Engine

$64  $159.99

Testing Engine

$48  $119.99
buy now XK0-005 testing engine

PDF (Q&A)

$40  $99.99
buy now XK0-005 pdf