Summer Special Sales Coupon - 55% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: c4s55disc

XK0-004 PDF

$49.5

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

XK0-004 PDF + Testing Engine

$79.2

$175.99

3 Months Free Update

  • Exam Name: CompTIA Linux+ Certification Exam
  • Last Update: Sep 29, 2022
  • Questions and Answers: 476
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

XK0-004 Engine

$59.4

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

XK0-004 CompTIA Linux+ Certification Exam Questions and Answers

Question # 6

A Linux systems administrator installed a new web server, which failed while attempting to start. The

administrator suspects that SELinux is causing an issue and wants to temporarily put the system into

permissive mode. Which of the following would allow the administrator to accomplish this?

A.

echo SELINUX=PERMISSIVE >> /etc/sysconfig/selinux

B.

setenforce 0

C.

sestatus 0

D.

chcon httpd_sys_content_t /var/

Full Access
Question # 7

Ann, a user, has created a new directory and noticed that permissions on the new directory are as follows:

drwx------. 1 ann ann 0 Jun 11 08:20 work

Which of the following should the administrator do to restore default permissions for newly created directories?

A.

Change umask value in /etc/profile.

B.

Run chmod command to update permissions.

C.

Modify directory ownership to ann:ann with chown.

D.

Execute chattr command to restore default access.

Full Access
Question # 8

Users are receiving permission-denied messages when trying to access a spreadsheet file within the company’s filesystem. A Linux administrator receives a ticket and begin to investigate the following output:

XK0-004 question answer

Which of the following command would produce the presented output?

A.

Top

B.

nice

C.

grep

D.

isof

Full Access
Question # 9

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.

XK0-004 question answer

The administrator issues the following commands at the terminal:

XK0-004 question answer

Respectively, the output of these commands is as follows:

XK0-004 question answer

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.

Full Access
Question # 10

Given that a company’s policy states that users cannot install third-party tools on Window servers, which of the following protocols will allow a Linux GUI to connect to a Windows server?

A.

VNC

B.

NX

C.

RDP

D.

X11

Full Access
Question # 11

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?

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.

Full Access
Question # 12

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

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

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

A systems administrator needs to conduct maintenance on a server.

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

A.

init 0

B.

telinit 1

C.

init 3

D.

telinit 6

Full Access
Question # 16

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

XK0-004 question answer

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

A.

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

B.

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

C.

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

D.

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

E.

racadm --remove /dev/sdb1

F.

racadm --fail /dev/sdb1

Full Access
Question # 17

A systems administrator notices a large number of autoloaded device modules are no longer needed and decides to do a cleanup of them. Which of the following commands will accomplish this task?

A.

rmmod -c

B.

depmod -r

C.

insmod -c

D.

modprobe -r

Full Access
Question # 18

A systems administrator needs to run the yum update command two hours after employees log off and leave

for the day on Friday.

Which of the following is the BEST command to complete the task, if the task only needs to be run once?

A.

screen

B.

cron

C.

at

D.

nohup

Full Access
Question # 19

A Linux administrator is configuring a group directory in which all members in the Admins group can share and edit files and create subdirectories with the same attributes. The administrator creates the directory as follows:

Mkdir /shared

Chgrp Admins /shared

Which of the following command should the administrator execute so users can work in the directory as required?

A.

Chmod g+t /shared

B.

Chmod 0666 /shared

C.

Chown Admins /shared

D.

Chmod g+s /shared

Full Access
Question # 20

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

A Linux administrator recently changed the IP addresses of all the web servers from 10.10.50.x to 10.10.100.x. The administrator needs to update the serverlist.txt file to reflect the change.

The file contains the following:

10:WebSvr01:10.10.50.21:Main

11:WebSvr02:10.10.50.22:Acconting

12:WebSvr03:10.10.50.23:Intranet

20:NFS01:10.10.20.21:FileServer

30:SMTP01:10.10.30.31:Email

Which of the following commands will change the IP addresses and update the files in place?

A.

sed 's|.50|.100|g' serverlist.txt

B.

sed -g 's|.50|.100|a' serverlist.txt

C.

sed -i 's|.50|.100|' serverlist.txt

D.

