Special New Year Discounts Limited Time 55% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 63r59951

XK0-004 CompTIA Linux+ Certification Exam Questions and Answers

Questions 4

Which of the following server roles utilize a heartbeat/polling process? (Choose two.)

Options:

A.

Proxy

B.

Certificate authority

C.

Logging

D.

File server

E.

Cluster

F.

Load balancer

Buy Now
Questions 5

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?

Options:

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

Buy Now
Questions 6

A Linux administrator needs to add some files in a directory to the Git repository but must exclude some local

.tmp files that are occasionally created by the scripts.

Which of the following is the BEST way to accomplish this task?

Options:

A.

git rm .tmp

B.

git add -x .tmp *

C.

echo .tmp >> .gitignore

D.

rm -rf .tmp

Buy Now
Questions 7

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?

Options:

A.

echo “1” > /proc/sys/net/ipv4/ip_forward

B.

echo “0” > /proc/sys/net/ipv4/tcp_abort_on_overflow

C.

echo “0” > /proc/sys/net/ipv4/max_connections

D.

echo “1” > /proc/sys/net/ipv4/ip_default_ttl

Buy Now
Questions 8

A systems administrator needs to conduct maintenance on a server.

Which of the following commands will place the administrator in the appropriate runlevel?

Options:

A.

init 0

B.

telinit 1

C.

init 3

D.

telinit 6

Buy Now
Questions 9

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?

Options:

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.

Buy Now
Questions 10

A Linux administrator recently reprovisioned a new corporate web server to replace a legacy one. To minimize

the impact on the company's users, the administrator modified the network and DNS settings of the new server

to be the same as the legacy server.

When attempting to log in to the new server remotely over SSH, the following error message is displayed:

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

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

Options:

A.

Restart the network services on both the remote server and the local machine.

B.

Remove the entry for the web server from the known_hosts file on the local machine.

C.

Update the /etc/hosts file on the remote server and local machine.

D.

Add the administrator's public key to the authorized_keys on the remote server.

Buy Now
Questions 11

An administrator is trying to optimize a connection to an off-site NFS server.

Which of the following commands would BEST display the problems with packet sizes between hops on the network?

Options:

A.

tracepath

B.

ping

C.

tracert

D.

nmap

Buy Now
Questions 12

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?

Options:

A.

cat /proc/sys/net/ipv4/ip_route > 1

B.

echo “1” > /proc/sys/net/ipv4/ip_forward

C.

echo “1” > /proc/sys/net/ipv4/ip_route

D.

echo “1” > /proc/sys/net/ipv4/ip_net

Buy Now
Questions 13

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.

Which of the following is the BEST reason to do this?

Options:

A.

To document the infrastructure so it can be included in the system security plan

B.

To ensure the administrator follows the planning phase of the system development life cycle

C.

To define the infrastructure so it can be provisioned consistently with minimal manual tasks

D.

To validate user requirements have been met within each regional datacenter for compliance

Buy Now
Questions 14

Which of the following boot methods can a Linux administrator use to boot a Linux server remotely via a

network interface card instead of a local disk?

Options:

A.

NTP

B.

PXE

C.

NFS

D.

Kickstart

Buy Now
Questions 15

A security team informs the Linux administrator that a specific server is acting as an open relay.

To which of the following is the security team referring?

Options:

A.

The server is running the SSH service and is open to the Internet, allowing outside sources to log into the server without source IP address filtering.

B.

The server is acting as an unmanaged router, open to the Internet, and is allowing outside Internet traffic into the network with no filtering.

C.

The server is acting as a web proxy and allowing outside unauthenticated sources to connect to the server, effectively hiding the source’s IP address for malicious activities.

D.

The server has an email service configured to allow outside sources to send email to other external parties on the Internet without validation.

Buy Now
Questions 16

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.?

Options:

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

Buy Now
Questions 17

An administrator needs to generate a list of services that are listening on TCP and/or UDP ports. Which of the following tools should the administrator use?

Options:

A.

