Summer Sale Special - 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: c4sdisc65

Note! XK0-004 has been withdrawn. The new exam code is XK0-005

XK0-004 CompTIA Linux+ Certification Exam Questions and Answers

Question # 6

Due to security policies, a restriction was implemented that forbids direct access to the database server. The

junior administrator needs to connect using SSH tunneling. Which of the following commands allows the junior

administrator to connect from a desktop?

A.

ssh –L dbserver.local:5432:localhost:95432 postgres@dbserver.local

B.

ssh –L 5432:localhost dbserver.local:5432 postgres

C.

ssh –L 95432:localhost postgres@dbserver.local

D.

ssh –L 9432:localhost:5432 postgres@dbserver.local

Full Access
Question # 7

A Linux administrator attempts to install the package newprogram.x86_64.rpm using a package manager.

The administrator receives a warning indicating the command that was run was using a deprecated package manager. Which of the following commands should the administrator use to avoid the warning and install the newprogram.x86_64.rpm program?

A.

# dnf install newprogram.x86_64.rpm

B.

# rpm -e newprogram.x86_64.rpm

C.

# dpkg -i newprogram.x86_64.rpm

D.

# apt-get install newprogram.x86_64.rpm

Full Access
Question # 8

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

Which of the following BEST describes the difference between a container and a VM?

A.

Containers share host OS libraries and a kernel, while VMs have their own libraries and kernel.

B.

Containers are larger than VMs.

C.

VMs share host libraries and a kernel, while containers have their own libraries and kernel.

D.

VMs are larger than containers.

Full Access
Question # 10

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?

A.

VNC

B.

rdesktop

C.

SPICE

D.

XRDP

Full Access
Question # 11

A developer reports a web sever is unable to connect to the database server. The developer reviews the following output from each server:

Web server output:

XK0-004 question answer

Database server output:

Which of the following will resolve the issue?

A.

Start the database on the web server and enable it to survive reboot

B.

Add a staoc route between the two networks

C.

Remove the drcp command on the database firewall

D.

Enable the network interfaces on the database server

Full Access
Question # 12

A raw VM image is being compressed with bzip2 and copied to a flash drive at /dev/hdb for off-site use by

the marketing department. Which of the following command lines accomplishes this task?

A.

mv /vm/mkgt.img | bzip2 /dev/hdb/mkgt.img.bz2

B.

bzip2 –c /vm/mktg.img | dd of=/dev/hdb

C.

cp /vm/mktg.img | bzip2 /dev/hdb/mktg.img.bz2

D.

cp –a –r /vm/mktg.img bzip2 /dev/hdb/mktg.img.zip

Full Access
Question # 13

A Linux administrator needs to configure a new firewall without an existing ACL to allow incoming web traffic.

The firewall must log the allowed network traffic. Which of the following command sequences would

accomplish this task when they are executed in order?

A.

iptables –A INPUT –p tcp --dport 80 –J LOG

iptables –A INPUT –p tcp --dport 443 –J LOG

iptables –I INPUT –p tcp --dport 80 –J ACCEPT

iptables –I INPUT –p tcp --dport 443 –J ACCEPT

B.

iptables –I INPUT –m multiport –p tcp --dports 80,443 –J LOG

iptables –I INPUT –m multiport –p tcp --dports 80,443 –J ACCEPT

C.

iptables –A INPUT –m multiport –p tcp --dports 80,443 –J LOG

iptables –A INPUT –m multiport –p tcp --dports 80,443 –J ACCEPT

D.

iptables –A INPUT –p tcp --dport 80 –J ACCEPT

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

iptables –A INPUT –p tcp --dport 80 –J LOG

iptables –A INPUT –p tcp --dport 443 –J LOG

Full Access
Question # 14

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

A user is unable to write data to an NFS datastore at /mnt/storage. A df command indicates 50% free

inodes.

Which of the following commands should the user attempt NEXT to diagnose the situation?

A.

df -h /mnt/storage

B.

du -sh /mnt

C.

fdisk -l /mnt/storage

D.

df -i /mnt/storage

Full Access
Question # 16

Which of the following is used on the client to boot a Linux system from a TFTP server?

A.

HTTP

B.

GRUB

C.

EFI

D.

PXE

Full Access
Question # 17

An administrator is installing a new kernel but is getting an error indicating the filesystem is out of space. A disk

usage check shows / has plenty of space.

