Pre-Summer Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Free and Premium CompTIA XK0-006 Dumps Questions Answers

Page: 1 / 11
Total 149 questions

CompTIA Linux+ V8 Exam Questions and Answers

Question 1

A Linux systems administrator is running an important maintenance task that consumes a large amount of CPU, causing other applications to slow. Which of the following actions should the administrator take to help alleviate the issue?

Options:

A.

Increase the available CPU time with pidstat.

B.

Lower the priority of the maintenance task with renice.

C.

Run the maintenance task with nohup.

D.

Execute the other applications with the bg utility.

Buy Now
Question 2

Which of the following Ansible components contains a list of hosts and host groups?

Options:

A.

Fact

B.

Inventory

C.

Playbook

D.

Collection

Question 3

A Linux administrator wants to make the enable_auth variable set to 1 and available to the environment of subsequently executed commands. Which of the following should the administrator use for this task?

Options:

A.

let ENABLE_AUTH=1

B.

ENABLE_AUTH=1

C.

ENABLE_AUTH=$(echo $ENABLE_AUTH)

D.

export ENABLE_AUTH=1

Question 4

Which of the following does dmesg display?

Options:

A.

Incorrect login attempts

B.

" Session closed " messages

C.

Window manager warnings

D.

USB device connections

Question 5

Users cannot access an application that is running inside containers. The administrator wants to validate whether the containers are running. Which of the following commands should the administrator use?

Options:

A.

docker start

B.

docker ps

C.

docker run

D.

docker images

Question 6

A Linux administrator observes low network throughput. The administrator gathers the following output:

$ ip link show eth0

eth0: < BROADCAST,MULTICAST,UP,RUNNING > mtu 9000 ...

$ ping -s 1472 -M do 192.168.10.2

PING 192.168.10.2(192.168.10.2) 1472(1500) bytes of data.

From 10.10.9.72 icmp_seq=1 frag needed and DF set

Which of the following is the cause of the low network throughput?

Options:

A.

Hardware limitations

B.

Driver issue

C.

Duplex configuration issue

D.

MTU mismatch

Question 7

The security manager at a company notifies a systems administrator of open vulnerabilities on the Linux system. The administrator receives the following information while logged in to the server:

$ date

Thu Jul 11 16:12:42 UTC 2024

$ getenforce

Enforcing

$ dnf history

ID | Command Line | Date and time | Action(s) | Altered

45 | update -y | 2023-07-09 | Update | 27

46 | install httpd | 2023-01-11 | Install | 9

47 | update -y | 2023-08-08 | Upgrade | 44

Which of the following is the most likely security concern?

Options:

A.

The server has not been updated in a year and should be patched.

B.

The system has httpd installed and needs to be removed.

C.

The system is configured to use UTC time and should be set to EDT.

D.

The system has SELinux set to enforcing and needs to be disabled.

Question 8

Which of the following can reduce the attack surface area in relation to Linux hardening?

Options:

A.

Customizing the log-in banner

B.

Reducing the number of directories created

C.

Extending the SSH startup timeout period

D.

Enforcing password strength and complexity

Question 9

After receiving a monitoring call, an administrator checks the Linux server for processes that have completed execution but have not been removed yet from the process table. Which of the following represents the process state for which the administrator should search?

Options:

A.

Z

B.

S

C.

D

D.

T

Question 10

A Linux user runs the following command:

nohup ping comptia.com &

Which of the following commands should the user execute to attach the process to the current terminal?

Options:

A.

renice

B.

jobs

C.

exec

D.

fg

Question 11

A systems administrator is having issues with a third-party API endpoint. The administrator receives the following output:

Which of the following actions should the administrator take to resolve the issue?

Options:

A.

Open a secure port in the server ' s firewall.

B.

Request a new API endpoint from a third party.

C.

Review and fix the DNS client configuration file.

D.

Enable internet connectivity on the host.

Question 12

