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

CompTIA XK0-006 Dumps

Page: 1 / 15
Total 149 questions

CompTIA Linux+ V8 Exam Questions and Answers

Question 1

A Linux administrator installed a new program inside $HOME/.local/bin and is trying to execute it without using an absolute path. Which of the following should the administrator use for this task?

Options:

A.

export PATH=PATH:$HOME/.local/bin

B.

export $PATH=PATH:$HOME/.local/bin

C.

export PATH=$PATH:$HOME/.local/bin

D.

export $PATH=$PATH:$HOME/.local/bin

Question 2

An administrator needs to remove the directory /home/user1/data and all of its contents. Which of the following commands should the administrator use?

Options:

A.

rmdir -p /home/user1/data

B.

ln -d /home/user1/data

C.

rm -r /home/user1/data

D.

cut -d /home/user1/data

Question 3

A systems administrator needs to check access to all company servers. The administrator uses the following script, which does not complete:

for i in $(cat /home/user1.file)

do

echo $i

ssh $i uptime

Which of the following is missing from the script?

Options:

A.

fi

B.

else

C.

while

D.

done

Question 4

A systems administrator is preparing a Linux system for application setup. The administrator needs to create an environment variable with a persistent value in one of the user accounts. Which of the following commands should the administrator use for this task?

Options:

A.

export " VAR=SomeValue " > > ~/.ssh/profile

B.

export VAR=value

C.

VAR=value

D.

echo " export VAR=value " > > ~/.bashrc

Question 5

An administrator wants to search a file named myFile and look for all occurrences of strings containing at least five characters, where characters two and five are i, but character three is not b. Which of the following commands should the administrator execute to get the intended result?

Options:

A.

grep .a*^b-.a myFile

B.

grep .a., [a] myFile

C.

grepa^b*a myFile

D.

grep .i[^b].i myFile

Question 6

A Linux administrator needs to add a new HTTP service on the server. Which of the following commands allows other systems to communicate with the service after the system is restarted?

Options:

A.

firewall-cmd --add-service=http --reload

B.

firewall-cmd --add-port=http --complete-reload

C.

firewall-cmd --add-service=http --permanent

D.

firewall-cmd --add-service=http

Question 7

An administrator wants to start an Ubuntu terminal in a container. Which of the following will allow the administrator to complete the task?

Options:

A.

podman pull ubuntu /bin/bash

B.

docker run -it ubuntu

C.

containerd /usr/bin/sh ubuntu

D.

runc exec -it ubuntu

Question 8

A Linux user frequently tests shell scripts located in the /home/user/scripts directory. Which of the following commands allows the user to run the program by invoking only the script name?

Options:

A.

export SHELL=$SHELL=/home/user/scripts

B.

export TERM=$TERM=/home/user/scripts

C.

export PATH=$PATH:/home/user/scripts

D.

export alias /home/user/scripts= ' /bin '

Question 9

Which of the following is the best use of AI within a Linux environment?

Options:

A.

Giving full control of the Linux server to the AI engine

B.

Uploading company internal messaging for user validation

C.

Outsourcing proprietary source code development to the LLM

D.

Generating an nginx configuration file that can be used for testing

Question 10

Which of the following utilities supports the automation of security compliance and vulnerability management?

Options:

A.

SELinux

B.

Nmap

C.

AIDE

D.

OpenSCAP

Question 11

A user reports Issues v/hen trying to connect to one ot the Linux servers. The server administrator reviews the following outputs:

Output 1:

Kernel panic not syncing: Fatal Machine check

Fid: 0, comm; swapper Tainted: G M ------------------ 4.18.0-553.8.1.cl8_10.x86_64 #1

Call Trace:

< #mc > [rrrrrrrrs:4er..i4i] ? panic+ox7n/oxi43

[] ? mcc_panic+0x21f/0x240

[] ? do_machine_check+0xal8/0xae0

[] ? intel idie+0xbi/0xi70

[] ? machino_check+0xlc/0x30

[] ? intel_idle+0xbl/0xl70

«EOE» [] ? hrtimer 8tart+0xlB/0x20

[] ? cpuidle_idle_cail+0xa7/0xl40

I| ? cpu_idle+0xbfc/0xll0

[] ? Start_secondary+0x202/0x245

Output 2:

[325926.243631] mce: [Error] : CPU 22: Machine Check Exception: 7 Bank 0: bd80000000000134

