Number: 000-000 Passing Score: 800 Time Limit: 120 Min File Version: 1.0
Number: 000-000 Passing Score: 800 Time Limit: 120 Min File Version: 1.0
Number: 000-000 Passing Score: 800 Time Limit: 120 Min File Version: 1.0
Number: 000-000
Passing Score: 800
Time Limit: 120 min
File Version: 1.0
XK0-004
Version 1.0
QUESTION 1
Which of the following would be the BEST solution for a systems administrator to access the graphical user
environment of a Linux machine remotely?
A. VNC
B. KDE
C. X11
D. RPC
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.sfu.ca/computing/about/support/tips/remote-to-linux-with-gui.html
QUESTION 2
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?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.maketecheasier.com/fix-linux-no-space-left-on-device-error/
QUESTION 3
Which of the following is the BEST reason for not storing database files in the /var directory?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 4
SIMULATION
A junior system administrator had trouble installing and running an Apache web server on a Linux server. You
have been tasked with installing the Apache web server on the Linux server and resolving the issue that
prevented the junior administrator from running Apache.
INSTRUCTIONS
Install Apache and start the service. Verify that the Apache service is running with the defaults.
Typing “help” in the terminal will show a list of relevant commands.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
Explanation/Reference:
Explanation:
QUESTION 5
DRAG DROP
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.
Correct Answer:
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.rootusers.com/how-to-increase-the-size-of-a-linux-lvm-by-expanding-the-virtual-
machine-disk/
QUESTION 6
An administrator receives a warning about a file system filling up, and then identifies a large file located at /
tmp/largelogfile. The administrator deletes the file, but no space is recovered on the file system.
Which of the following commands would BEST assists the administrator in identifying the problem?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://access.redhat.com/solutions/2316
QUESTION 7
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
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/
ch-boot-x86
QUESTION 8
After starting a long-running script, a systems administrator needs to verify the frequency of what is filling up
the /var partition and kill it because it is consuming too much space.
Which of the following is the correct sequence given only a terminal is available?
A. 1. CTRL-C
2. bg
3. watch df /var
4. CTRL-C
5. fg
6. CTRL-Z
B. 1. CTRL-C
2. fg
3. watch df /var
4. CTRL-Z
5. bg
6. CTRL-Z
C. 1. CTRL-Z
2. bg
3. watch df /var
4. CTRL-C
5. fg
6. CTRL-C
D. 1. CTRL-Z
2. bg
3. watch df /var
4. CTRL-Z
5. fg
6. CTRL-C
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 9
A Linux administrator must identify a user with high disk usage. The administrator runs the # du –s /home/*
command and gets the following output:
Based on the output, User3 has the largest amount of disk space used. To clean up the file space, the
administrator needs to find out more information about the specific files that are using the most disk space.
A. df –k /home/User/files.txt
B. du –a /home/User3/*
C. du –sh /home/User/
D. find . –name /home/User3 -print
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://unix.stackexchange.com/questions/37221/finding-files-that-use-the-most-disk-space
QUESTION 10
A Linux server has multiple IPs. A Linux administrator needs to verify if the HTTP server port is bound to the
correct IP.
A. route
B. host
C. nslookup
D. netstat
E. ip
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.tecmint.com/find-listening-ports-linux/
QUESTION 11
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?
Explanation/Reference:
Reference: https://www.cyberciti.biz/faq/linux-append-text-to-end-of-file/
QUESTION 12
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
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.thegeekstuff.com/2012/04/curl-examples/
QUESTION 13
Which of the following BEST describes running on a Linux system?
A. Containers only need the namespaces functionally to run on a Linux system available since kernel 2.6.
B. Containers need a hypervisor to run a Linux system. Cgroups namespaces are functionalities used for the
kernel but not for running containers.
C. Containers only need the cgroups functionality for running on a Linux system. Namespaces is not a Linux
kernel functionality needed for creating and managing containers.
D. Containers use the cgroups and namespaces functionalities to isolate processes and assign hardware
resources to each of those isolated processes.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-ii-
working-linux-containers-lxc
QUESTION 14
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.
B.
C.
C.
D.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 15
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.
A. bg ping remotehost
B. fg ping remotehost
C. ping remotehost < results
D. ping remotehost &
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 16
A Linux administrator needs to switch from text mode to GUI. Which of the following runlevels will start the
GUI by default?
A. Runlevel 3
B. Runlevel 4
C. Runlevel 5
D. Runlevel 6
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: http://www.linfo.org/runlevel_def.html
QUESTION 17
A junior systems is configuring localization option environment variables. The administrator is given a
checklist of tasks with the following requirements:
Given this scenario, which of the following should be performed to meet these requirements? (Choose two.)
A. echo $LC_ALL
B. locale
C. cat $LC_ALL
D. export LANG = en_US.UTF-8
E. export $LANG = en_US.UTF
F. stty
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.tecmint.com/set-system-locales-in-linux/
QUESTION 18
An administrator needs to change the IP address on a server remotely. After updating the configuration files, a
network restart is needed. However, the administrator fears that when the network connection drops, the
network restart script will be killed before the new IP address has been set.
Which of the following commands would prevent the script from being killed?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 19
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
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 20
Which of the following BEST describes the purpose of the X11 system?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://en.wikipedia.org/wiki/X_Window_System
QUESTION 21
An administrator is analyzing a Linux server which was recently hacked.
Which of the following will the administrator use to find all unsuccessful login attempts?
A. nsswitch
B. faillock
C. pam_tally2
D. passwd
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 22
A junior administrator needs to unload an older video kernel module.
A. modprobe
B. insmod
C. rmmod
D. chmod
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/
Kernel_Administration_Guide/sec-Unloading_a_Module.html
QUESTION 23
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.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.golinuxhub.com/2014/03/how-to-allowblock-ssh-connection-from.html
QUESTION 24
A junior Linux administrator is setting up system-wide configuration settings. The goal is to ensure the PATH
environment variable includes the following locations for all users who log into a Linux system.
The administrator issues the following commands at the terminal:
Given this output, which of the following would be the BEST action for the administrator to perform to address
this issue?
A. Update the /etc/profile.d file using a text editor, navigate to the PATH element add the missing
locations, and run the bash_completion.sh script to update the changes.
B. Update the /etc/profile file using a text editor, navigate to the PATH element, add the missing
locations and run the . /etc/profile command to update the changes.
C. Update the /etc/profile.d file using a text editor, navigate to the PATH element, add the missing
locations, and reboot to update the changes.
D. Update the /etc/profile file using a text editor navigate to the PATH element, add the missing
locations, and restart the bash process to update the changes.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 25
A Linux systems administrator needs to provision multiple web servers into separate regional datacenters. The
systems architect has instructed the administrator to define the server infrastructure using a specific tool that
consumes a text-based file.
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 26
A Linux systems administrator needs to set permissions on an application with the following parameters:
The owner of the application should be able to read, write, and execute the application.
Members of the group should be able to read and execute the application.
Everyone else should not have access to the application.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 27
A junior Linux administrator is trying to verify connectivity to the remote host host1 and display round-trip
statistics for ten ICMP.
A. ping –c 10 host1
B. traceroute –c 10 host1
C. netstat host1
D. pathping –c 10 host1
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://shapeshed.com/unix-ping/
QUESTION 28
A junior Linux administrator is updating local name resolution to support IPv6. The administrator issues the
command cat /etc/hosts and receives the following output:
127.0.0.1 localhost
Which of the following actions should the administrator perform to accomplish this task?
A. Modify the /etc/hosts file, and add the ipv6 localhost entry to the file.
B. Modify the /etc/hosts file, and add the ::1 localhost entry to the file.
C. Modify the /etc/hosts file, and add the ipv4 localhost entry to the file.
D. Modify the /etc/hosts file, and add the 0.0.0.0 localhost entry to the file.
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 29
A Linux systems administrator needs to copy the contents of a directory named “working” on the local working
system to a folder /var/www/html on a server named “corporate-web”.
Which of the following commands will allow the administrator to copy all the contents to the web server?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://unix.stackexchange.com/questions/232946/how-to-copy-all-files-from-a-directory-to-a-
remote-directory-using-scp
QUESTION 30
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?
A. mtr www.comptia.org
B. tracert www.comptia.org
C. ping www.comptia.org
D. netstat www.comptia.org
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.lifewire.com/traceroute-linux-command-4092586
QUESTION 31
A Linux administrator has configured a Linux system to be used as a router. The administrator confirms that
two network adapters are properly installed and functioning correctly. In addition, the output of the iptables –L
command appears to contain a complete firewall configuration.
Which of the following commands does the administrator need to issue for the router to be fully functional?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 32
A systems administration team has decided to their systems as immutable instances. They keep the desired
state of each of their systems in version control and apply automation whenever they provision a new
instance. If there is an issue with one of their servers, instead of troubleshooting the issue they terminate the
instance and rebuild it using automation.
A. Inventory
B. Orchestration
C. Infrastructure as code
D. Agentless deployment
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 33
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.
A. Virtual machines
B. Type 2 hypervisor
C. Chroot jails
D. Containers
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 34
An operator finds a user is having issues with opening certain files.
Which of the following commands would allow the security administrator to list and check the SELinux
context?
A. ls –D
B. ls –a
C. ls –Z
D. ls -1
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security-
enhanced_linux/sect-security-enhanced_linux-working_with_selinux-selinux_contexts_labeling_files
QUESTION 35
A new corporate policy states that Bluetooth should be disabled on all company laptops. Which of the
following commands would disable the use of Bluetooth?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 36
A junior Linux administrator is installing a new application with CPU architecture requirements that have the
following specifications:
x64 bit
3.0GHz speed
Minimum quad core
The administrator wants to leverage existing equipment but is unsure whether the requirements of these
systems are adequate. The administrator issues the following command cat/proc/cpuinfo. The output of
the command is as follows:
Which of the following is the recommended course of action the administrator should take based on this
output?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 37
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
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-
on-a-linux-server
QUESTION 38
A Linux server needs to be accessed, but the root password is not available.
Which of the following would BEST allow an administrator to regain access and set a new known password at
the same time?
A. Boot into a single-user mode and reset the password via the passwd command.
B. Boot into a single-user mode and reset the password by editing the /etc/passwd file.
C. Boot into a single-user mode and reset the password by editing the /etc/shadow file.
D. Boot into a single-user mode and reset the password via the chage command.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://phoenixnap.com/kb/how-to-change-root-password-linux
QUESTION 39
A Linux administrator wants to fetch a Git repository from a remote Git server.
A. git checkout
B. git clone
C. git merge
D. git config
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
QUESTION 40
An administrator needs to create a shared directory in which all users are able, write, and execute its content
but none of the regular users are able to delete any content.
A. rwxrwxrwt
B. rwxrwxrws
C. rwxrwxrwx
D. rwxrwxrw*
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 41
A systems administrator has finished building a new feature for the monitoring software in a separate Git
branch.
Which of the following is the BEST method for adding the new feature to the software’s master branch?
A. Merge the changes from the feature branch to the master branch.
B. Save the changes to the master branch automatically with each Git commit.
C. Clone the feature branch into the master branch.
D. Pull the changes from the feature branch into the master branch.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
QUESTION 42
Which of the following will provide a list of all flash, external, internal, and SSD drives?
A. lspci
B. lsmod
C. lsblk
D. lsusb
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.linux.com/learn/intro-to-linux/2017/3/how-format-storage-devices-linux
QUESTION 43
Which of the following configuration management tools is considered agentless?
A. Ouppet
B. Salt
C. Ansible
D. Chef
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.intigua.com/blog/puppet-vs.-chef-vs.-ansible-vs.-saltstack
QUESTION 44
An administrator reviews the following configuration file provided by a DevOps engineer:
Which of the following would the application parsing this file MOST likely have to support?
A. YAML
B. AJAX
C. JSON
D. SOAP
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 45
Which of the following is a difference between YAML and JSON?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.json2yaml.com/yaml-vs-json
QUESTION 46
A junior administrator of a physical server receives log messages indicating the out-of-memory killer has been
active. All memory slots are in use on the motherboard, but additional disk space is available. Space has been
allocated for a swap file.
Which of the following should the administrator use to reduce the output of memory messages?
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 47
A junior Linux administrator is optimizing a system in which an application needs to take priority 0 when
running the process. The administrator runs the ps command and receives the following output:
Given this scenario, which of the following steps will address this issue?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 48
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?
A.
B.
C.
D.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 49
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
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/
sn-automating-installation
QUESTION 50
A Linux administration is using a Linux system as a router. During the tests, the administrator discovers that IP
packets are not being sent between the configured interfaces.
Which of the following commands enables this feature for IPv4 networks?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 51
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?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Reference: https://askubuntu.com/questions/215505/how-do-you-monitor-the-progress-of-dd
QUESTION 52
A Linux administrator needs the “tech” account to have the option to run elevated commands as root.
A. $ su – tech –c “/bin/bash”
B. # usermod –aG wheel tech
C. # sudo –I tech
D. # groupadd –u tech –g root
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 53
Which of the following is the purpose of the vmlinux file on a Linux system?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://en.wikipedia.org/wiki/Vmlinux
QUESTION 54
Ann, a junior systems administrator, is required to add a line to the /etc/yum.conf file. However, she
receives the following error message when she tries to add the line:
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 55
A Linux administrator needs to take stock of USB devices attached to the system.
A. lspci
B. lsusb
C. cat /proc/USB
D. modprobe -–usb
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://linuxhint.com/list-usb-devices-linux/
QUESTION 56
Given the output below:
Which of the following commands can be used to remove MyPhoto.jpg from the current directory?
A. unlink ./MyPhoto.jpg
B. del Pictures/photo.jpg
C. rm –rf ./Pictures
D. rm –f MyPhoto.jpg
E. ln –rm ./Pictures/photo.jpg
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
QUESTION 57
Which of the following server roles would assign a host IP address?
A. DHCP
B. NTP
C. DNS
D. SSH
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 58
Which of the following commands would show the default printer on a Linux system?
A. lpr
B. lpq
C. lpstat
D. lspci
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://superuser.com/questions/123576/show-default-linux-printer
QUESTION 59
A system administrator has set up third-party log aggregation agents across several cloud instances. The
systems administrator wants to create a dashboard of failed SSH attempts and the usernames used.
A. /var/log/audit/audit.log
B. /var/log/kern.log
C. /var/log/monitor
D. /etc/rsyslog.conf
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 60
A systems administrator must clean up all application files in the directory /var/log/app. However, the
company’s security policy requires the files to be kept on the backup server for one year. The Linux server has
only the tar and bzip2 packages installed.
Which of the following commands will package and compress the files?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 61
In order to comply with new security policies, an administrator needs to prevent the SSH server from using
insecure algorithms.
A. /etc/ssh/sshd_config
B. /etc/ssh/ssh_config
C. ~/.ssh/ssh_config
D. /etc/ssh/known_hosts
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 62
Which of the following configuration files should be modified to disable Ctrl-Alt-Del in Linux?
A. /etc/inittab
B. ~/.bash_profile
C. /etc/securetty
D. /etc/security/limits.conf
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.linuxtechi.com/disable-reboot-using-ctrl-alt-del-keys/