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

XK0-004 Exam Dumps - CompTIA Linux+ Certification Exam

Question # 4

An administrator is attempting to block SSH connections to 192.168.10.24 using the Linux firewall. After implementing a rule, a connection refused error is displayed when attempting to SSH to 192.168.10.24.

Which of the following rules was MOST likely implemented?

A.

iptables –A –p tcp –d 192.168.10.24 –dropt 22 –j REJECT

B.

iptables –A –p tcp –d 192.168.10.24 –dropt 22 –j DROP

C.

iptables –A –p tcp –d 192.168.10.24 –dropt 22 –j FORWARD

D.

iptables –A –p tcp –d 192.168.10.24 –dropt 22 –j REFUSE

Full Access
Question # 5

Joe, a user, reports that he is no longer able to write files to his home directory. Upon inspection, the Linux

administrator discovers that attempting to create a new file gives the following error: No space left on device. However, the disk and partition are not full. Which of the following commands would be BEST for the administrator to use to continue troubleshooting this problem?

A.

rm -Rf ~/.*

B.

fsck -y /dev/sda1

C.

df -i

D.

fdisk /dev/sda

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

A Linux administrator opens a ticket to have an external hard drive mounted. As a security policy, external storage kernel modules are disabled.

Which of the following is the BEST command for adding the proper kernel module to enable external storage modules?

A.

rmmod /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

B.

modinfo /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

C.

depmod /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

D.

insmod /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

Full Access
Question # 8

A systems administrator configured a new kernel module, but it stopped working after reboot. Which of the following will allow the systems administrator to check for module problems during server startup?

A.

lsmod

B.

modprobe

C.

modinfo

D.

dmesg

Full Access
Question # 9

A systems administrator needs to install a new piece of hardware that requires a new driver. The driver should be manually installed. Which of the following describes the order of commands required to obtain module information, install the module, and check the log for any errors during module installation?

A.

lsmod, modprobe, modinfo

B.

modinfo, insmod, modprobe

C.

modinfo, insmod, dmesg

D.

lsmod, insmod, dmesg

Full Access
Question # 10

Which of the following can be used to boot a DVD from a remote device to initialize a Linux system setup on bare metal hardware as if it is a local DVD?

A.

UEFI

B.

PXE

C.

NFS

D.

GRUB

Full Access
Question # 11

A Linux administrator retrieved a repository of files from a Git server using git clone. The administrator wants to see if a configuration file was added to the repository. Which of the following Git arguments should be used to see the recent modifications?

A.

fetch

B.

log

C.

init

D.

pull

Full Access
Question # 12

A networked has been crashing intermittently. A Linux administrator would like to write a shell script that will attempt to ping the server and email an alert if the server fails to respond. The script will later be scheduled via cron job.

Which of the following scripts would BEST accomplish this task?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 13

A Linux administrator needs every new file created on a directory to maintain the group permissions of the same directory. Which of the following commands would satisfy this requirement?

A.

chmod o+s

B.

chmod u+s

C.

chmod +s

D.

chmod g+s

Full Access
Question # 14

A systems administrator is configuring options on a newly installed Linux VM that will be deployed to the Pacific time zone. Which of the following sets of commands should the administrator execute to accurately configure the correct time settings?

A.

cd /etcln –s /usr/share/zoneinfo/US/Pacific localtime

B.

cd /usr/localln –s /usr/share/zoneinfo/US/Pacific zoneinfo

C.

cd /etc/localln –s /usr/share/zoneinfo/US/Pacific localtime

D.

cd /usr/share/localln –s /usr/share/zoneinfo/US/Pacific localectl

Full Access
Question # 15

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?

A.

git checkout

B.

git clone

C.

git merge

D.

git config

Full Access
Question # 16

Which of the following is the purpose of the vmlinux file on a Linux system?

A.

To prevent a Linux kernel panic

B.

To start a Linux virtual machine