Which of the following BEST represents where the administrator should check next?

A.

/var

B.

/proc

C.

/boot

D.

/etc

Full Access
Question # 18

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?

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

Full Access
Question # 19

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

A junior systems administrator is creating a cron job. The cron job requirements are as follows:

Run the hello.sh script every hour (24 times in one day).

Run it on Monday only.

Given this scenario, which of the following crontab options should be configured to meet these requirements?

A.

0 *** 1 hello.sh

B.

0 24 ** Monday hello.sh

C.

24 *** Monday hello.sh

D.

1 *** 0 hello.sh

Full Access
Question # 21

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.

Which of the following files should be watched by the agents?

A.

/var/log/audit/audit.log

B.

/var/log/kern.log

C.

/var/log/monitor

D.

/etc/rsyslog.conf

Full Access
Question # 22

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.

Which of the following commands would BEST accomplish these tasks?

A.

chmod 710

B.

chmod 730

C.

chmod 750

D.

chmod 760

Full Access
Question # 23

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

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.

Full Access
Question # 24

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

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?

A.

nohup service network restart

B.

service network restart &

C.

echo “service network restart” | at now

D.

dg service network restart

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.

XK0-004 question answer

Full Access
Question # 27

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

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?

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 29

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

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

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

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?

A.

kill ‘pidof application’

B.

killall application

C.

kill -9 ‘ps –aux | grep application’

D.

pkill -9 application

Full Access
Question # 33

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

Which of the following techniques would BEST ensure the setup and desired state of a server are consistently maintained?

A.

Configuration management

B.

Network automation

C.

Test automation

D.

Change control management

Full Access
Question # 35

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?

A.

NTP

B.

PXE

C.

NFS

D.

Kickstart

Full Access
Question # 36

A junior Linux administrator is installing patches using YUM. The administrator issues the following command:

yum list installed

The output of the command is as follows:

XK0-004 question answer

Given this scenario and the output, which of the following should the administrator do to address this issue?

A.

renice –n 9 –p 5180

B.

killall yum

C.

ps –ef | grep yum

D.

top | grep yum

Full Access
Question # 37

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.

Full Access
Question # 38

Joe, a user, asks a systems administrator to schedule the daily execution of a custom script.

Which of the following commands will allow the systems administrator to set up Joe’s cron job?

A.

crontab -r -u joe

B.

crontab -e -u joe

C.

crontab -n -u joe

D.

crontab -l -u joe

Full Access
Question # 39

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?

A.

lspci

B.

lsusb

C.

cat /proc/USB

D.

modprobe -–usb

Full Access
Question # 40

Which of the following will MOST likely fix the issue?

A.

Add more CPUs to the server

B.

Replace the network cable

C.

Add a second web server and a load balancer

D.

Add more RAM to the server

E.

Exclude the web root directory from antivirus scanning

Full Access
Question # 41

Some Bash scripts arc being versioned and stored in a Git repository Which of the following commands should the Linux administrator use to exclude tmp Wes from being added to the repository during any code adds and commits?

A.

export GIT_IGNORE=,tmp

B.

alias git=git commit --ignore=, tmp

C.

echo .gitignore >> * tmp

D.

git config -- blacklist = tmp

Full Access
Question # 42

After running an Nmap scan on a local area network, a penetration tester notices several older Linux servers have port 23 open Which of the following should the systems administrator do as a secunty best practice?

A.

Use a non-standard port for Telnet

B.

Disable and umnstall the Telnet service

C.

Ensure the kernels are up to date with the latest patches

D.

Configure the firewall to allow Telnet access only from trusted networks

Full Access
Question # 43

A developer has contacted a systems administrator because an application is not receiving a response from the client. The application must purge the message queue before terminating. Which of the following should the systems administrator perform in order to BEST address the issue?

A.

Send the SIGHUP signal with the kill command.

B.

Send the signal with the command.

C.

Send the SIGSTOP signal with the kill command.

D.

Send the SIGTERN signal with the kill command.

Full Access
Question # 44

A Linux administrator needs to implement a secunty policy that prevents all connections from the marketing department that has the IP subnet 10.10.10.0/24 from reaching the current server. Which of the following commands can BEST accomplish this task?

A.

iptables -A output -s 10.10.10.0/24 -j DROP

B.

iptables -A input -s 10.10.10.0/24 -j ACCEFT

C.

iptables -A forward -s 10.10.10.0/24 -j ACCEPT