ethtool

B.

route

C.

netstat

D.

portmap

Buy Now
Questions 18

A Linux system is running normally when the systems administrator receives an alert that one application spawned many processes. The application is consuming a lot of memory, and it will soon cause the machine to become unresponsive. Which of the following commands will stop each application process?

Options:

A.

kill ‘pidof application’

B.

killall application

C.

kill -9 ‘ps –aux | grep application’

D.

pkill -9 application

Buy Now
Questions 19

A user has connected a Bluetooth mouse to a computer, but it is not working properly. Which of the following commands should the systems administrator use to fix the issue?

Options:

A.

lsmod –i bluetooth

B.

insmod bluetooth

C.

modprobe –r bluetooth

D.

depmod –i bluetooth

Buy Now
Questions 20

A junior systems administrator is diagnosing an issue with latency. The administrator issues the command mtr www.comptia.org at a terminal and receives the following output:

Given this scenario and the output, which of the following should be reported to the network team for investigation? (Choose two.)

Options:

A.

Host 1 is set to filter ICMP reply packets.

B.

Host 1 is set to filter ICMP echo packets.

C.

Host 2 is experiencing high packet loss, indicating the link is overloaded.

D.

Host 2 is experiencing low bandwidth, indicating the ISP is blocking traffic.

E.

Host 3 is set to filter ICMP reply packets.

F.

Host 3 is set to filter ICMP echo packets.

Buy Now
Questions 21

The development team has automated their software build process so each time a change is submitted to the source code repository, a new software build is compiled. They are requesting that the Linux operations team look into automating the deployment of the software build into the test environment. Which of the following is the benefit to the development team for implementing deployment automation?

Options:

A.

To ensure the build commits are also deployed to the test environment

B.

To enable notifications when builds are deployed to the test environment

C.

To ensure software builds in test are not accidentally deployed to production

D.

To streamline the deployment process for deploying builds into test environments

Buy Now
Questions 22

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?

Options:

A.

chmod o+s

B.

chmod u+s

C.

chmod +s

D.

chmod g+s

Buy Now
Questions 23

Which of the following would be the BEST solution for a systems administrator to access the graphical user environment of a Linux machine remotely?

Options:

A.

VNC

B.

KDE

C.

X11

D.

RPC

Buy Now
Questions 24

A user cannot write files to the /home/user directory. The junior Linux administrator runs the following commands:

Which of the following BEST represents why the user cannot write files?

Options:

A.

The filesystem is out of inodes.

B.

The filesystem is out of file space.

C.

The filesystem is not configured for the user to write to it.

D.

The filesystem does not have a group write permission.

Buy Now
Questions 25

An administrator needs to kill the oldest Bash shell running in the system. Which of the following commands

should be issued to accomplish this task?

Options:

A.

ps axjf | grep bash to obtain PID

kill -9 PID

B.

ps –eo pid,etime,cmd | grep bash (to obtain PID)

kill -9 PID

C.

ps –eo pid,etime| grep bash (to obtain PID)

killall -9 PID

D.

killall -15 -o bash

Buy Now
Questions 26

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

Which of the following will accomplish this task?

Options:

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.

Buy Now
Questions 27

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?

Options:

A.

rm -Rf ~/.*

B.

fsck -y /dev/sda1

C.

df -i

D.

fdisk /dev/sda

Buy Now
Questions 28

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?

Options:

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.

Buy Now
Questions 29

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?

Options:

A.

free : swapoff / swapfile ; swapon -a

B.

mkswap /swapfile; swapon –a

C.

fallocate –l 2G /swapfile && swapon –a

D.

echo “1” > /proc/meninfo ; swapon / swapfile

Buy Now
Questions 30

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.)

Options:

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 *

Buy Now
Questions 31

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 32

A junior systems administrator is scanning archive.tar files with an antivirus scanner. The administrator is given the following tasks:

  • List all files that are in the archive.tar files.
  • Extract all files from the archive.tar files.

Which of the following actions should be performed to meet these requirements? (Choose two.)

