Winter 50% Special Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 28285018

XK0-004 CompTIA Linux+ Certification Exam Questions and Answers

Questions 4

Joe, a member of the accounting group on a Linux system, is unable to write a file called “taxes” in the accounting shared directory. The ownership and permissions on the directory and file are as follows:

accounting drwxrw-r-- user = ann, group = accounting

taxes -rw-r--r-- , user = ann, group = accounting

Which of the following commands would allow Joe to write to the file? (Choose two.)

Options:

A.

chmod g+x accounting

B.

chmod 777 taxes

C.

chgrp taxes accounting

D.

chgrp accounting taxes

E.

chmod 774 accounting

F.

chmod u+x accounting

Buy Now
Questions 5

A technical support engineer receives a ticket from a user who is trying to create a 1KB file in the /tmp directory and is getting the following error No space left on device. The support engineer checks the /tmp directory, and it has 20GB of free space.

Which of the following BEST describes a possible cause for this error?

Options:

A.

The /tmp directory is not mounted.

B.

The filesystem is formatted with a 4MB block size.

C.

the filesystem ran out of inodes.

D.

The /tmp directory has been set with an immutable attribute.

Buy Now
Questions 6

Joe, a user, creates a short shell script, shortscript.sh, and saves it in his home directory with default

permissions and paths. He then attempts to run the script by typing ./shortscript.sh, but the command

fails to execute.

Which of the following commands would have allowed the script to run?

Options:

A.

chmod u+x shortscript.sh

B.

source ./shortscript.sh

C.

chmod 155 ~/shortscript.sh

D.

chgrp shortscript.sh Joe

Buy Now
Questions 7

Given that a company’s policy states that users cannot install third-party tools on Window servers, which of the following protocols will allow a Linux GUI to connect to a Windows server?

Options:

A.

VNC

B.

NX

C.

RDP

D.

X11

Buy Now
Questions 8

Ann, a user, has created a new directory and noticed that permissions on the new directory are as follows:

drwx------. 1 ann ann 0 Jun 11 08:20 work

Which of the following should the administrator do to restore default permissions for newly created directories?

Options:

A.

Change umask value in /etc/profile.

B.

Run chmod command to update permissions.

C.

Modify directory ownership to ann:ann with chown.

D.

Execute chattr command to restore default access.

Buy Now
Questions 9

An administrator needs to change the DNS domain search order of a single Linux host to localize it better.

Which of the following files should the administrator edit?

Options:

A.

/etc/resolv.conf

B.

/etc/hosts

C.

/etc/nsswitch.conf

D.

/etc/dhcpd.conf

Buy Now
Questions 10

An administrator needs to see a list of the system user’s encrypted passwords. Which of the following Linux files does the administrator need to read?

Options:

A.

/etc/shadow

B.

/etc/skel

C.

/etc/passwd

D.

/etc/pw

Buy Now
Questions 11

A Linux administrator is testing connectivity to a remote host on a shared terminal. The administrator wants to allow other users to access the terminal while the command is executing.

Which of the following commands should the administrator use?

Options:

A.

bg ping remotehost

B.

fg ping remotehost

C.

ping remotehost < results

D.

ping remotehost &

Buy Now
Questions 12

An administrator is troubleshooting to determine why backups are failing on a particular server. The administrator runs the ps command and analyzes the following output.

The administrator runs kill -9 10112 yet the process remains.

Which of the following BEST describes the issue and how to fix it?

Options:

A.

The backup process is still running and needs to be killed with kill -9 --force 10112.

B.

The backup process is a zombie process, and the system needs to be rebooted.

C.

The backup process is out of memory, and more memory needs to be added to the system.

D.

The backup process is using 100% of system resources and needs to be rescheduled with renice.

Buy Now
Questions 13

A systems administrator receives a report that the web server is not running after a planned system reboot.

After starting the web server manually, which of the following commands should the administrator issue to ensure the web server starts at boot time?

Options:

A.

systemctl service on

B.

systemctl enable .service

C.

systemctl service enable

D.

systemctl on .service

Buy Now
Questions 14

A Linux administrator wants to fetch a Git repository from a remote Git server.

Which of the following is the BEST command to perform this task?

Options:

A.

git checkout

B.

git clone

C.

git merge

D.

git config

Buy Now
Questions 15

A Linux administrator is restoring the SELinux contexts on an entire system. Which of the following commands

is the BEST option to complete this task?

Options:

A.

setenforce 0 && reboot

B.

setfacl –bR / && reboot

C.

touch /.autorelabel && reboot

D.

restorecon / && reboot

Buy Now
Questions 16

A Linux administrator has installed a web application firewall in front of a web server running on HTTP port 8080 and successfully started the HTTP server. However, after opening the application URL in an Internet browser, the administrator discovered that the application does not work. The administrator performed the following diagnostic steps:

Output of sysctl -a command:

Output of iptables -L command:

Output of netstat –nltop | grep "8080":

Which of the following is the NEXT step the administrator should perform to permanently fix the issue at the kernel level?

Options:

A.

sysctl -w net.ipv4.ip_forward=1 then run sysctl -w /etc/sysctl.conf to enable the

