Winter Sale - Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dpm65

Hot Vendors

XK0-005 CompTIA Linux+ Exam Questions and Answers

Questions 4

Which of the following data structures is written in JSON?

A)

XK0-005 Question 4

B)

XK0-005 Question 4

C)

XK0-005 Question 4

D)

XK0-005 Question 4

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 5

A Linux administrator needs to connect securely to a remote server in order to install application software. Which of the following commands would allow this connection?

Options:

A.

scp "ABC-key.pem" root@10.0.0.1

B.

sftp rooteiO.0.0.1

C.

telnet 10.0.0.1 80

D.

ssh -i "ABC-key.pem" root@10.0.0.1

E.

sftp "ABC-key.pem" root@10.0.0.1

Buy Now
Questions 6

Employees in the finance department are having trouble accessing the file /opt/work/file. All IT employees can read and write the file. Systems administrator reviews the following output:

XK0-005 Question 6

Which of the following commands would permanently fix the access issue while limiting access to IT and finance department employees?

Options:

A.

chattr +i file

B.

chown it:finance file

C.

chmod 666 file

D.

setfacl -m g:finance:rw file

Buy Now
Questions 7

A Linux system fails to start and delivers the following error message:

XK0-005 Question 7

Which of the following commands can be used to address this issue?

Options:

A.

fsck.ext4 /dev/sda1

B.

partprobe /dev/sda1

C.

fdisk /dev/sda1

D.

mkfs.ext4 /dev/sda1

Buy Now
Questions 8

A Linux administrator is reviewing changes to a configuration file that includes the following section:

XK0-005 Question 8

The Linux administrator is trying to select the appropriate syntax formatter to correct any issues with the configuration file. Which of the following should the syntax formatter support to meet this goal?

Options:

A.

Markdown

B.

XML

C.

YAML

D.

JSON

Buy Now
Questions 9

Linux system users report that over the past few months, a server has stopped responding at least twice each day. Every time this happens, the users have to restart the server to recover it. A systems administrator diagnosing the issue collects the following outputs:

csharp

Output 1

[Tue Aug 31 16:36:42 2021] oom-killer invoked by java: gfp_mask=0x280da2 order=0, oom_score_adj=0

[Tue Aug 31 16:36:42 2021] java cpuset=/ mems_allowed=0

makefile

Output 2

[root@server]# free -m

total used free shared buff/cache available

Mem: 15819 15026 174 92 619 134

Swap: 0 0 0

Which of the following is the best permanent resolution for the system?

Options:

A.

More memory resources

B.

More CPU resources

C.

More network bandwidth

D.

Extended root filesystem

Buy Now
Questions 10

A systems administrator creates a public key for authentication. Which of the following tools is most suitable to use when uploading the key to the remote

servers?

Options:

A.

scp

B.

ssh-copy-id

C.

ssh-agent

D.

ssh-keyscan

Buy Now
Questions 11

A Linux administrator has been tasked with installing the most recent versions of packages on a RPM-based OS. Which of the following commands will accomplish this task?

Options:

A.

apt-get upgrade

B.

rpm -a

C.

yum updateinfo

D.

dnf update

E.

yum check-update

Buy Now
Questions 12

A user is unable to log on to a Linux workstation. The systems administrator executes the following command:

cat /etc/shadow | grep user1

The command results in the following output:

user1 :! $6$QERgAsdvojadv4asdvaarC/9dj34GdafGVaregmkdsfa:18875:0:99999:7 :::

Which of the following should the systems administrator execute to fix the issue?

Options:

A.

chown -R userl:user1 /home/user1

B.

sed -i '/ ::: / :: /g' /etc/shadow

C.

chgrp user1:user1 /home/user1

D.

passwd -u user1

Buy Now
Questions 13

An administrator made a change to a system’s network configuration. Which of the following best represents what the administrator should do to have the new configuration take effect?

Options:

A.

systemctl restart networkd

B.

systemctl enable networkd

C.

systemctl status networkd

D.

systemctl isolate networkd

Buy Now
Questions 14

Which of the following technologies provides load balancing, encryption, and observability in containerized environments?

Options:

A.

Virtual private network

B.

Sidecar pod

C.

Overlay network

D.

Service mesh

Buy Now
Questions 15

A systems administrator is compiling a report containing information about processes that are listening on the network ports of a Linux server. Which of the following commands will allow the administrator to obtain the needed information?

Options:

A.

ss -pint

B.

tcpdump -nL

C.

netstat -pn

D.

lsof -It

Buy Now
Questions 16

A systems administrator is tasked with creating a cloud-based server with a public IP address.

XK0-005 Question 16

Which of the following technologies did the systems administrator use to complete this task?

Options:

A.

Puppet

B.

Git

C.

Ansible

D.

Terraform

Buy Now
Questions 17

A Linux administrator has physically added a new RAID adapter to a system. Which of the following commands should the Linux administrator run to confirm that the device has been recognized? (Select TWO).

Options:

A.

rmmod

B.

Is -11 /etc

C.

Ishw —class disk

D.

pvdisplay

E.

rmdir /dev

F.

dmesg

Buy Now
Questions 18

Rugged appliances are small appliances with ruggedized hardware and like Quantum Spark appliance they use which operating system?

Options:

A.

Centos Linux

B.

Gaia embedded

C.

Gaia

D.

Red Hat Enterprise Linux version 5

Buy Now
Questions 19

A database administrator requested the installation of a custom database on one of the servers. Which of the following should the Linux administrator configure so the requested packages can be installed?

Options:

A.

/etc/yum.conf

B.

/etc/ssh/sshd.conf

C.