1325926.247004| nice: (Error): Machine check events logged

[325991.358038] race: [Error] : KIP 10: < ffffffff83584719* (copy user enhanced fast strir.q+0x9/0x20)

[325991.358038] mce: [Error] : tsc 31ea89256a735 ADDR 3cdl889000 MISC 8c

[325991.350033] mce: [Error] : PROCESSOR 0:50657 TIME 15945B1695 SOCKET 0 APTC 16 microcode rrrrtrrr

[325991.358038] mce: [Error] : Run the above through ' rr.ccloq —ascii*

[325991.358038] mce: [Error] : Machine check: Action required: unknown MCACOD

[325991.3511038] Kernel panic not syncing: Fatal machine check

Which of the following statements describes the cause and resolution for this issue?

Options:

A.

The current kernel is corrupted and should be reinstalled.

B.

The messages point to a hardware issue that should be addressed by the server team.

C.

The system has crashed and needs to be rebooted to fix the issue.

D.

All available CPUs have been exhausted, and a new CPU should be added.

Question 12

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 13

Users cannot access a server after it has been restarted. At the server console, the administrator runs the following commands;

as

Which of the following is the cause of the issue?

Options:

A.

The DNS entry does not have a valid IP address.

B.

The SSH service has not been allowed on the firewall.

C.

The server load average is too high.

D.

The wrong protocol is being used to connect to the web server.

Question 14

A systems administrator manages multiple Linux servers and needs to set up a reliable and secure way to handle the complexity of managing event records on the OS and application levels. Which of the following should the administrator do?

Options:

A.

Create an automated process to retrieve logs from the server by demand.

B.

Implement a centralized log aggregation solution.

C.

Configure daily automatic backups of logs to remote storage.

D.

Deploy log rotation procedures to manage the records.

Question 15

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

Question 16

Which of the following passwords is the most complex?

Options:

A.

H3sa1dt01d

B.

he$@ID$heTold

C.

H3s@1dSh3t0|d

D.

HeSaidShetold

Question 17

Which of the following can be implemented with PAM to detect and block dictionary attacks?

Options:

A.

pam_tally2

B.

pam_limits

C.

pam_unix

D.

pam_ldap

Question 18

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 19

Which of the following is a characteristic of Python 3?

Options:

A.

It is closed source.

B.

It is extensible through modules.

C.

It is fully backwards compatible.

D.

It is binary compatible with Java.

Question 20

An administrator is investigating the reason a Linux workstation is not resolving the website The administrator executes some commands and receives the following output:

as

Which of the following is the most likely cause?

Options:

A.

The static entry needs to be removed from /etc/hosts.

B.

The remote website does not support IPv6, and the workstation requires it.

C.

The firewall needs to be modified to allow outbound HTTP and HTTPS.

D.

The nameserver in /etc/resolv.conf needs to be updated to 8.8.8.8

Question 21

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 22

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 23

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 24

User1 reports " access denied " errors while trying to execute app. Given the following outputs:

as

Which of the following options will remediate this issue?

Options:

A.

Providing execute permissions to user1 in the ACL

B.

Modifying the permissions for others to grant read, write, and execute

C.

Adding user1 to the wheel group

D.

Moving app to a different folder

Question 25

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 26

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 27

A systems administrator wants to review the logs from an Apache 2 error.log file in real time and save the information to another file for later review. Which of the following commands should the administrator use?

Options:

A.

tail -f /var/log/apache2/error.log > logfile.txt

B.

tail -f /var/log/apache2/error.log | logfile.txt

C.

tail -f /var/log/apache2/error.log > > logfile.txt

D.

tail -f /var/log/apache2/error.log | tee logfile.txt

Question 28

An administrator attempts to install updates on a Linux system but receives error messages regarding a specific repository. Which of the following commands should the administrator use to verify that the repository is installed and enabled?

Options:

A.

yum repo-pkgs

B.

yum list installed repos

C.

yum reposync available

D.

yum repolist all

Question 29

Which of the following commands should a Linux administrator use to determine the version of a kernel module?

Options:

A.

modprobe bluetooth

B.

lsmod bluetooth

C.

depmod bluetooth

D.

modinfo bluetooth

Question 30

A systems administrator receives reports from users who are having issues while trying to modify newly created files in a shared directory. The administrator sees the following outputs:

as

Which of the following provides the best resolution to this issue?