change

B.

Edit /etc/sysctl.conf file and add net.ipv4.ip_forward = 1 then run sysctl -p /etc/

sysctl.conf to enable the change

C.

Add iptables rule iptables -A INPUT -m state --state NEW -p tcp --dport 8080 -j then

restart httpd daemon

D.

Add iptables rule iptables -A FORWARD-m state --state NEW -p tcp --dport 8080 –j

ACCEPT then restart httpd daemon

Buy Now
Questions 17

A systems administrator wants to deploy several applications to the same server quickly. Each application should be abstracted from the host with its own dependencies and libraries and utilize a minimal footprint.

Which of the following would be BEST in this scenario?

Options:

A.

Virtual machines

B.

Type 2 hypervisor

C.

Chroot jails

D.

Containers

Buy Now
Questions 18

A systems administrator is enabling quotas on the /home directory of a Linux server. The administrator makes the appropriate edits to the /etc/fstab file and attempts to issue the commands to enable quotas on the desired directory. However, the administrator receives an error message stating the filesystem does not support quotas. Which of the following commands should the administrator perform to proceed?

Options:

A.

mount –o remount /home

B.

quotacheck -cg

C.

edquota /home

D.

quotaon /home

Buy Now
Questions 19

An administrator wants to know the amount of memory installed on a Linux server. Which of the following

commands can be used to accomplish this task?

Options:

A.

cat /sys/proc/meminfo

B.

cat /proc/meminfo

C.

cat /proc/sys/meminfo

D.

cat /sys/meminfo

Buy Now
Questions 20

Which of the following is a difference between YAML and JSON?

Options:

A.

Users can comment in YAML but not in JSON

B.

JSON only curly brackets, while YAML only uses square brackets

C.

JSON is used in web development, while YAML is used solely in back-end systems.

D.

YAML has been deprecated for JSON.

Buy Now
Questions 21

A Linux administrator needs to remove a USB drive from a system. The unmount command fails, stating the device is busy. Which of the following commands will show the reason for this error?

Options:

A.

lsusb | grep /mnt/usb

B.

mount | grep /mnt/usb

C.

ps aux | grep /mnt/usb

D.

lsof | grep /mnt/usb

Buy Now
Questions 22

A server, which is used to collect data about the network and datacenter environment via SNMP, is running out of space. Which of the following should the server administrator implement to reduce disk utilization?

Options:

A.

journald

B.

Snapshots

C.

logrotate

D.

tar -cvf

Buy Now
Questions 23

A systems administrator wants to mount an ISO to access its content. Using /mnt as a mount point, which of

the following is the correct syntax?

Options:

A.

mount -o iso9660 /dev/sr0 /mnt

B.

mount -o loop -t iso /mnt

C.

mount -o loop /tmp/image.iso /mnt

D.

mount -o loop /dev/kvm /mnt

Buy Now
Questions 24

A Linux administrator is helping the security team troubleshoot an SELinux policy violation incident. Which of

the following would be the BEST utility command to display SELinux violation and AVC denial messages?

Options:

A.

journalctl | grep sealert

B.

sealert –a /var/log/audit/audit.log

C.

aureport | grep AVC

D.

cat /var/log/messages | grep selinux

Buy Now
Questions 25

A junior systems administrator is upgrading a package that was installed on a Red Hat-based system. The administrator is tasked with the following:

Update and install the new package.

Verify the new package version is installed.

Which of the following should be done to BEST accomplish these task? (Choose two.)

Options:

A.

yum install

B.

yum upgrade

C.

rpm –e

D.

rpm –qa

E.

apt-get

F.

apt-get upgrade

Buy Now
Questions 26

A site reliability engineer updated the latest configuration management scripts and committed them to a

workstream called either test or patch. A Linux administrator wants to ensure these latest workstreams are

able to be retrieved to the server. Which of the following is the BEST Git attribute to use?

Options:

A.

branch

B.

fetch

C.

log

D.

pull

Buy Now
Questions 27

A Linux administrator wants to configure log messages of critical or higher severity levels from the cron utility to be logged to the console. Which of the following will accomplish this objective?

Options:

A.

Edit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console

B.

Edit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console

C.

Edit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console

D.

Edit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console

Buy Now
Questions 28

Which of the following statements BEST represents what the term “agentless” means regarding orchestration?

Options:

A.

Installation of a tool is not required on the remote system to perform orchestration tasks

B.

It facilitates version control when using infrastructure as code during orchestration

C.

It automatically removes malware from the remote system during orchestration

D.

A tool can only be accessed remotely to perform orchestration tasks

Buy Now
Questions 29

An administrator notices the HISTSIZE variable is 50, using the commands below:

HISTSIZE=50

export HISTSIZE

The administrator rechecks the HISTSIZE value using echo HISTSIZE but gets no value. Which of the

following commands should the administrator use to retrieve its value?

Options:

A.

printenv | grep $HISTSIZE

B.

echo HISTSIZE

C.

printf HISTSIZE

D.

grep $HISTSIZE

Buy Now
Questions 30