/etc/yum.repos.d/db.repo

D.

/etc/resolv.conf

Buy Now
Questions 20

A Linux administrator rebooted a server. Users then reported some of their files were missing. After doing some troubleshooting, the administrator found one of the filesystems was missing. The filesystem was not listed in /etc/f stab and might have been mounted manually by someone prior to reboot. Which of the following would prevent this issue from reoccurring in the future?

Options:

A.

Sync the mount units.

B.

Mount the filesystem manually.

C.

Create a mount unit and enable it to be started at boot.

D.

Remount all the missing filesystems

Buy Now
Questions 21

A systems administrator is customizing a new Linux server. Which of the following settings for umask would ensure that new files have the default permissions of -rw-r--r--?

Options:

A.

0017

B.

0027

C.

0038

D.

0640

Buy Now
Questions 22

Joe, a user, is unable to log in to the system. The Linux administrator checks the /etc/passwd file and reviews the following output:

Joe:x:1002:1002::/home/Joe:/sbin/nologin

Which of the following should the administrator do to fix this issue?

Options:

A.

Remove the x entry in the /etc/passwd file for Joe

B.

Change the /sbin/nologin entry to /bin/sh for Joe

C.

Issue the usermod -l Joe command

D.

Ensure that a corresponding entry is in the /etc/shadow file for Joe

Buy Now
Questions 23

Due to low disk space, a Linux administrator finding and removing all log files that were modified more than 180 days ago. Which of the following commands will accomplish this task?

Options:

A.

find /var/log -type d -mtime +180 -print -exec rm {} \;

B.

find /var/log -type f -modified +180 -rm

C.

find /var/log -type f -mtime +180 -exec rm {} \

D.

find /var/log -type c -atime +180 –remove

Buy Now
Questions 24

An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output:

XK0-005 Question 24

Which of the following commands would resolve the issue?

Options:

A.

restorecon .ssh/authorized_keys

B.

ssh_keygen -t rsa -o .ssh/authorized_keys

C.

chown root:root .ssh/authorized_keys

D.

chmod 600 .ssh/authorized_keys

Buy Now
Questions 25

A Linux administrator needs to create a new cloud.cpio archive containing all the files from the current directory. Which of the following commands can help to accomplish this task?

Options:

A.

ls | cpio -iv > cloud.epio

B.

ls | cpio -iv < cloud.epio

C.

ls | cpio -ov > cloud.cpio

D.

ls cpio -ov < cloud.cpio

Buy Now
Questions 26

Using AD Query, the security gateway connections to the Active Directory Domain Controllers using what protocol?

Options:

A.

Windows Management Instrumentation (WMI)

B.

Hypertext Transfer Protocol Secure (HTTPS)

C.

Lightweight Directory Access Protocol (LDAP)

D.

Remote Desktop Protocol (RDP)

Buy Now
Questions 27

A developer needs to launch an Nginx image container, name it Web001, and ex-pose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?

Options:

A.

docker exec —it -p 8080: 80 ——name Web001 nginx

B.

docker load -it -p 8080:80 ——name Web001 nginx

C.

docker run -it -P 8080:80 ——name Web001 nginx

D.

docker pull -it -p 8080:80 —name Web00l nginx

Buy Now
Questions 28

A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

file filename

B.

touch filename

C.

grep filename

D.

lsof filename

Buy Now
Questions 29

A Linux administrator is troubleshooting a systemd mount unit file that is not working correctly. The file contains:

[root@system] # cat mydocs.mount

[Unit]

Description=Mount point for My Documents drive

[Mount]

What=/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34

Where=/home/user1/My Documents

Options=defaults

Type=xfs

[Install]

WantedBy=multi-user.target

The administrator verifies the drive UUID correct, and user1 confirms the drive should be mounted as My Documents in the home directory. Which of the following can the administrator

do to fix the issues with mounting the drive? (Select two).

Options:

A.

Rename the mount file to home-user1-My\x20Documents.mount.

B.

Rename the mount file to home-user1-my-documents.mount.

C.

Change the What entry to /dev/drv/disk/by-uuid/94afc9b2\-ac34\-ccff\-88ae\-297ab3c7ff34.

D.

Change the Where entry to Where=/home/user1/my\ documents.

E.

Change the Where entry to Where=/home/user1/My\x20Documents.

F.

Add quotes to the What and Where entries, such as What="/dev/drv/disk/by-uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34" and Where="/home/user1/My Documents".

Buy Now
Questions 30

A systems administrator is implementing a new service task with systems at startup and needs to execute a script entitled test.sh with the following content:

XK0-005 Question 30

The administrator tries to run the script after making it executable with chmod +x; however, the script will not run. Which of the following should the administrator do to address this issue? (Choose two.)

Options:

A.

Add #!/bin/bash to the bottom of the script.

B.

Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location.

C.

Add #!//bin/bash to the top of the script.

D.

Restart the computer to enable the new service.

E.

Create a unit file for the new service in /etc/init.d with the name helpme.service in the location.

F.

Shut down the computer to enable the new service.

Buy Now
Questions 31

A Linux administrator is scheduling a system job that runs a script to check available disk space every hour. The Linux administrator does not want users to be able to start the job. Given the following:

XK0-005 Question 31

The Linux administrator attempts to start the timer service but receives the following error message:

XK0-005 Question 31

Which of the following is MOST likely the reason the timer will not start?

Options:

A.

The checkdiskspace.timer unit should be enabled via systemct1.

B.

The timers.target should be reloaded to get the new configuration.

C.

The checkdiskspace.timer should be configured to allow manual starts.

D.

The checkdiskspace.timer should be started using the sudo command.