A systems administrator troubleshoots a connectivity issue and needs to determine whether port 449 is open locally. Which of the following commands should the administrator use?

Options:

A.

ip link 449

B.

dig localhost:449

C.

tracepath localhost 449

D.

ss -an | grep 449

Question 13

A systems administrator is creating a new shared directory. Which of the following commands ensures all users from the same group will be able to work with the newly created files?

Options:

A.

chmod g+w /shared

B.

chmod g+s /shared

C.

chmod g+w /shared

D.

chmod g+x /shared

Question 14

A systems administrator is decommissioning a service. Which of the following commands should the administrator use to make sure users cannot start the service again?

Options:

A.

systemctl mask service

B.

systemctl kill service

C.

systemctl isolate service

D.

systemctl disable service

Question 15

A small group of remote users needs permission to run some administrative commands on a Linux server. Which of the following approaches is the best way to address this request?

Options:

A.

Set the sticky bit in all binaries requested for use by this group of users.

B.

Request a list of utilities they need to use with elevated privileges, and add the appropriate rules.

C.

Set the configuration parameter PermitRootLogin on sshd_config to " yes " and share the root password with this group of users.

D.

Create a Linux group, add the users, and configure this group on /etc/sudoers to use sudo, thus allowing them to switch to root user.

Question 16

An administrator added a new disk to expand the current storage. Which of the following commands should the administrator run first to add the new disk to the LVM?

Options:

A.

vgextend

B.

lvextend

C.

pvcreate

D.

pvresize

Question 17

A Linux administrator needs to create accounts for a list of new users. The user account names have been defined in the USER_LIST variable by executing the following:

USER_LIST= " alice bob charles "

Which of the following commands should the administrator use to successfully create the user accounts?

Options:

A.

echo " $USER_LIST " | while username; do useradd -m " $username " ; done

B.

echo " $USER_LIST " | until username; do useradd -m " $username " ; done

C.

select username in " $USER_LIST " ; do useradd -m " $username " ; done

D.

for username in $USER_LIST; do useradd -m " $username " ; done

Question 18

A Linux administrator notices that an application is having trouble connecting to an external database. Which of the following commands should the administrator use to validate the connection to the remote port exposed by a database server?

Options:

A.

dig MX db.comptia.org:3306

B.

nc -v db.comptia.org 3306

C.

arp -an | grep db.comptia.org | grep 3306

D.

ss -plant | grep 3306

Question 19

A Linux administrator attempts to unmount the local filesystem /data in order to mount a new volume. However, the administrator receives the following error message:

umount: /data: target is busy

Which of the following commands should the administrator run to resolve the issue?

Options:

A.

tree -g /data

B.

ls -ld /data

C.

stat -f /data

D.

fuser -mk /data

Question 20

The development team asks a Linux administrator to help diagnose a connectivity issue that is occurring with a newly developed software. The Linux administrator reviews the following output:

$ wget -vvv

Resolving proxy.comptia.org (proxy.comptia.org)... connected.

ERROR: The certificate of ' api.newapp.comptia.org ' is not trusted.

ERROR: The certificate of ' api.newapp.comptia.org ' does not have a known issuer.

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

Options:

A.

Verify the remote certificate is trustworthy, and add it to the local trusted certificates repository.

B.

Replace the remote certificate with a new self-signed CA and application certificate.

C.

Replace the expired CA certificate to permanently resolve the problem.

D.

Add option --no-check-certificate to wget command to permanently resolve the problem.

Question 21

Due to application compatibility issues, the Python 3 OpenSSL library should not be upgraded. Which of the following commands should the systems administrator use to ensure the package stays at the current version?

Options:

A.

dpkg --hold python3-openssl

B.

apt set-selections python3-openssl

C.

apt-mark hold python3-openssl

D.

echo " python3-openssl hold " | apt set-selections

Question 22

A Linux server is experiencing slowness. A systems administrator obtains the following output:

top - load average: 2.43, 1.80, 2.32

Tasks: ... 154 zombie