A Linux administrator needs to remotely update the contents of the www.comptia.org/contacts URL.

Which of the following commands would allow the administrator to download the current contents of the URL before updating?

Buy Now
Questions 31

A junior systems administrator created a new filesystem /dev/sda1 with mountpoint /data and added it to the /etc/fstab for auto-mounting.

When the systems administrator tries to mount the file system, the system refuses. Given the output below:

Which of the following steps is necessary?

Options:

A.

Change the filesystem from /dev/sda1 to /dev/sda2 and reboot.

B.

Change the options to auto,dev,sync,rw,nosuid and run the mount -a command.

C.

Change the mount point to data and reboot.

D.

Change the dump column to 1 and run the mount -a command.

Buy Now
Questions 32

A systems administrator needs to allow the Linux server to receive HTTP connections from Internet hosts. By default, the port for HTTP connections is blocked. Which of the following rules should be added in the firewall to allow this type of connection?

Options:

A.

firewall-cmd --zone=public --add-port=443/tcp --permanent

B.

firewall-cmd --zone=internal --add-port=80/tcp --permanent

C.

firewall-cmd --zone=public --add-port=80/tcp --permanent

D.

firewall-cmd --zone=internal --add-port=443/tcp --permanent

Buy Now
Questions 33

A file server is sharing a directory called /share between team members inside a company. The fileshare

needs to be moved from serverA to /newshare located on serverB with all permissions and attributes

preserved. Which of the following commands would BEST achieve this task?

Options:

A.

rsync -aHAX /share/* serverB:/newshare

B.

dd if=/share/* of=serverB:/newshare

C.

tar -cvf /share/* serverB:/newshare

D.

mirrorlv /share/* serverB:/newshare

Buy Now
Questions 34

An administrator needs to see the type of CPU that a server is running. Which of the following files contains this information?

Options:

A.

/proc/cpuinfo

B.

/etc/devices/info.conf

C.

/dev/proc/cpu

D.

/sys/dev/cpuinfo

Buy Now
Questions 35

A Linux administrator is testing a new web application on a local laptop and consistently shows the following 403 errors in the laptop’s logs”

The web server starts properly, but an error is generated in the audit log. Which of the following settings should be enabled to prevent this audit message?

Options:

A.

httpd_can_network_connect = 1

B.

httpd_enable_scripting = 1

C.

httpd_enable_homedirs = 1

D.

httpd_enable_cgi = 1

Buy Now
Questions 36

A technician wants to secure a sensitive workstation by ensuring network traffic is kept within the local subnet. To accomplish this task, the technician executes the following command:

echo 0 > /proc/sys/net/ipv4/ip_default_ttl

Which of the following commands can the technician use to confirm the expected results? (Choose two.)

Options:

A.

tcpdump

B.

traceroute

C.

route

D.

iperf

E.

ip

F.

arp

Buy Now
Questions 37

A user issues the following command:

ls –l /var/log | egrep –e ‘^d[rwx]{3}.*[rw-]{3}.*’

The list of files in the system is shown below:

Which of the following results matches the command issued?

Options:

A.

drwxr-x--- 2 root adm 4096 Apr 25 14:41 unattended-upgrades

drwxr-x--- 2 root adm 4096 Apr 25 15:41 attended-upgrades

B.

drwxr-xr-x 2 root root 4096 Apr 24 08:36 apt

drwxr-xr-x 2 root root 4096 Apr 9 14:25 dist-upgrade

drwxr-x--- 2 root adm 4096 Apr 25 14:41 unattended-upgrades

C.

drwxr-xr-x 2 root root 4096 Apr 24 08:36 apt

drwxr-xr-x 2 root root 4096 Apr 9 14:25 dist-upgrade

drwxr-x--- 2 root adm 4096 Apr 25 15:41 attended-upgrades

D.

-rw-r--r-- 1 root root 2877 Apr 24 14:14 alternatives.log

-rw-r--r-- 1 syslog adm 246139 Jun 12 15:21 cloud-init.log

-rw-r--r-- 1 root root 8872 Jun 12 15:21 cloud-init-output.log

Buy Now
Questions 38

A Linux storage administrator wants to create a logical volume group. Which of the following commands is required to start the process?

Options:

A.

pvcreate

B.

vgcreate

C.

lvcreate

D.

mkfs.xfs

Buy Now
Questions 39

An administrator needs to mount the shared NFS file system testhost:/testvolume to mount point /mnt/testvol and make the mount persistent after reboot.

Which of the following BEST demonstrates the commands necessary to accomplish this task?

Options:

A.

B.

B.

C.

Buy Now
Questions 40

A Linux administrator needs to take stock of USB devices attached to the system.

Which of the following commands would be BEST to complete this task?

Options:

A.

lspci

B.

lsusb

C.

cat /proc/USB

D.

modprobe -–usb

Buy Now
Exam Code: XK0-004
Exam Name: CompTIA Linux+ Certification Exam
Last Update: May 17, 2021
Questions: 267

PDF + Testing Engine

$80  $159.99

Testing Engine

$57.5  $114.99

PDF (Q&A)

$50  $99.99