Buy Now
Questions 32

Which of the following specifications is used to perform disk encryption in a Linux system?

Options:

A.

LUKS

B.

TLS

C.

SSL

D.

NFS

Buy Now
Questions 33

A DevOps engineer is working on a local copy of a Git repository. The engineer would like to switch from the main branch to the staging branch but notices the staging branch does not exist. Which of the following Git commands should the engineer use to perform this task?

Options:

A.

git branch —m staging

B.

git commit —m staging

C.

git status —b staging

D.

git checkout —b staging

Buy Now
Questions 34

A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries.

XK0-005 Question 34

Which of the following commands would be BEST to use to accomplish this task?

Options:

A.

chattr +a /opt/app/logs

B.

chattr +d /opt/app/logs

C.

chattr +i /opt/app/logs

D.

chattr +c /opt/app/logs

Buy Now
Questions 35

A systems administrator is investigating a service that is not starting up. Given the following information:

XK0-005 Question 35

Which of the following systemd commands should the administrator use in order to obtain more details about the failing service?

Options:

A.

systemct1 analyze network

B.

systemct1 info network

C.

sysctl -a network

D.

journalctl -xu network

Buy Now
Questions 36

A Linux administrator is tasked with creating resources using containerization. When deciding how to create this type of deployment, the administrator identifies some key features, including portability, high availability, and scalability in production. Which of the following should the Linux administrator choose for the new design?

Options:

A.

Docker

B.

On-premises systems

C.

Cloud-based systems

D.

Kubernetes

Buy Now
Questions 37

A Linux administrator has defined a systemd script docker-repository.mount to mount a volume for use by the Docker service. The administrator wants to ensure that Docker

service does not start until the volume is mounted. Which of the following configurations needs to be added to the Docker service definition to best accomplish this task?

Options:

A.

After=docker-respository.mount

B.

ExecStart=/usr/bin/mount -a

C.

Requires=docker-repository.mount

D.

RequiresMountsFor=docker-repository.mount

Buy Now
Questions 38

When trying to log in remotely to a server, a user receives the following message:

XK0-005 Question 38

The server administrator is investigating the issue on the server and receives the following outputs:

XK0-005 Question 38

Which of the following is causing the issue?

Options:

A.

The wrong permissions are on the user’s home directory.

B.

The account was locked out due to three failed logins.

C.

The user entered the wrong password.

D.

The user has the wrong shell assigned to the account.

Buy Now
Questions 39

A server administrator has scheduled a cron job to run YUM updates on all servers without manual intervention, but kernel packages must be excluded from the updates at all times. Which of the following configuration files needs to be modified to make these changes persistent?

Options:

A.

/etc/yum.conf

B.

/etc/dnf/dnf.conf

C.

/etc/yum/pluginconf.d/packages.conf

D.

/etc/yum.repo.d/kernel.repo

Buy Now
Questions 40

A Linux administrator encounters the following error in the Apache log files:

css

SQLSTATE[HY000] [2002] Permission denied

Which of the following commands should the administrator run to safely fix this issue?

Options:

A.

chcon -c httpd_sys_content_t /home/apache

B.

setsebool -F httpd_can_network_connect_db on

C.

setenforce 0

D.

touch /.autorelabel

Buy Now
Questions 41

A Linux administrator has installed a web server, a database server, and a web application on a server. The web application should be active in order to render the web pages. After the administrator restarts the server, the website displays the following message in the browser: Error establishing a database connection. The Linux administrator reviews the following relevant output from the systemd init files:

XK0-005 Question 41

The administrator needs to ensure that the database is available before the web application is started. Which of the following should the administrator add to the HTTP server .service file to accomplish this task?

Options:

A.

TRIGGERS=mariadb.service

B.

ONFAILURE=mariadb.service

C.

WANTEDBY=mariadb.service

D.

REQUIRES=mariadb.service

Buy Now
Questions 42

User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?

Options:

A.

chown user2:accounting script.sh

chmod 750 script.sh

B.

chown user1:accounting script.sh

chmod 777 script.sh

C.

chown accounting:user1 script.sh

chmod 057 script.sh

D.

chown user2:accounting script.sh

chmod u+x script.sh

Buy Now
Questions 43

A non-privileged user is attempting to use commands that require elevated account permissions, but the commands are not successful. Which of the following most likely needs to be updated?

Options:

A.

/etc/passwd

B.

/etc/shadow

C.

/etc/sudoers

D.

/etc/bashrc

Buy Now
Questions 44

Users have been unable to reach www.comptia.org from a Linux server. A systems administrator is troubleshooting the issue and does the following:

XK0-005 Question 44

Based on the information above, which of the following is causing the issue?

Options:

A.

The name www.comptia.org does not point to a valid IP address.

B.

The server 192.168.168.53 is unreachable.

C.

No default route is set on the server.

D.

The network interface eth0 is disconnected.

Buy Now
Questions 45

A Linux administrator needs to forward port 8000 on a remote server to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?

Options:

A.

firewall-cmd --add-forward-port=port=8000

=tcp

=8000

=remote

B.

iptables -A FORWARD -m state -p tcp -d remote --dport 9000 -j accept

C.

ssh -R 8000:localhost:9000 remote

D.

socat TCP4-LISTEN:8000,fork TCP4:remote:8000

Buy Now
Questions 46

A systems administrator detected corruption in the /data filesystem. Given the following output:

XK0-005 Question 46

Which of the following commands can the administrator use to best address this issue?

Options:

A.

umount /data

mkfs . xfs /dev/sclcl

mount /data

B.

umount /data

xfs repair /dev/ sdcl

mount /data

C.

umount /data