sed -i 's|.50|.100|g' serverlist.txt

Full Access
Question # 22

A Linux administrator looks at the /etc/timezone file and determines the need to change the time zone from California to New York temporarily. Which of the following commands will accomplish this?

A.

sed -f TZ=America/New_York

B.

cat TZ=America/New_York

C.

export TZ=America/New_York

D.

printf TZ=America/New_York

Full Access
Question # 23

The Apache web server was recently installed on a Debian/Ubuntu server. The web server fails and a review of

log messages on another partition reveals the installation was not completed properly due to lack of disk space.

After clearing the files, the systems administrator has requested the installation to be performed again.

Which of the following command lines will perform this task? (Choose two.)

A.

apt-get install apache2

B.

apt-get --purge remove acache2

C.

apt-get --reinstall install apache2

D.

apt-get --reinstall apache2

Full Access
Question # 24

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”

XK0-004 question answer

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

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

A junior systems administrator has generated a PKI certificate for SSH sessions. The administrator would like to configure authentication without passwords to remote systems. Which of the following should the administrator perform?

A.

Add the content of id_rsa.pub file to the remote system ~/.ssh/authorized_keys location.

B.

Add the content of id_rsa file to the remote system ~/.ssh/authorized_keys location.

C.

Add the content of id_rsa file to the remote system ~/.ssh/known_hosts location.

D.

Add the content of id_rsa.pub file to the remote system ~/.ssh/known_hosts location.

Full Access
Question # 27

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

An administrator needs a bootable USB for installing a new Linux machine. The administrator downloaded the

image file and named it as Linux_OS.iso in the /tmp directory. Which of the following commands will

accomplish that task?

A.

dd input=/tmp/Linux_OS.iso of=/dev/sda bs=512

B.

dd in=/tmp/Linux_OS.iso out=/dev/sdb bs=512

C.

dd if=/tmp/Linux_OS.iso of=/dev/sda bs=512

D.

dd if=/tmp/Linux_OS.iso out=/dev/sdb1 bs=512

Full Access
Question # 29

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

A systems administrator is investigating low performance a server. After executing some diagnostic commands, the administrator analyzes the data:

XK0-004 question answer

Which of the following is the cause of low performance on the server?

A.

Lack of swap space

B.

Lack of available memory

C.

User processes have taken up all the available CPU time

D.

High disk activity

Full Access
Question # 31

A Linux administrator is restoring the SELinux contexts on an entire system. Which of the following commands

is the BEST option to complete this task?

A.

setenforce 0 && reboot

B.

setfacl –bR / && reboot

C.

touch /.autorelabel && reboot

D.

restorecon / && reboot

Full Access
Question # 32

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

A.

SSH

B.

NX

C.

XRDP

D.

VNC

Full Access
Question # 33

An administrator needs to change the DNS domain search order of a single Linux host to localize it better.

Which of the following files should the administrator edit?

A.

/etc/resolv.conf

B.

/etc/hosts

C.

/etc/nsswitch.conf

D.

/etc/dhcpd.conf

Full Access
Question # 34

A Linux server hosts Kerberos and LDAP, which of the following is the MOST likely role of this server?

A.

Certificate authority

B.

Clustering

C.

Database

D.

Authentication

Full Access
Question # 35

A Linux amdinisrator is adding a user’s local Linux account to the accounting group. The user is also a member of the finance group. Which of the following is the BEST way to add the user to the accounting group while still maintaining the user’s existing group members ships?

A.

Usermod –G accounting user1

B.

Usermod –G accounting, finance user1

C.

Usermod –G accounting user1

D.

Usermod –aG accounting user1

Full Access
Question # 36

Which of the following server roles would MOST likely be found in a PXE boot environment?

A.

Web

B.

DNS

C.

Proxy

D.

DCCP

Full Access
Question # 37

An administrator attempted to save large files in a directory but was unsuccessful. Which of the following is the NEXT step to nvesbgate the issue?

A.

Share –h

B.

Size –h

C.

Swap –h

D.

Df -h

Full Access
Question # 38

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:

XK0-004 question answer

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

A systems administrator a retting an HTTPO server on a Lnux server and configuring as a proxy server The administrator runs the following commands to venfy that the service is running:

XK0-004 question answer

However, the arjminrstraior is getting a 503 error when browsing to portal.company. internal. After reviewing the logs, the following error information is discovered:

XK0-004 question answer

Which of the following commands BEST resolves the issue?

A.

sentforce 0

B.

susearch -m USER_LOGIN -sv no

C.

grep http /var/log/audit/audit,log| audit2why

D.

setsebool -p httpd_can_network_connect 1

Full Access
Question # 40

A junior administrator issues the following commands on a Linux server:

XK0-004 question answer

The next day, the junior administrator is unable to edit the file. Which of the following would resolve this issue?

A.

Chmod 666 /home/junior_admin/tasklist

B.

Chmod $+x /home/junior_admin/tasklist

C.

Chmod g+s /home/junior_admin/tasklist

D.

Chmod o+rwx /home/junior_admin/tasklist

Full Access
Question # 41

Which of the following server roles is MOST appropriate to route files to multifunction devices?

A.

Proxy

B.

Router

C.

Print server

D.

Web server

Full Access
Question # 42

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
Question # 43

The following error is encountered when running a script:

XK0-004 question answer

Which of the following is the cause of this error?

A.

Script.sh was not added to the PATH

B.

The $ ! line is incorrect

C.

Script.sh is missing the executable bit.

D.

The file script. sh does not exist.

E.

Bash is not installed on the system

Full Access
Question # 44

Which of the following command should an administrator use to prevent users from starting the httpd service on a system-based Linux system?

A.

Systemct1 mask httpd

B.

Systemct1 disables httpd

C.

Chkconfig httpd off

D.

Systemctl stop httpd

Full Access
Question # 45

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

A systems administrator needs to write a script that performs unattended package upgrades. Which of the folowing flags should be used with either yum or apt to meet this goal?

A.

-u

B.

-q

C.

-y

D.

-d

Full Access
Question # 47

A user cannot access the application server from a laptop. The user does not know the name of the application's process but does know the port number. Which of the following commands would BEST help the user to investigate the issue whe

A.

last

B.

netatat

C.

nslookup

D.

route

E.

lsblk

Full Access
Question # 48

A Linux administrator rs creating a VM to install a third-party tool for scanning me network. The vendor hat provided an OVA file for installing the software.

Which of the foiowing BEST descnoes the OVA file?

A.

A VM image that contains the prelnstalled and configured vendor software

B.

Software installation media that will be mounted and installed using a kickstart file

C.

An application container that is self-contained and allows the vendor software to run anywhere

D.

Vendor planning and installation documentation guidance to prepare the installation

Full Access
Question # 49

A Linux administrator needs to change the permission on a script so that the owner has permission to execute. Which of the following BEST accomplishes this task?

A.

Chmod ug=script,sh

B.

Chmod u+x script,sh

C.

Chmod –x script,sh

D.

Chmod 0644 script,sh

Full Access
Question # 50

A server technician deployed ten ctoned Linux devices in an organization. When testing network functionality of the devices, the technician notices the cloned devices have identical hostnames. Which of the following commands si hostnames of the devices permanently'?

A.

Edit the 'etc/dhcp/dhclient .conf file.

B.

Edit the /etc/sysconfig/network file.

C.

Issue the host- command

D.

Issue the nslookup command

Full Access
Question # 51

An administrator is investigating issues with an unresponsive website hosted on an internal web server named websrv. After gathering diagnostics data the administrator performs the following analysis:

XK0-004 question answer

Which of the following would MOST likely resolve the issue on the web server?

A.

Systemct1 restart httpd

B.

Ifup etho

C.

Iptables –I INPUT 1 –p tcp –dport 80 –j ACCETP

D.

Route add default gw 10.0.112.0eth0

Full Access
Question # 52

A new web server was recenly installed and configured according to vendor.......... management via SSH has shown slow screen responses. The systems administrator..

An administrator is setting up a script named script,sh to be executed daily at 3:15 a.m. Which of the following is the correct way to define this in crontab?

A.

* * * 15 3 script,sh

B.

3 15 * * * script,sh

C.

* * * 3 15 script,sh

D.