Options:

A.

Adding a setuid bit to the user in the shared folder

B.

Manually changing the group of the newly created files

C.

Changing all directory contents to be writable and readable for everyone

D.

Adding a setgid bit to the group in the shared folder

Question 31

A systems administrator wants to review the amount of time the NetworkManager service took to start. Which of the following commands accomplishes this goal?

Options:

A.

resolvectl

B.

journalctl

C.

systemctl daemon-reload

D.

systemd-analyze blame

Question 32

You are a systems administrator and have created an uncompressed backup of the

application directory. Several hours later, you must restore the application from backup.

INSTRUCTIONS

Within each tab, click on an object to form the appropriate command used to create the

backup and restore the application.

Command objects may only be used once, and not all will be used. Click the arrow to

remove any unwanted objects from your command.

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

the Reset All button.

as

as

Options:

Question 33

While hardening a system, an administrator runs a port scan with Nmap, which returned the following output:

as

Which of the following is the best way to address this security issue?

Options:

A.

Configuring a firewall to block traffic on port 23 on the server

B.

Changing the system administrator ' s password to prevent unauthorized access

C.

Closing port 80 on the network switch to block traffic

D.

Disabling and removing the Telnet service on the server

Question 34

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 35

A Linux administrator is configuring a CUPS print service on a Linux machine and needs to allow only connections from a local network (192.168.100.0/24). Which of the following commands should the administrator use?

Options:

A.

iptables -A OUTPUT -d 192.168.100.0/24 --sport 631 -p tcp -j ACCEPT

B.

iptables -A OUTPUT -s 192.168.100.0/24 --dport 631 -p tcp -j ACCEPT

C.

iptables -A INPUT -s 192.168.100.0/24 --dport 631 -p tcp -j ACCEPT

D.

iptables -D INPUT -d 192.168.100.0/24 --dport 631 -p tcp -j ACCEPT

Question 36

A systems administrator attempts to edit a file as root, but receives the following error:

as

Which of the following commands allows the administrator to edit the file?

Options:

A.

chown root /etc/resolv.conf

B.

chattr -i /etc/resolv.conf

C.

chmod 750 /etc/resolv.conf

D.

chgrp root /etc/resolv.conf

Question 37

A DevOps engineer made some changes to files in a local repository. The engineer realizes that the changes broke the application and the changes need to be reverted back. Which of the following commands is the best way to accomplish this task?

Options:

A.

git pull

B.

git reset

C.

git rebase

D.

git stash

Question 38

A Linux systems administrator needs to extract the contents of a file named /home/dev/web.bkp to the /var/www/html/ directory. Which of the following commands should the administrator use?

Options:

A.

cd /var/www/html/ & & gzip -c /home/dev/web.bkp | tar xf -

B.

pushd /var/www/html/ & & cpio -idv < /home/dev/web.bkp & & popd

C.

tar -c -f /home/dev/web.bkp /var/www/html/

D.

unzip -c /home/dev/web.bkp /var/www/html/

Question 39

A Linux administrator receives reports about MySQL service availability issues. The administrator observes the following information:

uptime -p shows the system has been up for only 2 minutes

journalctl shows messages indicating:

mysqld invoked oom-killer

mysqld cpuset=/ mems_allowed=0

Which of the following explains why the server was offline?

Options:

A.

The process exhausted server memory.

B.

The process was intentionally terminated by a privileged user.

C.

The process crashed because of a filesystem error.

D.

A network outage caused a service availability issue.

Question 40

Which of the following commands would a Linux administrator use to determine the temperature of a motherboard?

Options:

A.

ipmitool

B.

dmidecode

C.

lspci

D.

lm_sensors

Question 41

An administrator is trying to terminate a process that is not responding. Which of the following commands should the administrator use in order to force the termination of the process?

Options:

A.

kill PID

B.

kill -1 PID

C.

kill -9 PID

D.

kill -15 PID

Question 42

(Partial question reconstructed from visible content)

Options:

A.

(not visible)

B.

(not visible)

C.

pam.conf

D.

smb.conf

Question 43

Which of the following is the main reason for setting up password expiry policies?

Options:

A.

To avoid using the same passwords repeatedly

B.

To mitigate the use of exposed passwords

C.

To force usage of passwordless authentication

D.

To increase password strength and complexity

Question 44

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

Page: 1 / 15
Total 149 questions