fsck /dev/ sdcl

mount / data

D.

umount /data

pvs /dev/sdcl

mount /data

Buy Now
Questions 47

A cloud engineer is asked to copy the file deployment.yaml from a container to the host where the container is running. Which of the following commands can accomplish this task?

Options:

A.

docker cp container_id/deployment.yaml deployment.yaml

B.

docker cp container_id:/deployment.yaml deployment.yaml

C.

docker cp deployment.yaml local://deployment.yaml

D.

docker cp container_id/deployment.yaml local://deployment.yaml

Buy Now
Questions 48

The journald entries have filled a Linux machine's /var volume. Which of the following is the best command for a systems administrator to use to free up the disk space occupied by these entries?

Options:

A.

journalctl —rotate

journalctl --vacuum-time=ls

B.

systemctl stop systemd-journald

systemctl start systemd-journald

C.

rm -rf /var/log/journal

systemctl restart systemd-journald

D.

pkill -HUP systemd-journald

systemctl restart systemd-journald

Buy Now
Questions 49

Users have been unable to save documents to /home/tmp/temp and have been receiving the following error:

Path not found

A junior technician checks the locations and sees that /home/tmp/tempa was accidentally created instead of /home/tmp/temp. Which of the following commands should the technician use to fix this issue?

Options:

A.

cp /home/tmp/tempa /home/tmp/temp

B.

mv /home/tmp/tempa /home/tmp/temp

C.

cd /temp/tmp/tempa

D.

ls /home/tmp/tempa

Buy Now
Questions 50

A systems administrator created a new directory with specific permissions. Given the following output:

arduino

$ ls -ld /comptia

drwxr-x--- 2 root root 4096 Oct 20 20:13 /comptia

$ getfacl /comptia

# file: /comptia

# owner: root

# group: root

user::rwx

group::r-x

other::---

default:user::rwx

default:group::r-x

default:group:wheel:rwx

default:mask::rwx

default:other::---

Which of the following permissions are enforced on /comptia?

Options:

A.

Members of the wheel group can read files in /comptia.

B.

Newly created files in /comptia will have the sticky bit set.

C.

Other users can create files in /comptia.

D.

Only root can create files in /comptia.

Buy Now
Questions 51

In order to copy data from another VLAN, a systems administrator wants to temporarily assign IP address 10.0.6 5/24 to the newly added network interface enp1s0f1. Which of the following commands should the administrator run to achieve the goal?

Options:

A.

ip addr add 10.0.6.5/24 dev enpls0f1

B.

echo "IPV4_ADDRESS=10.0.6.5/24" > /etc/sysconfig/network-scripts/ifcfg-enplsOfl

C.

ifconfig 10.0.6.5/24 enpsIs0f1

D.

nmcli conn add lpv4.address-10.0.6.5/24 ifname enpls0f1

Buy Now
Questions 52

A Linux administrator wants to prevent the httpd web service from being started both manually and automatically on a server. Which of the following should the administrator use to accomplish this task?

Options:

A.

systemctl mask httpd

B.

systemctl disable httpd

C.

systemctl stop httpd

D.

systemctl reload httpd

Buy Now
Questions 53

A Linux administrator created the directory /project/access2all. By creating this directory, the administrator is trying to avoid the deletion or modification of files from non-owners. Which of the following will accomplish this goal?

Options:

A.

chmod +t /project/access2all

B.

chmod +rws /project/access2all

C.

chmod 2770 /project/access2all

D.

chmod ugo+rwx /project/access2all

Buy Now
Questions 54

A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?

Options:

A.

iptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192.0.2.25:3128

B.

iptables -t nat -A PREROUTING -p top --dport 81 -j DNAT –-to-destination 192.0.2.25:3129

C.

iptables -t nat -I PREROUTING -p top --sport 80 -j DNAT –-to-destination 192.0.2.25:3129

D.

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192.0.2.25:3128

Buy Now
Questions 55

A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?

Options:

A.

chmod 775

B.

umask. 002

C.

chactr -Rv

D.

chown -cf

Buy Now
Questions 56

A DevOps engineer pushed the updated configuration to an existing branch of a remote Git repository. Which of the following commands should the Linux administrator use to obtain these configuration changes?

Options:

A.

git pull

B.

git log

C.

git fetch

D.

git checkout main

Buy Now
Questions 57

Some servers in an organization have been compromised. Users are unable to access to the organization’s web page and other services. While reviewing the system log, a systems administrator notices messages from the kernel regarding firewall rules:

XK0-005 Question 57

Which of the following commands will remediate and help resolve the issue?

Options:

A.

XK0-005 Question 57 Option 1

B.

57

C.

57

D.

57

Buy Now
Questions 58

A Linux administrator reviews a set of log output files and needs to identify files that contain any occurrence of the word denied. All log files containing entries in uppercase or lowercase letters should be included in the list. Which of the following commands should the administrator use to accomplish this task?

Options:

A.

find . -type f -print | xrags grep -ln denied

B.

find . -type f -print | xrags grep -nv denied

C.

find . -type f -print | xrags grep -wL denied

D.

find . -type f -print | xrags grep -li denied

Buy Now
Questions 59

A Linux administrator created a virtual clone of a physical server and would like to remove any existing entries related to SSH keys from outside entities on the virtual clone. Which of the following files should the administrator remove? (Select two).

Options:

A.

~/.ssh/authorized_keys

B.

~/.ssh/known_hosts

C.

/etc/ssh/ssh_config

D.

~/.ssh/config

E.

/etc/ssh/sshd_config

F.

/etc/ssh/ssh_host_rsa_key.pub

Buy Now
Questions 60