C.

To provide the executable kernel for the system

D.

To enable resource access to the network

Full Access
Question # 17

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?

A.

curl www.comptia.org/contacts

B.

dig www.comptia.org/contacts

C.

apt-get www.comptia.org/contacts

D.

yum list www.comptia.org/contacts

Full Access
Question # 18

A systems administrator is troubleshooting an intermittent network connection at the IP address 192.168.1.23.

The administrator wishes to monitor the connection at five-minute intervals for one hour. Which of the following

commands will accomplish this task?

A.

ping -i 5 192.168.1.23

B.

ping -c 12 192.168.1.23

C.

ping -c 12 -i 300 192.168.1.23

D.

ping -c 60 -i 100 192.168.1.23

Full Access
Question # 19

A Linux engineer is troubleshooting a newly added SCSI device for a Linux server that needed more disk

space without rebooting. The engineer discovers that the new device is not visible by the Linux kernel in

fdisk -l output. Which of the following commands should be used to rescan the entire SCSI bus?

A.

echo "- - -" > /sys/class/scsi_host/host0/scan

B.

echo ' ' > /sys/class/scsi_host/host0/scan

C.

echo "- - -" > /sys/scsi/scsi_host/host0/scan

D.

echo "scan" > /sys/class/scsi_host/host0/scan

Full Access
Question # 20

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?

A.

httpd_can_network_connect = 1

B.

httpd_enable_scripting = 1

C.

httpd_enable_homedirs = 1

D.

httpd_enable_cgi = 1

Full Access
Question # 21

In order to comply with new security policies, an administrator needs to prevent the SSH server from using insecure algorithms.

Which of the following files should be edited to accomplish this?

A.

/etc/ssh/sshd_config

B.

/etc/ssh/ssh_config

C.

~/.ssh/ssh_config

D.

/etc/ssh/known_hosts

Full Access
Question # 22

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?

A.

mount –o remount /home

B.

quotacheck -cg

C.

edquota /home

D.

quotaon /home

Full Access
Question # 23

A systems administrator wants to know the current status of a series of dd jobs that were started in the background three hours ago.

Which of the following commands will achieve this task?

A.

sudo killall –HUP dd

B.

sudo killall dd

C.

sudo killall –TERM dd

D.

sudo killall -USR1 dd

Full Access
Question # 24

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

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

Full Access
Question # 25

A user, jsmith, needs access to database files located on a server. Which of the following will add jsmith to the “dba” group and preserve existing group memberships?

A.

usermod –a –G dba jsmith

B.

usermod –g dba jsmith

C.

useradd –g dba jsmith

D.

groupmod dba –u jsmith

Full Access
Question # 26

Which of the following will boot from a network-hosted ISO image at power on?

A.

PXE

B.

FTP

C.

iSCSI

D.

NFS

Full Access
Question # 27

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 # 28

Ann, a junior Linux administrator, needs to copy software from her local machine to assist in developing a software application on a remote machine with the IP address 192.168.3.22. The file needs to be placed on the /tmp directory. After downloading the RPM to the local machine, which of the following commands would be BEST to use to copy the software?

A.

scp ~/software.rpm USER@192.168.3.22:/tmp

B.

scp ~/software.rpm USER@192.168.3.22: /tmp

C.

wget USER@192.168.3.22:/tmp -f ~/software.rpm

D.

scp USER@192.168.3.22 ~/software.rpm :/tmp

Full Access
Question # 29

The following tools help maintain consistency across different systems in an infrastructure:

SUSE Manager

Red Hat Satellite

Spacewalk

If a system file is changed, the tools roll back the file to a predefined configuration.

Which of the following concepts BEST describes this behavior?

A.

Build automation

B.

Infrastructure as code

C.

Automated configuration management

D.

Agentless system management

Full Access
Question # 30

An administrator is setting UP a NAT gateway. Two interfaces have been configured:

The firewall configuration has been completed:

The IP forwarding configuration parameter is:

When testing the NAT from a workstation, the administrator encounters an issue:

Which of the following is the MOST likely cause of the packet loss?

A.

The MASQUERADE source and destination are in the incorrect order,

B.

The firewall is blocking the connection.

C.

The etho interface is wrong.

D.

IPv4 forwarding has not been enabled on the NAT gateway

Full Access
Question # 31

A system administrator needs to bootstrap a series of Ubuntu images for a public provider. The administrator must ensure at the images contain the exact same updates, custom. Configure files after their first and then automatically. Which of the following tools the administrator user?

A.

Ansible

B.

Docker

C.

Cloud-init

D.

Anaconda

Full Access
Question # 32

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 # 33

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 # 34

A new user has been added to a Linux machine. Which of the following directories would contain the user’s

default files?

A.

/etc/login.defs

B.

/etc/passwd

C.

/etc/skel

D.

/etc/inittab

Full Access
Question # 35

An administrator is configuring a new Linux server and wants to boot the system to a file that was previously downloaded to locally install removable media. Which of the following boot options should the administrator choose?

A.

PXE

B.

ISO

C.

NFS

D.

HTTP

Full Access
Question # 36

Which of the following can be used to check the status of wireless devices that are connected to the system?

A.

lsusb

B.

iwconfig

C.

netstat

D.

ifconfig

Full Access
Question # 37

A Linux administrator suspects unauthorized users are attempting to log in to the Linux server remotely. Which

of the following should the administrator check FIRST?

A.

/var/log/messages

B.

/var/log/secure

C.

/var/log/dmesg

D.

/var/log/kern.log

Full Access
Question # 38

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 # 39

A Linux administrator is getting an error message indicating a device does not have any space left on it. However, the administrator runs the following commands and receives the output below:

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

A.

The resized command needs to be run on the filessystem.

B.

Files need to be removed in order to free up file handles.

C.

The skfs,ext3 command needs to be run to change the inode size.

D.

The block size needs to be adjusted to >4KIB blocks

Full Access
Question # 40

A Linux administrator issues the following command with root or sudo privileges:

Rmp -1 installpackage.rpm --nodeps

Which of the following should the administrator expect to see in the output?

A.

The installpackage.rmp package will not fail due to checks for dependencies.

B.

The installpackage.rmp package will not fail due to missing dependencies

C.

The installpackage.rmp package will not be installed, and there will be dependencies

D.

The installpackage.rmp package will not be installed, and there not be check for dependencies

Full Access
Question # 41

In which of the following Linux GUI environments would the Konsole application MOST likely be found?

A.

Gnome

B.

KDE

C.

Cinnamon

D.

Unity

E.

MATE

Full Access
Question # 42

Ann, a Linux administrator, is storing scripts in a private Git repository. Which of the following commands should Ann use to avoid entering the login and password every time Ann commits change?

A.

Git init shared-true

B.

Echo authe n tapprove ‘’>> .git/config

C.

Git credential approve

D.

Git config credential.help cache

Full Access
Question # 43

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?

A.

lsusb | grep /mnt/usb

B.

mount | grep /mnt/usb

C.

ps aux | grep /mnt/usb

D.

lsof | grep /mnt/usb

Full Access
Question # 44

A system administrator needs to run a job called payments_Reconciliation on the last day of the month at the end of the day. Which of the following lines in crontab should be inserted to complete job?

A)

B)

C)

D)

A.

Option

B.

Option

C.

Option

D.

Option

Full Access
Question # 45

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 # 46

On a UEFI-based system, which of the following invokes GRUB2 from the EFI command prompt?

A.

boot//EFI/grub2.efi

B.

EFI/grub2.efi

C.

/boot/EFI/grub2.efi

D.

/grub2.efi

Full Access
Question # 47

