New Year Friday Limited Time 55% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 1271b8m643

XK0-004 Exam Dumps - CompTIA Linux+ Certification Exam

Question # 4

A user requested a USB serial device to be added to a desktop computer. The device has built-in kernel driver

support. The administrator tested the device installation and access, but the user cannot access the serial port.

Each time the user attempts to access the device, an error log is created that shows the user does not have

permission to use the serial port. Which of the following will add a user to the group that has serial port

capabilities?

A.

usermod –a –G serialport $USER

B.

usermod –a –G modem $USER

C.

usermod –a –G dialout $USER

D.

usermod –a –G root $USER

Full Access
Question # 5

A user is reporting unusual slowness when trying to transfer a large file to an NFS server from a workstation. The administrator runs tracepath and gets the following output:

Which of the following BEST describes the issue and a possible solution?

A.

The path MTU is lower than the source MTU. Reduce the source MTU setting.

B.

There is latency at the storage device. Work with the storage team to correct the issue.

C.

There is latency on an intermediate router. Increase the path MTU to compensate.

D.

There are dropped packets at an intermediate router. Work with the network team to correct the issue.

Full Access
Question # 6

A systems administrator needs to append output of ls –lha /opt command to the contents of a test.txt file. Which of the following commands will accomplish this?

A.

ls –lha /opt > test.txt

B.

ls –lha /opt < test.txt

C.

ls –lha /opt >> test.txt

D.

ls –lha /opt << test.txt

Full Access
Question # 7

Which of the following are classified as Linux GUI servers? (Choose two.)

A.

VNC

B.

KDE

C.

Gnome

D.

Wayland

E.

MATE

F.

X11

Full Access
Question # 8

An organization wants to consolidate its entire user information in centralized storage using an X.500-based

protocol. Which of the following protocols should be used for this implementation?

A.

RADIUS

B.

LDAP

C.

DNS

D.

DHCP

Full Access
Question # 9

While installing third-party software, a technician wants to monitor logs on the system continuously.

Which of the following commands should the technician issue to monitor the logs?

A.

cat /var/log/kern.log

B.

grep -e /var/log/httpd/access.log

C.

head -n /var/log/secure

D.

tail -f /var/log/messages

Full Access
Question # 10

A system administrator has deployed a Linux server based on an Anaconda process with all packages and custom configurations necessary to install a web server role.

Which of the following could be used to install more Linux servers with the same characteristics?

A.

/etc/sysconfig/anaconda/cfg

B.

/root/anaconda.auto

C.

/root/anaconda-ks.cfg

D.

/etc/sysconfig/installation.cfg

Full Access
Question # 11

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

A.

/proc/cpuinfo

B.

/etc/devices/info.conf

C.

/dev/proc/cpu

D.

/sys/dev/cpuinfo

Full Access
Question # 12

A user wants to list the lines of a log, adding a correlative number at the beginning of each line separated by a set of dashes from the actual message. Which of the following scripts will complete this task?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 13

A customer reports a Linux production server is randomly suffering degraded performance. The administrator verifies that the sysstat package is installed and enabled on the server.

Which of the following would BEST determine what is causing the impact on performance?

A.

Create a cron job that runs uptime every 15 minutes to collect historical data of the load average of the system.

B.

Leave a ping running overnight from a laptop to the server to catch any latency encountered.

C.

Analyze the data in /var/log/sa using the sar command.

D.

Open a screen session and run top inside of it. Let it run over night and collect the data.

Full Access
Question # 14

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?

A.

printenv | grep $HISTSIZE

B.

echo HISTSIZE

C.

printf HISTSIZE

D.

grep $HISTSIZE

Full Access
Question # 15

A Linux systems administrator wants the ability to access systems remotely over SSH using RSA authentication. to which of the following files should the RSA token be added to allow this access?

A.

authorized_keys

B.

~/.ssh/ssh_config

C.

id_rsa.pub

D.

known_hosts

Full Access
Question # 16

A new HTTPS web service is being deployed on a server. Which of the following commands should the Linux administrator use to ensure traffic is able to flow through the system firewall to the new service?

A.

iptables –I OUTPUT –p tcp --sport 443 –j ACCEPT

B.

iptables –A INPUT –p tcp --dport 443 –j ACCEPT

C.

iptables –I INPUT --dport 443 –j ACCEPT

D.

iptables –A OUTPUT –p tcp --dport 443 –j ACCEPT

Full Access
Question # 17

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?

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.

Full Access
Question # 18

A junior systems administrator needs to schedule a backup script named /scripts/backup.sh and make

the correct changes to the crontab.

Which of the following crontab entries would run the script every Monday at 2:05 a.m.?

A.

1 * * 5 2 /scripts/backup.sh

B.

2 5 * * 1 /scripts/backup.sh

C.

5 2 * * 1 /scripts/backup.sh

D.

1 * * 2 5 /scripts/backup.sh

E.

5 2 * * 0 /scripts/backup.sh

Full Access
Question # 19