D.

iptables -A input -s 10.10.10.0/24 -j DROP

Full Access
Question # 45

An administrator was updating several systems and received the following warning for each one: No support Locale en_US.UTF-8. Which of the following should the administrator run to eliminate this warning?

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 46

A user deleted a log file because the disk was running out of space on a system running a mission-critical application. Even though the log file was large, the available disk space did not increase. The systems administrator determines the following files are still open:

XK0-004 question answer

Which of the following should the systems administrator perform to BEST free up disk space?

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 47

A user cannot reach the internet from a workstation. A systems administrator performs diagnostics with the following results:

XK0-004 question answer

Which of the following is the cause for lack of internet connectivity?

A.

The workstation is not using a DNS server.

B.

The network gateway is not reachable from the workstation.

C.

The incorrect network mask is set for the interface enp2so on the workstation.

D.

The company's firewall is blocking connections from the workstation to the internet.

Full Access
Question # 48

An end user is trying to execute a file within a different directory The end user executes the following command:

XK0-004 question answer

Which of the following commands should the Linux administrator use to run the shell scnpt within that folder?

A.

chmod 0644

B.

chmod g-x myabc.sh

C.

chmod 0755

D.

chmod u-x myabc,sh

Full Access
Question # 49

A Linux administrator is optimizing a system in which an application needs to change the priority to one for the running process: 9014. Which of the following commands will achieve this task?

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 50

A systems administrator scheduled a new kernel module to replace an existing module while the system is running. Which of the ktoung wi accompfctfi ths task?

A)

XK0-004 question answer

B)

XK0-004 question answer

C)

XK0-004 question answer

D)

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 51

An administrator needs to run the rescript. sh script stored on the /nr.t/disk Wesystem. but permission is denied;

XK0-004 question answer

The system options are:

XK0-004 question answer

The script properties are:

XK0-004 question answer

Which of the following will resolve the issue?

A.

mount -o remount, rw /mnt/disk

B.

chcon-u system_u -t admin_home_/mnt/disk/ myscript.sh

C.

mount -o remount, exec .mnt/disk

D.

setenforce permissive

Full Access
Question # 52

The ability to add web servers dynamically during peak user activity and remove them when user activity decreases is an example of:

A.

configuration automation

B.

build automation

C.

infrastructure automation

D.

inventory management

Full Access
Question # 53

A Linux administrator wants to load the KVM module into the kernel. Which of the following commands should the administrator use?

A.

modporbe kvm

B.

rmmod kvm

C.

insmod kvm

D.

depmod kvm

Full Access
Question # 54

An administrator wrote the following script, but it failed:

XK0-004 question answer

Which of the following is MOST likely the error in the script?

A.

Line 1 should read: #!/bin/sh

B.

Line 4 should read: for line in $ { FILES}

C.

Line 6 should read: OWNER-'ls -1 ${LINE} I cut -d " " -f 1'

D.

Line 7 should read: echo '$(line) - S{OWNER)'

Full Access
Question # 55

A Linux administrator has configured a local named caching server to reduce the amount of time to resolve common DNS addresses. The server resolves using the external server, however; the administrator wants to avoid this configuration. The administrator verifies the named, conf settings to confirm the following relevant settings:

The administrator then runs dig twice to look up an external address and receives the following relevant output the second time.

XK0-004 question answer

Which of the following should the administrator do to correct the configuration?

A.

Modify /etc/resolve.config and set nameserver to 127.0.0.1

B.

Add 1270.0.1 to the forwards in the named confi file.

C.

Alias the dig commands to use nslookup instead.

D.

Configure the name service in system to be masked

Full Access
Question # 56

A system administrator is troubleshooting a web server that runs in a container. After the log is retained, the container occasionally stops logging to a log file. Fortunately, the vendor provides a custom signal that allows the application to reconnect to the log file. Which of the following would be BEST for the administrator to run the containers?

A.

Kill –HUP 1

B.

Kill –USR 1

C.

Kill –TEAM 1

D.

Kill –Kill 1

Full Access
Question # 57

A system administrator is setting up a cron job that will copy thousands files from a remote directory on a scheduled basic. The file contents should retain their original permissions, including and group ownership, and the cron job should run for the least amount of the possible. Which of the following is the BEST program to use in this situation?

A.

Rsync

B.

Curl

C.

Scp

D.

Wget

E.

sftp

Full Access
Question # 58