15 3 * * * script,sh

Full Access
Question # 53

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

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

While booting an Intel 64-bit Debian UEFI desktop from power up, the prompt ts0> was displayed, indicating the bootloader failed. Which of the following will complete the boot process to a GRUB2 menu?

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 56

A Linux administrator needs to ensure a service no longer starts when a system running SysVinit is booted. Which of the following commands should the administrator use?

A.

systemctl disable application

B.

chkconfig application off

C.

echo "manual" > /etc/ init/ application/override

D.

service application Stop

Full Access
Question # 57

A junior Linux administrator receives a help desk ticket from a user who reports being unable to reach the website www.comptia.org. Which of the following commands should the administrator use to verify proper DNS

configuration?

A.

dig www.comptia.org

B.

ping www.comptia.org

C.

hostname www.comptia.org

D.

netstat www.comptia.org

Full Access
Question # 58

A Linux administrator updated the graphics drivers using a package manager but now the server does not boot. Which of the following is the BEST way to get the server back into an operational state?

A.

Use a system recovery disk to copy the server data to a new system.

B.

Reboot the server with an older kernel version.

C.

Kickstart the server and restore to the last system backup.

D.

Boot a live CD mount and cferoot the boot partition, and run fsck.

Full Access
Question # 59

A systems administrator is attempting to connect a printer to the network. After installing the printer, the systems admnstrator wants to provide a pnnting interface for network users to detect printers dynamically Which of the following would all…

A.

HBA

B.

CUPS

C.

USB

D.

LPO

Full Access
Question # 60

A Linux administrator needs to archive all the *.log files in the /var/log directory. The directory has several symbolic link files that need to be included in the car file. Which of the following commands should the administrator run to create

A.

tar -tvz logarchive.tgz /var/log/".log

B.

tar -xhz Icgarchive.tgz /var/log/*.log

C.

tar -czh logarchive.tgz /var/log/*.log

D.

tar -cpz logarchive.tgz /var/log/*.log

Full Access
Question # 61

An administrator is troubleshooting an issue where end users are waiting a very long times for processes to respond. The top command reveals that multiple processes seem to be m a non-responsive state or have become zombies. Which of the administrator use to clean up the system?

A.

Pkill –o 15m

B.

Killall –n

C.

Pkill –x

D.

Killall –o 15m

Full Access
Question # 62

An administrator wants to use a Linux server's GUI remotely but is limited by security to using TCP ports 5900—5999. Which Of the following is the BEST choice for installation on the Linux server to enable this functionality?

A.

VNC

B.

rdesktop

C.

XRDP

D.

SPICE

Full Access
Question # 63

A Linux administrator added storage to an XFS-formatted filesystem at /dev/mapper/vgslash-lvLog device using the LVM tools. However, the additional space does not show up when the administrator runs the df - h command. Which of the following commands should the administrator run to resolve this issue?

XK0-004 question answer

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Full Access
Question # 64

A Linux administrator is creating a new local Linux user account for a web application The account has the following requirements:

• Use/var/www as the home directory

• Have the service_accounts group as its pnmary group

• Have the www user group as a secondary group

• Disable the account when the password expires

Which of the following BEST meets these requirements?

A.

useradd -D/var/www/-g service_accounts -G www -c 0

B.

useradd -d/var/www/-g service_accounts -f www -g 0

C.

useradd -D/var/www/-g service_accounts -g www -c 0

D.

useradd -d/var/www/-g service_accounts -G www -f 0

Full Access
Question # 65

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

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

A systems administrator needs to retrieve specific fields from a csv file. Which of the following tools would accomplish this task?

A.

awk

B.

sort

C.

print

D.

echo

Full Access
Question # 68

An administrator is uncomfortable allowing users to log in as root. Which of the following ensures that root logins are disallowed?

A.

usermod -L root

B.

usermod -G root

C.

usermod -B root

D.

usermod -U root

Full Access
Question # 69

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

Full Access
Question # 70

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

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

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

A.

/etc/sysconfig/anaconda/cfg

B.

/root/anaconda.auto

C.

/root/anaconda-ks.cfg

D.

/etc/sysconfig/installation.cfg

Full Access