%Cpu(s): 6.2 us, 5.1 sy, 0.0 ni, 79.2 id, 9.1 wa, ...

$ iostat -m 2

%user %nice %system %iowait %steal %idle

4.30 2.02 0.29 70.38 4.00 19.01

Which of the following explains the issue?

Options:

A.

The system ran out of swap space.

B.

The CPU is overutilized.

C.

The storage I/O latency is high.

D.

The system needs to be patched.

Question 23

An administrator receives a report that a user is unable to execute the runreports utility. The administrator logs in as the user, runs the following commands, and receives the following output:

$ runreports

runreports: command not found

$ ls -l /usr/local/bin

-rwxr-xr-x 1 root root 29 May 10 11:31 runreports

$ echo $PATH

/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Which of the following best describes the issue and how to resolve it?

Options:

A.

The runreports utility is not in the user ' s path. The administrator should modify the .bash_profile file.

B.

The runreports utility is a shell script but not owned by the user. The administrator should use chown.

C.

The user does not have the correct SELinux context. The administrator should modify the SELinux template.

D.

The runreports utility does not have execute permissions. The administrator should add execute permissions.

Question 24

Which of the following is the location for built-in Linux executable files and utilities?

Options:

A.

/bin

B.

/var

C.

/etc

D.

/sys

Question 25

Which of the following commands should an administrator use to convert a KVM disk file to a different format?

Options:

A.

qemu-kvm

B.

qemu-nq

C.

qemu-io

D.

qemu-img

Question 26

System users are being randomly disconnected from a server. The systems administrator inspects the following output:

# ping 192.168.1.1

--- 192.168.1.1 ping statistics ---

100 packets transmitted, 4 received, 96% packet loss

# ip -s link show

RX: errors 400000

TX: errors 150000

# ip route

default via 192.168.1.1 dev enp0s25 proto dhcp src 192.168.1.102 metric 600

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

Options:

A.

Assign a proper gateway

B.

Replace the NIC

C.

Increase the ping ' s TTL

D.

Increase the MTU size

Question 27

A Linux administrator receives reports that an application hosted in a system is not completing tasks in the allocated time. The administrator connects to the system and obtains the following details:

Which of the following actions can the administrator take to help speed up the jobs?

Options:

A.

Increase the amount of free memory available to the system.

B.

Increase the amount of CPU resources available to the system.

C.

Increase the amount of swap space available to the system.

D.

Increase the amount of disks available to the system.

Question 28

A Linux administrator wants to use AI to deploy infrastructure as code. Which of the following is a best practice regarding the use of AI for this task?

Options:

A.

Using copy and paste when possible

B.

Generating monolithic code

C.

Linting generated code

D.

Merging CI/CD pipelines

Question 29

A Linux administrator receives reports that an application hosted in a system is not completing tasks in the allocated time. The administrator connects to the system and obtains the following details:

$ uptime

12:47:43 up 22:17, 2 users, load average: 7.75, 5.72, 5.17

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

Options:

A.

High CPU load

B.

Insufficient disk space

C.

Network latency

D.

Memory leak

Question 30

A Linux administrator is testing a web application on a laboratory service and needs to temporarily allow DNS and HTTP/HTTPS traffic from the internal network. Which of the following commands will accomplish this task?

Options:

A.

firewalld -- add-service=dns, http,https -- zone=internal

B.

iptables -- enable-service= ' dns|http|https ' -- zone=internal

C.

firewall-cmd --add-service={dns, http, https} --zone=internal

D.

systemctl mask firewalld --for={dns, http, https} --zone=internal

Question 31

A Linux user needs to download the latest Debian image from a Docker repository. Which of the following commands makes this task possible?

Options:

A.

docker image init debian

B.

docker image pull debian

C.

docker image import debian

D.

docker image save debian

Question 32

A systems administrator is configuring new Linux systems and needs to enable passwordless authentication between two of the servers. Which of the following commands should the administrator use?