A systems administrator wants to disable the Linux Kernel WatchDog Timer Driver for security purposes.

Which of the following will accomplish this task?

A.

Add blacklist watchdog to the /etc/modprobe.d/blacklist file.

B.

Rename the /etc/modprobe.d/watchdog file to watchdog.off instead.

C.

Remove the watchdog=1 from the /usr/modules/watchdog.conf file.

D.

Add watchdog=0 to the /etc/modprobe.conf file.

Full Access
Question # 20

A Linux administrator installed a new network adapter and temporarily disabled the network service from starting on boot. The partial output of chkconfig is as follows:

Which of the following commands BEST describes how the administrator should re-enable the network service?

A.

chkconfig --level 0 network on

B.

chkconfig --level 0-6 network on

C.

chkconfig --level 6 network on

D.

chkconfig --level 12 network on

E.

chkconfig --level 345 network on

Full Access
Question # 21

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?

A.

rsync -aHAX /share/* serverB:/newshare

B.

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

C.

tar -cvf /share/* serverB:/newshare

D.

mirrorlv /share/* serverB:/newshare

Full Access
Question # 22

A user attempts to use the mount -a command but gets the following error:

mount: mount point /mnt/test does not exist

Which of the following commands best describes the action the Linux administrator should take NEXT?

A.

mount –a /mnt/test

B.

mkdir –p /mnt/test

C.

mdadm –p /mnt/test

D.

mkfs /mnt/test

E.

touch /mnt/test

Full Access
Question # 23

A junior Linux administrator needs to ensure a service will start on system boot. Which of the following commands should be used to accomplish this task?

A.

chkconfig on

B.

systemctl bootup

C.

service enable

D.

crontab install

Full Access
Question # 24

A Linux administrator receives a call from the network operations team that one of the database applications is down on a Linux server. The Linux server is configured with RAID 1 for redundancy, and the array /dev/md0 consists of two devices called /dev/sda1 and /dev/sdb1. After looking at the status of the RAID 1 array in the /proc/mdstat file, the administrator discovers the RAID 1 array is degraded and the disk /dev/sdb1 on which the database application was installed appears to have failed.

Which of the following steps should the administrator take to remove the device /dev/sdb1 from the RAID array md0? (Choose two.)

A.

mdadm /dev/md0 --remove /dev/sdb1

B.

mdadm /dev/sdb1 --fail /dev/md0

C.

mdadm /dev/md0 --fail /dev/sdb1

D.

mdadm /dev/sdb1 --remove /dev/md0

E.

racadm --remove /dev/sdb1

F.

racadm --fail /dev/sdb1

Full Access
Question # 25

Which of the following are Linux desktop managers? (Choose two.)

A.

KDE

B.

GNOME

C.

GUI

D.

VNC

E.

X11

F.

SPICE

Full Access
Question # 26

As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:

Add relevant content to /tmp/script.sh, so that it finds and compresses rotated files in /var/log without recursion.

INSTRUCTIONS

Fill the blanks to build a script that performs the actual compression of rotated log files.

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

Full Access
Question # 27

Ann, a Linux administrator, wants to edit a configuration management file. When she opens the file to edit, her text editor reports that the file has been opened in read-only mode. She then tries to edit the file as root by elevating via sudo and is still unable to save any changes. The error message in her text editor says that the read-only option is set on the file. Ann checks the permissions on the file and sees the following:

-rw-rw-r-- 1 root wheel 30 Jun 13 15:38 infrastructure.yml

Which of the following commands is the BEST option to allow her to successfully modify the file?

A.

chmod 600 infrastructure.yml

B.

chown root: infrastructure.yml

C.

chattr -i infrastructure.yml

D.

chmod o+w infrastructure.yml

Full Access
Question # 28

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?

A.

setenforce 0 && reboot

B.

setfacl –bR / && reboot

C.

touch /.autorelabel && reboot

D.

restorecon / && reboot

Full Access
Question # 29

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?

Full Access
Question # 30

The dracut command is used to:

A.

create initial RAMDisk images for preloading modules.

B.

compile the Linux kernel images used to boot the OS.

C.

create the bootloader executable files.

D.

create the Boot Manager configuration files.

Full Access
Question # 31

A systems administrator has received reports of intermittent network connectivity to a particular website. Which of the following is the BEST command to use to characterize the location and type of failure over the course of several minutes?

B.

tracert www.comptia.org

D.

netstat www.comptia.org

Full Access
Question # 32

Joe, a user, reports there is data missing after a reboot of the system he is using. The data he was working on was located in /opt/data/user1. A Linux administrator runs the following commands and receives the resulting output.

Which of the following should the administrator perform to resolve the issue?

A.

The administrator can conclude Joe no longer has permissions to his data and needs to change the data

ownership to Joe.

B.

The administrator can conclude the data is gone from the system and needs to be restored from a backup.

C.

The administrator can conclude Joe has been using the wrong folder and should be using /opt/data/

user2.

D.

The administrator can conclude the drive is not mounted properly and should be remounted.

Full Access
Question # 33

Which of the following servers provides encrypted tunnel SOCKS services?

A.

SNMP

B.

VPN

C.

CA

D.

SSH

Full Access
Question # 34

A systems administrator wants to disable the isofs module on the server.

Which of the following will allow the administrator to check if the isofs module is currently in use?

A.

modprobe

B.

insmod

C.

rmmod

D.

lsmod

Full Access
Question # 35

A Linux user uses a VPN to securely access the company's systems from a laptop.

Which of the following protocols are MOST likely used to secure the VPN connection? (Choose two.)

A.

IPSec

B.

HTTP

C.

SFTP

D.

VNC

E.

SSL/TLS

F.

SELinux

Full Access
Question # 36

A newly installed desktop is unable to connect to networked resources. The systems administrator executes various commands and reviews the following output snippets:

Which of the following should the systems administrator try NEXT to restore connectivity?

A.

arp -s 20:ad:1f:ab:10:0f 192.168.1.10

B.

route add -net 192.168.1.0 netmask 255.255.255.0

C.

dig -x @127.0.0.1 192.168.1.10

D.

ip link set wlo1 up

E.

killall -HUP NetworkManager

Full Access
Question # 37

A systems administrator has retrieved the latest copy of the system backup files, which had been stored offsite at a third-party vendor. The systems administrator wants to validate that the data was not

modified since the backup.

Which of the following would BEST verify that the data remained the same?

A.

Perform a MD5 hash on the data.

B.

Perform a SCP from the backup.

C.

Perform rsync.

D.

Restore from the last full backup.

Full Access
Question # 38

The lead Linux has added a disk, /dev/sdd, to a VM that is running out of disk space. Place the following steps in the correct order from first (1) to last (4) to add the disk to the existing LVM.

Full Access
Question # 39

A Linux administrator needs to schedule a cron job to run at 1:15 p.m. every Friday to report the amount of free disk space on the system and to send the output to a file named “freespace”. Which of the following would meet this requirement?

A.

13 15 * * 5 df > /freespace

B.

15 13 * * 5 df > /freespace

C.

15 1 * * 6 df > /freespace

D.

15 13 6 * * df > /freespace

Full Access
Question # 40

An analyst is trying to determine which public IP addresses are managed by Company A, but the script is not working correctly.

Which of the following explains what is wrong with the script?

A.

$(cat ip-list.txt) should be changed to `cat ip-list.txt` in the for statement.

B.

The for should be changed to while in the loop.

C.

The > should be changed to 2> in the do statement.

D.

The -ne flag should be changed to -eq in the if statement.

Full Access
Question # 41

A Linux team is using Git to version a set of custom scripts. A team member has made an update to a script

and published the changes to the repository.

Which of the following is the BEST way to retrieve the latest changes to the administrator's local working copy?

A.

git fetch

B.

git merge

C.

git commit

D.

git pull

Full Access
Question # 42

A Linux user wants to give read-only permissions to a directory and its contents. Which of the following

commands will allow the user to accomplish this task?

A.

chmod –R 400 /new_directory/

B.

chmod –R 600 /new_directory/

C.

chmod 400 /new_directory/

D.

chmod 600 /new_directory/

Full Access
Question # 43

Which of the following is used in unattended server installation via PXE?

A.

Kickstart

B.

YAML

C.

Cloud-init

D.

Container image

Full Access
Question # 44

A junior Linux administrator needs to create 16 empty files quickly that will contain sales information for each

quarter for the past four years. Which of the following commands will meet this requirement?

A.

touch {2015,2016,2017,2018}.{q1,q2,q3,q4}

B.

touch [2015,2016,2017,2018].[q1,q2,q3,q4]

C.

touch ‘2015,2016,2017,2018‘.‘q1,q2,q3,q4‘

D.

touch {2015.2016.2017.2018}.{q1.q2.q3.q4}

Full Access
Question # 45

A new IO card has been added to the security server to log the opening and closing of the main entrance. A

switch is attached, so the interface card returns a 1 when the door is opened and a 0 when the door is closed.

Which of the following describes the Linux device to which this switch is attached?

A.

/dev/tty0

B.

/dev/port

C.

/dev/gpio

D.

/dev/sg0

Full Access
Question # 46

Which of the following is the MOST common method used to access Windows systems that are running in a cloud provider from a Linux system?

A.

SSH

B.

NX

C.

XRDP

D.

VNC

Full Access
Question # 47

While creating a file on a volume, the Linux administrator receives the following message: No space left on device. Running the df –m command, the administrator notes there is still 50% of usage left. Which of the following is the NEXT step the administrator should take to analyze the issue without losing data?

A.

Run the df –i command and notice the inode exhaustion

B.

Run the df –h command and notice the space exhaustion

C.

Run the df –B command and notice the block size

D.

Run the df –k command and notice the storage exhaustion

Full Access
Question # 48

Which of the following is modified to reconfigure the boot environment?

A.

grub-mkconfig

B.

grub.cfg

C.

update-grub

D.

grub2-mkconfig

Full Access