A technician suspects a company's border firewall is down, thus blocking Internet access. The technician executes the following commands:

#ping -c 1 firewall.company.com

64 bytes from firewall.company.com (192.168.1.1): icmp_seq=1 ttl=64 time=0.061ms

#ping -c 16 www.comptia.com

16 packets transmitted, 0 received, 100% packet loss, time 14999ms

Which of the following commands should the technician use to BEST determine the source of this outage?

A.

tcpdump

B.

nmap

C.

dig

D.

traceroute

Full Access
Question # 48

Given the output below:

[root@appserver ~]# rm config.txt

rm: remove regular file 'config.txt'? yes

rm: cannot remove 'config.txt': Operation not permitted

Which of the following might be the cause?

A.

The file config.txt does not have the user write bit set.

B.

The file config.txt does not exist.

C.

The file config.txt has the immutable attribute set.

D.

The file config.txt has an ACL that does not permit deletion by others.

Full Access
Question # 49

A systems administrator downloads an application’s source files, compiles the application, and installs it per

the application’s installation instructions. When trying to run the application, the system states:

$ occmd

bash: occmd: command not found…

Running the locate command shows it does exist in the following location:

/opt/occmd/bin/occmd

Which of the following should the administrator do to allow the command to run properly? (Choose two.)

A.

sudo ln –s /opt/occmd/bin/occmd /usr/local/bin/occmd

B.

echo “export PATH=$PATH:/opt/occmd/bin” >> ~/.bashrc

C.

mv /opt/occmd ~/ && ln –s ~/occmd/bin/occmd ./occmd

D.

echo “#!/bin/bash \n ${which occmd}” > /usr/bin/occmd.sh

E.

sudo mv /opt/occmd/bin/occmd /etc/bin/

F.

cd /opt/occmd/bin && chmod +x ./occmd && restorecon –rv *

Full Access
Question # 50

A user tries to log in to the Linux console and receives the following message:

Your account has expired; Please contact your system administrator.

Which of the following commands was MOST likely run to create this behavior?

A.

passwd

B.

usermod

C.

userdel

D.

chage

Full Access
Question # 51

A Linux administrator receives the following while attempting to remove a file:

Which of the following commands will resolve the issue?

A.

cattr -i test.txt

B.

setfacl -m u:root:x test.txt

C.

chmod -0775 test.txt

D.

chcon -u system_u test.txt

Full Access
Question # 52

A user creates and installs a Linux VM on a local workstation. The VM can only connect to the local

workstation.

Which of the following BEST represents the default virtual network configuration in this instance?

A.

Host-only

B.

Bridged

C.

NAT

D.

Dual-homed

Full Access
Question # 53

A Linux user needs to connect to a remote email server named mail.foo.com through the SMTP port.

Which of the following commands will accomplish this task?

A.

traceroute mail.foo.com 25

B.

netcat mail.foo.com 25

C.

traceroute mail.foo.com 110

D.

netcat mail.foo.com 110

Full Access
Question # 54

During the final step of staging new Linux hardware, GRUB2 is installed to the system drive. Which of the

following BEST describes the role of GRUB2 in a new Linux installation?

A.

It provides a menu for creating administrator task shortcuts.

B.

It provides a menu for running special shell scripts.

C.

It provides a method to partition a hard drive.

D.

It provides a method to pass parameters to the Linux kernel on startup.

Full Access
Question # 55

A systems administrator is editing a service file for the web server. In order to continue testing, all web server processes must be shut down. The administrator accomplishes this with the following commands:

Based on the command output above, which of the following BEST explains how this was accomplished?

A.

Killing the parent process with -15 gives it a chance to kill all of the child processes.

B.

The -15 signal will allow the kill command to automatically seek out all child processes and kill them as well.

C.

The -15 signal tells the kill command to kill all processes matching the Apache string.

D.

The -15 signal gracefully kills the process and all Its parent and child processes.

Full Access