Options:

A.

ssh-keygen -t rsa & & ssh-copy-id -i ~/.ssh/id_rsa.pub john@server2

B.

ssh-keyscan -t rsa & & ssh-copy-id john@server2 -i ~/.ssh/key

C.

ssh-agent -i rsa & & ssh-copy-id ~/.ssh/key john@server2

D.

ssh-add -t rsa & & scp -rp ~/.ssh john@server2

Question 33

A systems administrator is writing a script to analyze the number of files in the directory /opt/application/home/. Which of the following commands should the administrator use in conjunction with ls -l | to count the files?

Options:

A.

less

B.

tail -f

C.

tr -c

D.

wc -l

Question 34

An administrator must secure an account for a user who is going on extended leave. Which of the following steps should the administrator take? (Choose two)

Options:

A.

Set the user’s files to immutable.

B.

Instruct the user to log in once per week.

C.

Delete the user’s /home folder.

D.

Run the command passwd -l user.

E.

Change the date on the /home folder to that of the expected return date.

F.

Change the user’s shell to /sbin/nologin.

Question 35

An administrator updates the network configuration on a server but wants to ensure the change will not cause an outage if something goes wrong. Which of the following commands allows the administrator to accomplish this goal?

Options:

A.

netplan try

B.

netplan rebind

C.

netplan ip

D.

netplan apply

Question 36

Which of the following commands can be used to display current CPU utilization in real time on a Linux system?

Options:

A.

uptime

B.

top

C.

df

D.

lsblk

Question 37

An administrator needs to create a new logical volume from sets of provisioned disks. Which of the following shows the correct order of commands the administrator should execute?

Options:

A.

1. pvcreate, 2. vgcreate, 3. lvcreate

B.

1. vgcreate, 2. pvcreate, 3. lvcreate

C.

1. vgcreate, 2. lvcreate, 3. pvcreate

D.

1. lvcreate, 2. pvcreate, 3. vgcreate

Question 38

Which of the following describes PEP 8?

Options:

A.

The style guide for Python code

B.

Python virtual environments

C.

A package installer for Python

D.

A Python variable holding octal values

Question 39

Which of the following describes how a user ' s public key is used during SSH authentication?

Options:

A.

The user ' s public key is used to hash the password during SSH authentication.

B.

The user ' s public key is verified against a list of authorized keys. If it is found, the user is allowed to log in.

C.

The user ' s public key is used instead of a password to allow server access.

D.

The user ' s public key is used to encrypt the communication between the client and the server.

Question 40

A Linux administrator just finished setting up passwordless SSH authentication between two nodes. However, upon test validation, the remote host prompts for a password. Given the following logs:

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

Options:

A.

The SELinux policy is incorrectly targeting the unconf ined_u context.

B.

The administrator forgot to restart the SSHD after creating the authorizedjceys file.

C.

The authorized_keys file has the incorrect root permissions assigned.

D.

The authorized_keys file does not have the correct security context to match SELinux policy.

Question 41

A Linux user needs to authenticate to a Windows Active Directory domain. Which of the following configuration files contains the domain configuration details?

Options:

A.

sssd.conf

B.

krb5.conf

C.

pam.conf

D.

smb.conf

Question 42

Which of the following commands is used to display detailed information about block devices on a Linux system?

Options:

A.

lsblk

B.

mount

C.

df

D.

fdisk

Question 43

A Linux systems administrator makes updates to systemd-managed service configuration files. Which of the following commands should the administrator execute in order to implement the changes?

Options:

A.

systemctl enable

B.

systemctl start

C.

systemctl restart

D.

systemctl daemon-reload

Question 44

A systems administrator needs to check the statuses of all the services on a Linux server. Which of the following commands accomplishes this task?

Options:

A.

systemctl is-active --services

B.

systemctl list-sockets --type=services

C.

systemctl is-enabled --services

D.

systemctl list-units --type=services

Page: 1 / 11
Total 149 questions