A new packages repository named repo10 has been installed on mirror site. A Linux administrator wants to use this new repository for local package installations. In which of the following locations should the administrator store the configuration information for the repo10 repository?

A.

/etc/yum.reps.d/repo10.Repo

B.

/etc/yum_repo.d/repo10

C.

/etc/yum.reps.d/repo10

D.

/etc/yum.conf

Full Access
Question # 59

A Linux administrator is investigating an issue with an internal Linux server that is unable to resolve the following internal addresses:

XK0-004 question answer

The administrator runs the following commands as part of troubleshooting:

XK0-004 question answer

Which of the following is MOST likely resolve the issue?

A.

Allow outbound DNS traffic to the internal DNS server.

B.

Add a public DNS for fileshare, example, internal.

C.

Install a caching DNS server on the local workstation.

D.

Update resolve, conf to use the internal DNS server.

Full Access
Question # 60

An administrator is utilizing an automation engine than uses SSH to run commands on remote systems. Which of the fctowng does this describe?

A.

Inventory

B.

Agentless archrtecture

C.

Build automation

D.

Version control

Full Access
Question # 61

A user submitted a ticket stating that the development environment is reporong the device does not have any space left. The user's application creates a lot of small files and does not remove these files when the application crashes. Given the following output:

XK0-004 question answer

Which of the following is the MOST likely cause for the error message indicating a lack of space?

A.

There are no free nodes

B.

SELmux is runrwig

C.

The appfccabon output is too large

D.

Directory permssions are too restrictive

Full Access
Question # 62

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

Which of the following commands should a system administrator use to configure a passwordless login to remote system? (Select TWO.)

A.

Cp

B.

Ssh-agent

C.

Ssh-copy-id

D.

Ssh-keygen

E.

Ssh-add

F.

openssl

Full Access
Question # 64

A remote server reverts to the incorrect time when it is restarted. Which of the following will save the correct time to the BIOS clock once the time and date have been set on the server?

A.

btime -- settime

B.

btime -- setdate

C.

hwclock -- systohc

D.

date -- setclock

Full Access
Question # 65

A Linux administrator needs to know the MAC address of the server’s gateway.

Which of the following commands should the administrator run to obtain this information?

A.

arp -gw

B.

arp -a

C.

arp -gwi

D.

arp -gtw

Full Access
Question # 66

A systems administrator wants to increase the existing drive space on a Linux server with a software RAID. After physically adding the new drive to the system, and then adding the drive to the RAID array,

the administrator notices the available drive space has not increased. A status of the array shows the new drive and the original storage space:

md0 : active Raid sdd1[3]S sdc1[2] sdb1[1] sda1[0]

954585654 blocks level5 64K chunk algorithm 2 [3/3] [UUU]

Which of the following should the administrator do to make all storage space available on the RAID array?

A.

Run hdparm to alert the kernel to a new drive.

B.

Convert the new drive to a hot spare.

C.

Set the RAID type to a RAID 1.

D.

Grow the array size to four members.

Full Access
Question # 67

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

A Linux administrator is running a script that runs a Java application but receives the following error:

Error: Java_Home is not set

Java is installed on the Linux server and java –version returns a value. Which of the following should the administrator add to the script to resolve this issue?

A.

Export PATH-$PATH: $JAVA_HOME

B.

Echo ‘which java > $JAVA_HOME

C.

Export Java_Home which java

D.

Set JAVA_HOME –which java

Full Access
Question # 69

An administrator is provisioning and attaching a secondary disk to a Linux server as a data drive. Which Of the following commands the administrator use to find the UUID Of the disk so the drive can be mounted upon boot?

A.

blkid

B.

isblk

C.

2label

D.

fstab

Full Access
Question # 70

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

An administrator received a request from a security officer to eliminate a blacklisting set called internal-blocked the company is using in the iptables firewall.

Which of the following commands will complete the task?

A.

ipset swap internal-blocked none

B.

ipset destroy internal-blocked

C.

ipset del internal-blocked

D.

ipset remove internal-blocked

Full Access
Question # 72

A security team informs the Linux administrator that a specific sever is acting as a n pen relay. To which of the following is the security team referring?

A.

The server it running the SSH service and is open to the internet allowing outside sources to log in to the server without source IP address filtering.

B.

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

C.

The server is acting as a web proxy and allowing outside unauthenticated sources to connect to the server, effectively hiding tie 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.

Full Access