Options:

A.

tar -tvf archive.tar

B.

tar -xf archive.tar

C.

tar -A archive.tar

D.

tar -av archive.tar

E.

tar -r archive.tar

F.

tar -uvz archive.tar

Buy Now
Questions 33

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?

Options:

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

Buy Now
Questions 34

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 35

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

Options:

A.

grub-mkconfig

B.

grub.cfg

C.

update-grub

D.

grub2-mkconfig

Buy Now
Questions 36

A Linux administrator is setting up a testing environment and needs to connect to a separate testing server using the production server name. The administrator needs to override the hostname that the DNS is returning in order to use the test environment. Which of the following commands should be run on each of the testing systems to BEST meet this goal?

Options:

A.

# hostnamectl set-hostname “192.168.1.100 production.company.com”

B.

# grep –i IP “${ip addr show} production.company.com” > /etc/resolv.conf

C.

# ip addr add 192.168.1.100/24 dev eth0 && rndc reload production.company.com

D.

# echo “192.168.1.100 production.company.com” >> /etc/hosts

Buy Now
Questions 37

A user wants to use terminal services from a Windows workstation to manage a Linux server. Which of the following should be installed on the Linux server to enable this functionality?

Options:

A.

VNC

B.

rdesktop

C.

SPICE

D.

XRDP

Buy Now
Questions 38

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?

Options:

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.

Buy Now
Questions 39

An administrator is tasked with increasing the size of the volume /dev/vg/lv to 20GB. Which of the following BEST illustrates the steps the administrator should take?

Options:

A.

vgextend –L20G /dev/vg/lv; resizelv /dev/vg/lv

B.

parted –L20G /dev/vg/lv; remount /dev/vg/lv

C.

mkfs –L20G /dev/vg/lv; tune2fs /dev/vg/lv

D.

lvextend –L20G /dev/vg/lv; resize2fs /dev/vg/lv

Buy Now
Questions 40

A directory called /employee is shared with many employees in a company. New hardware was acquired, and the systems administrator needs to back up all files in /employee before the server is replaced.

Which of the following commands should be used to back up all the files and compress them to use little space in the filesystem?

Options:

A.

tar -zcvf backup.tar.gz /employee

B.

tar -zxvf backup.tar.gz /employee

C.

tar -Cvf backup.tar.gz /employee

D.

tar -Tpf backup.tar.gz /employee

Buy Now
Questions 41

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 42

Which of the following commands would show the default printer on a Linux system?

Options:

A.

lpr

B.

lpq

C.

lpstat

D.

lspci

Buy Now
Questions 43

A Linux administrator is using a public cloud provider to host servers for a company’s website. Using the provider’s tools, the administrator wrote a JSON file to define how to deploy the servers. Which of the following techniques did the administrator use?

Options:

A.

Infrastructure as code

B.

Build automation

C.

Platform as a service

D.

Automated configuration

Buy Now
Questions 44

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?

Options:

A.

passwd

B.

usermod

C.

userdel

D.

chage

Buy Now
Questions 45

Which of the following commands allow an administrator to determine if the current system is a virtual machine?

Options:

A.

lspci

B.

mdadm

C.

vmstat

D.

vgdisplay

Buy Now
Questions 46

A Linux systems administrator is troubleshooting an issue with the /home directory running out of space. The

administrator needs to determine which /home directories are using the most space. Which of the following

commands should be used?

Options:

A.

du

B.

lvs

C.

df

D.

fsck

Buy Now
Questions 47

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?

Options:

A.

ls –D

B.

ls –a

C.

ls –Z

D.

ls -1

Buy Now
Questions 48

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
Exam Code: XK0-004
Exam Name: CompTIA Linux+ Certification Exam
Last Update: Jan 18, 2022
Questions: 320

PDF + Testing Engine

$72  $159.99

Testing Engine

$54  $119.99
buy now XK0-004 testing engine

PDF (Q&A)

$45  $99.99
buy now XK0-004 pdf