A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value?

Options:

A.

/etc/host.conf

B.

/etc/hostname

C.

/etc/services

D.

/etc/ssh/sshd_config

Buy Now
Questions 61

A Linux administrator is troubleshooting an issue in which an application service failed to start on a Linux server. The administrator runs a few commands and gets the following outputs:

XK0-005 Question 61

Based on the above outputs, which of the following is the MOST likely action the administrator should take to resolve this issue?

Options:

A.

Enable the logsearch.service and restart the service.

B.

Increase the TimeoutStartUSec configuration for the logsearch.sevice.

C.

Update the OnCalendar configuration to schedule the start of the logsearch.service.

D.

Update the KillSignal configuration for the logsearch.service to use TERM.

Buy Now
Questions 62

A Linux user is trying to execute commands with sudo but is receiving the following error:

$ sudo visudo

>>> /etc/sudoers: syntax error near line 28 <<<

sudo: parse error in /etc/sudoers near line 28

sudo: no valid sudoers sources found, quitting

The following output is provided:

# grep root /etc/shadow

root :* LOCK *: 14600 ::::::

Which of the following actions will resolve this issue?

Options:

A.

Log in directly using the root account and comment out line 28 from /etc/sudoers.

B.

Boot the system in single user mode and comment out line 28 from /etc/sudoers.

C.

Comment out line 28 from /etc/sudoers and try to use sudo again.

D.

Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc/sudoers.

Buy Now
Questions 63

A hardened physical Linux system allows regular, unprivileged users to remotely connect to the server using SSH only. No sudo tool has been installed. Which of the following should the Linux administrator use to perform administrative tasks on this host? (Select two).

Options:

A.

Create an SSH key and copy it to the remote server to allow passwordless login

B.

Access the server’s physical console and use the root user's password to log in

C.

Install the telnet server on this system to be able to use a root account

D.

Use the su command and enter the root user’s password

E.

Install the sudo command using the unprivileged user’s account

F.

Add the user to the wheel group

Buy Now
Questions 64

A Linux administrator is creating a primary partition on the replacement hard drive for an application server. Which of the following commands should the administrator issue to verify the device name of this partition?

Options:

A.

sudo fdisk /dev/sda

B.

sudo fdisk -s /dev/sda

C.

sudo fdisk -l

D.

sudo fdisk -h

Buy Now
Questions 65

A Linux systems administrator is setting up a new web server and getting 404 - NOT FOUND errors while trying to access the web server pages from the browser. While working on the diagnosis of this issue, the Linux systems administrator executes the following commands:

XK0-005 Question 65

Which of the following commands will BEST resolve this issue?

Options:

A.

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

B.

restorecon -R -v /var/www/html

C.

setenforce 0

D.

setsebool -P httpd_can_network_connect_db on

Buy Now
Questions 66

A Linux administrator needs to ensure that Java 7 and Java 8 are both locally available for developers to use when deploying containers. Currently only Java 8 is available. Which of the following commands should the administrator run to ensure both versions are available?

Options:

A.

docker image load java:7

B.

docker image pull java:7

C.

docker image import java:7

D.

docker image build java:7

Buy Now
Questions 67

A systems engineer deploys a new application server, but the server cannot communicate with the back-end database hostname. The engineer confirms that the application server can ping the database server's IP address. Which of the following is the most likely cause of the issue?

Options:

A.

Incorrect DNS servers

B.

Unreachable default gateway

C.

Missing route configuration

D.

Misconfigured subnet mask

Buy Now
Questions 68

An engineer needs to insert a character at the end of the current line in the vi text editor. Which of the following will allow the engineer to complete this task?

Options:

A.

p

B.

r

C.

bb

D.

A

E.

i

Buy Now
Questions 69

Which of the following will prevent non-root SSH access to a Linux server?

Options:

A.

Creating the /etc/nologin file

B.

Creating the /etc/nologin.allow file containing only a single line root

C.

Creating the /etc/nologin/login.deny file containing a single line +all

D.

Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so

Buy Now
Questions 70

After starting an Apache web server, the administrator receives the following error:

Apr 23 localhost.localdomain httpd 4618] : (98) Address already in use: AH00072: make_sock: could not bind to address [: :]80

Which of the following commands should the administrator use to further trou-bleshoot this issue?

Options:

A.

Ss

B.

Ip

C.

Dig

D.

Nc

Buy Now
Questions 71

Following the migration from a disaster recovery site, a systems administrator wants a server to require a user to change credentials at initial login. Which of the following commands should

be used to ensure the aging attribute?

Options:

A.

chage -d 2 user

B.

chage -d 0 user

C.

chage -E 0 user

D.

chage -d 1 user

Buy Now
Questions 72

As part of the requirements for installing a new application, the swappiness parameter needs to be changed to O. This change needs to persist across re-boots and be applied immediately. A Linux systems administrator is performing this change. Which of the following steps should the administrator complete to accomplish this task?

Options:

A.

echo "vm. swappiness—()" >> /etc/sysctl . conf && sysctl —p

B.

echo "vrn. >> / proc/meminfo && sysctl —a

C.

sysctl —v >> / proc/meminfo & & echo "vm. swapiness=0"

D.

sysctl —h "vm. swapiness—O" && echo / etc/vmswapiness

Buy Now
Questions 73

Users report that they cannot access some files located in the /opt/finapp directory after a power outage caused an unexpected server restart. A Linux administrator examines the following filesystem details and system logs:

# mount | grep finapp

/dev/mapper/rhel-opt_finapp on /opt/finapp type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)

# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 0 931.5G 0 disk

├─sda1 8:1 0 1G 0 part /boot

└─sda2 8:2 0 930.5G 0 part

├─rhel-root 253:0 0 30.5G 0 lvm /

└─rhel-opt_finapp 253:1 0 900G 0 lvm /opt/finapp

# grep opt_finapp /var/log/messages

XFS (opt_finapp): Corruption detected in inode 3645, extent tree

Which of the following commands should the administrator run in an attempt to fix the filesystem?

Options:

A.

fdisk /dev/mapper/rhel-opt_finapp

B.

xfs_repair /dev/mapper/rhel-opt_finapp

C.

lvcreate -L900G -n opt_finapp rhel

D.

fsck.ext4 /dev/mapper/rhel-opt_finapp

Buy Now
Questions 74

A Linux administrator is configuring a log collector agent to monitor logs in /var/log/collector. The agent is reporting that it cannot write to the directory. The agent runs as the logger user account. The administrator runs a few commands and reviews the following output:

makefile

Output 1:

drwxr-xr-x. 1 root root 0 Oct 20:13 collector

Output 2:

file: /var/log/collector

owner: root

group: root

user::rwx

group::r-x

mask::rwx

other::r-x

Output 3:

uid=1010(logger) gid=1010(monitor) groups=1010(monitor)

Which of the following is the best way to resolve the issue?

Options:

A.

setfacl -Rm u:logger

/var/log/collector

B.

usermod -aG root logger

C.

chmod 644 /var/log/collector

D.

chown -R logger

/var/log

Buy Now
Questions 75

A systems administrator needs to remove a disk from a Linux server. The disk size is 500G, and it is the only one that size on that machine. Which of the following commands can the

administrator use to find the corresponding device name?

Options:

A.

fdisk -V

B.

partprobe -a

C.

lsusb -t

D.

lsscsi -s

Buy Now
Questions 76

An administrator runs ping comptia.org. The result of the command is:

ping: comptia.org: Name or service not known

Which of the following files should the administrator verify?

Options:

A.

/etc/ethers

B.

/etc/services

C.

/etc/resolv.conf

D.

/etc/sysctl.conf

Buy Now
Questions 77

A newly created container has been unable to start properly, and a Linux administrator is analyzing the cause of the failure. Which of the following will allow the administrator to determine the FIRST command that is executed inside the container right after it starts?

Options:

A.

docker export

B.

docker info

C.

docker start

D.

docker inspect

Buy Now
Questions 78

A Linux system is having issues. Given the following outputs:

# dig @192.168.2.2 mycomptiahost

; << >> DiG 9.9.4-RedHat-9.9.4-74.el7_6.1 << >> @192.168.2.2 mycomptiahost

; (1 server found)

;; global options: +cmd

;; connection timed out; no servers could be reached

# nc -v 192.168.2.2 53

Ncat: Version 7.70 ( https://nmap.org/ncat )

Ncat: Connection timed out.

# ping 192.168.2.2

PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.

64 bytes from 192.168.2.2: icmp_seq=1 ttl=117 time=4.94 ms

64 bytes from 192.168.2.2: icmp_seq=2 ttl=117 time=10.5 ms

Which of the following best describes this issue?

Options:

A.

The DNS host is down.

B.

The name mycomptiahost does not exist in the DNS.

C.

The Linux engineer is using the wrong DNS port.

D.

The DNS service is currently not available or the corresponding port is blocked.

Buy Now
Questions 79

A file called testfile has both uppercase and lowercase letters:

$ cat testfile

ABCDEfgH

IJKLmnoPQ

abcdefgH

ijklLMNopq

A Linux administrator is tasked with converting testfile into all uppercase and writing it to a new file with the name uppercase. Which of the following commands will achieve

this task?

Options:

A.

tr '(A-Z}' '{a-z}' < testfile > uppercase

B.

echo testfile | tr "[Z-A]" "[z-a]" < testfile > uppercase

C.

cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase

D.

tr '[a-z]' '[A-Z]' < testfile > uppercase

Buy Now
Questions 80

A Linux administrator needs to expose port 9000 for a container to listen during runtime. The Linux administrator creates a Dockerfile with the following entries:

sql

FROM node:9-alpine

WORKDIR /usr/src/app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 9000

CMD ["npm", "start"]

Which of the following commands should the administrator use to accomplish this task? (Select two).

Options:

A.

docker build -t Test-Container

B.

docker tag Test-Container

C.

docker inspect Test-Container

D.

docker run -p 5000:80 Test-Container

E.

docker push Test-Container

F.

docker run -p 80:9000 Test-Container

Buy Now
Questions 81

An administrator is running a web server in a container named WEB, but none of the error output is showing. Which of the following should the administrator use to generate the errors on the container?

Options:

A.

docker-compose inspect WEB

B.

docker logs WEB

C.

docker run --name WEB --volume /dev/stdout:/var/log/nginx/error.log

D.

docker ps WEB -f

Buy Now
Questions 82

A Linux systems administrator is updating code. After completing the update, the administrator wants to publish the updated code without including the configuration files. Which of the following should the administrator use to accomplish this task?

Options:

A.

git clone

B.

git -

C.

.gitignore

D.

git fetch

Buy Now
Questions 83

Which of the following directories contains binaries that only a root user should run?

Options:

A.

/sbin

B.

/bin

C.

/root

D.

/lib

Buy Now
Questions 84

A Linux administrator is implementing a CI/CD process for the company’s internal accounting web application. Which of the following best defines the purpose of this process?

Options:

A.

To automate the process of building, testing, and deploying application components

B.

To perform security penetration tests on deployed applications to identify vulnerabilities

C.

To formalize the approval process of application releases and configuration changes

D.

To leverage code to document the infrastructure, configurations, and dependencies

Buy Now
Questions 85

A DevOps engineer needs to download a Git repository from https://git.company.com/admin/project.git. Which of the following commands will achieve this goal?

Options:

A.

git clone https://git.company.com/admin/project.git

B.

git checkout https://git.company.com/admin/project.git

C.

git pull https://git.company.com/admin/project.git

D.

git branch https://git.company.com/admin/project.git

Buy Now
Questions 86

Which of the following will prevent non-root SSH access to a Linux server?

Options:

A.

Creating the /etc/nologin file

B.

Creating the /etc/nologin.allow file containing only a single line root

C.

Creating the /etc/nologin/login.deny file containing a single line -all

D.

Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so

Buy Now
Questions 87

In which of the following filesystems are system logs commonly stored?

Options:

A.

/var

B.

/tmp

C.

/etc

D.

/opt

Buy Now
Questions 88

A systems administrator is tasked with changing the default shell of a system account in order to disable iterative logins. Which of the following is the

best option for the administrator to use as the new shell?

Options:

A.

/sbin/nologin

B.

/bin/ sh

C.

/sbin/ setenforce

D.

/bin/bash

Buy Now
Questions 89

An administrator has source code and needs to rebuild a kernel module. Which of the following command sequences is most commonly used to rebuild this

type of module?

Options:

A.

./configure

make

make install

B.

wget

gcc

cp

C.

tar xvzf

build

cp

D.

build

install

configure

Buy Now
Questions 90

An organization's business office needs to collaborate on quarterly reports and asks the systems administrator to create a finance group. The administrator creates the following directory: drwxrwxr-x Business Business |j096 Oct 15 16:40 Q1

Which of the following commands will allow all members of the finance group to have group ownership of all files created in the Q1 directory while ensuring that members of the business group preserve access? (Select two).

Options:

A.

chmod g+s Q1/

B.

chmod u+s Q1/

C.

chmod a+x Q1/

D.

chown Finance Q1/

E.

chmod g+x Q1/

Buy Now
Questions 91

A systems administrator is troubleshooting a connectivity issue pertaining to access to a system named db.example.com. The system IP address should be 192.168.20.88. The administrator issues the dig command and receives the following output:

XK0-005 Question 91

The administrator runs grep db.example.com /etc/hosts and receives the following output:

XK0-005 Question 91

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

Options:

A.

Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.

B.

Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.

C.

Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.

D.

Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.

Buy Now
Questions 92

Users in the human resources department are trying to access files in a newly created directory. Which of the following commands will allow the users access to the files?

Options:

A.

chattr

B.

chgrp

C.

chage

D.

chcon

Buy Now
Questions 93

The group named support is unable to make changes to the config file. An administrator is reviewing the permissions and sees the following:

S Is -1 config

-rw-rw----. 1 root app 4682 02-15 11:25 config

Which of the following should the administrator execute in order to give the support group access to modify the file while preserving the current ownership?

Options:

A.

chown :support config

B.

setfacl -m g:support:rw- config

C.

chmod 664 config

D.

chmod g+s config

Buy Now
Questions 94

A systems administrator is tasked with installing GRUB on the legacy MBR of the SATA hard drive. Which of the following commands will help the administrator accomplish this task?

Options:

A.

grub-install /dev/hda

B.

grub-install /dev/sda

C.

grub-install /dev/sr0

D.

grub-install /dev/hd0,0

Buy Now
Questions 95

A developer is trying to install an application remotely that requires a graphical interface for installation. The developer requested assistance to set up the necessary environment variables along with X11 forwarding in SSH. Which of the following environment variables must be set in remote shell in order to launch the graphical interface?

Options:

A.

$RHOST

B.

SETENV

C.

$SHELL

D.

$DISPLAY

Buy Now
Questions 96

A user (userA) has reported issues while logging in to the system. The following output has been provided:

bash

Could not chdir to home directory /home/userA: Permission denied

-bash: /home/userA/.bash_profile: Permission denied

# cat /etc/passwd | grep userA

userA:x:1234:3400:userA account:/home/userA/:/bin/bash

# passwd -S userA

userA PS 2022-10-17 1 99999 0 (Password set. SHA512 crypt.)

# groups userA

admin dev usergrp

# ls -lth /home/

drwx------ 7 root admin 9 Jan 17 2019 userA

drwxr-xr-x 4 userC app 9 Jan 23 2020 userC

Which of the following describes the issue userA is having?

Options:

A.

The password for userA is not set

B.

The group for userA is not assigned correctly

C.

The account password for userA has expired

D.

The assigned home directory is not owned by userA

Buy Now
Questions 97

A Linux administrator deployed a large-scale application service as a containerized pod. The Linux administrator needs to continually send the application's log file to the company’s central log store. Which of the following should the Linux administrator do to efficiently perform this task?

Options:

A.

Configure a sidecar to perform log shipping

B.

Run docker exec to access the logs within the container

C.

Execute docker inspect and run a log rsync replication

D.

Set up a custom task scheduler via kubectl

Buy Now
Questions 98

A systems administrator is tasked with configuring a repository on an RPM-based Linux system. Which of the following need to be reviewed and modified? (Select two).

Options:

A.

/etc/yum.conf

B.

/etc/apt/sources.list.d

C.

/etc/pam.d

D.

/etc/apt.conf

E.

/etc/yum.repos.d

F.

/etc/ssh/ssh_config

Buy Now
Questions 99

After connecting to a remote host via SSH, an administrator attempts to run an application but receives the following error:

arduino

Error: cannot open display:

Which of the following should the administrator do to resolve this error?

Options:

A.

Disconnect from the SSH session and reconnect using the ssh -X command

B.

Add Options X11 to the /home/admin/.ssh/authorized_keys file

C.

Open port 6000 on the workstation and restart the firewalld service

D.

Enable X11 forwarding in /etc/ssh/ssh_config and restart the server

Buy Now
Questions 100

A Linux administrator needs to create a new user named user02. However, user02 must be in a different home directory, which is under /comptia/projects. Which of the following commands will accomplish this task?

Options:

A.

useradd -d /comptia/projects user02

B.

useradd -m /comptia/projects user02

C.

useradd -b /comptia/projects user02

D.

useradd -s /comptia/projects user02

Buy Now
Questions 101

An administrator recently updated the BIND software package and would like to review the default configuration that shipped with this version. Which of the following files should the administrator review?

Options:

A.

/etc/named.conf.rpmnew

B.

/etc/named.conf.rpmsave

C.

/etc/named.conf

D.

/etc/bind/bind.conf

Buy Now
Questions 102

A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:

XK0-005 Question 102

Based on the output above, which of following is the MOST probable cause of the issue?

Options:

A.

The address ac:00:11:22:33:cd is not a valid Ethernet address.

B.

The Ethernet broadcast address should be ac:00:11:22:33:ff instead.

C.

The network interface eth0 is using an old kernel module.

D.

The network interface cable is not connected to a switch.

Buy Now
Questions 103

A hardened physical Linux system allows regular, unprivileged users to remotely connect to the server using SSH only. No sudo tool has been installed. Which of the following should the Linux administrator use to perform administrative tasks on this host? (Select two).

Options:

A.

Create an SSH key and copy it to the remote server to allow passwordless login

B.

Access the server’s physical console and use the root user's password to log in

C.

Install the telnet server on this system to be able to use a root account

D.

Use the su command and enter the root user’s password

E.

Install the sudo command using the unprivileged user’s account

F.

Add the user to the wheel group

Buy Now
Questions 104

A systems administrator wants to check for running containers. Which of the following commands can be used to show this information?

Options:

A.

docker pull

B.

docker stats

C.

docker ps

D.

docker list

Buy Now
Questions 105

The administrator comptia is not able to perform privileged functions on a newly deployed system. Given the following command outputs:

XK0-005 Question 105

Which of the following is the reason that the administrator is unable to perform the assigned duties?

Options:

A.

The administrator needs a password reset.

B.

The administrator is not a part of the correct group.

C.

The administrator did not update the sudo database.

D.

The administrator's credentials need to be more complex.

Buy Now
Questions 106

A Linux administrator is alerted to a storage capacity issue on a server without a specific mount point or directory. Which of the following commands would be MOST helpful for troubleshooting? (Choose two.)

Options:

A.

parted

B.

df

C.

mount

D.

du

E.

fdisk

F.

dd

G.

ls

Buy Now
Questions 107

The application team has reported latency issues that are causing the application to crash on the Linux server. The Linux administrator starts

troubleshooting and receives the following output:

XK0-005 Question 107

Which of the following commands will improve the latency issue?

Options:

A.

# echo 'net.core.net_backlog = 5000000' >> /etc/sysctl.conf

# sysctl -p

# systemctl daemon-reload

B.

# ifdown eth0

# ip link set dev eth0 mtu 800

# ifup eth0

C.

# systemctl stop network

# ethtool -g eth0 512

# systemctl start network

D.

# echo 'net.core.rmem max = 12500000' >> /etc/sysctl.conf

# echo 'net.core.wmem_max = 12500000' >> /etc/sysctl.conf

# sysctl -p

Buy Now
Questions 108

A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?

Options:

A.

docker run -ti app /bin/sh

B.

podman exec -ti app /bin/sh

C.

podman run -d app /bin/bash

D.

docker exec -d app /bin/bash

Buy Now
Questions 109

An administrator thinks that a package was installed using a snap. Which of the following commands can the administrator use to verify this information?

Options:

A.

snap list

B.

snap find

C.

snap install

D.

snap try

Buy Now
Questions 110

A systems administrator wants to upgrade /bin/ someapp to a new version, but the administrator does not know the package name. Which of the following will

show the RPM package name that provides that binary file?

Options:

A.

rpm —qf /bin/ someapp

B.

rpm —Vv / bin/ someapp

C.

rpm - P / bin/ some app

D.

rpm —i / bin/ someapp

Buy Now
Questions 111

A cloud engineer is installing packages during VM provisioning. Which of the following should the engineer use to accomplish this task?

Options:

A.

Cloud-init

B.

Bash

C.

Docker

D.

Sidecar

Buy Now
Questions 112

A Linux administrator was notified that a virtual server has an I/O bottleneck. The Linux administrator analyzes the following output:

XK0-005 Question 112

Given there is a single CPU in the sever, which of the following is causing the slowness?

Options:

A.

The system is running out of swap space.

B.

The CPU is overloaded.

C.

The memory is exhausted.

D.

The processes are paging.

Buy Now
Exam Code: XK0-005
Exam Name: CompTIA Linux+ Exam
Last Update: Nov 19, 2024
Questions: 376

PDF + Testing Engine

$56  $159.99

Testing Engine

$42  $119.99
buy now XK0-005 testing engine

PDF (Q&A)

$35  $99.99
buy now XK0-005 pdf
dumpsmate guaranteed to pass
24/7 Customer Support

DumpsMate's team of experts is always available to respond your queries on exam preparation. Get professional answers on any topic of the certification syllabus. Our experts will thoroughly satisfy you.

Site Secure

mcafee secure

TESTED 21 Nov 2024