Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtick70

XK0-005 CompTIA Linux+ Exam Questions and Answers

Questions 4

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 5

A Linux administrator is creating a user that can run the FTP service but cannot log in to the system. The administrator sets /bin/false as a login shell for the user. When the user tries to run the FTP service, it is rejected with an "invalid shell: /bin/false" message. Which of the following is the best way to resolve the issue?

Options:

A.

Change ownership of /bin/false to the FTP user

B.

Add /bin/false entry to the /etc/shells file

C.

Make /bin/false an executable file

D.

Change the user’s default shell to /bin/bash

Buy Now
Questions 6

A Linux administrator booted up the server and was presented with a non-GUI terminal. The administrator ran the command systemct1 isolate graphical.target and rebooted the system by running systemct1 reboot, which fixed the issue. However, the next day the administrator was presented again with a non-GUI terminal. Which of the following is the issue?

Options:

A.

The administrator did not reboot the server properly.

B.

The administrator did not set the default target to basic.target.

C.

The administrator did not set the default target to graphical.target.

D.

The administrator did not shut down the server properly.

Buy Now
Questions 7

A Linux engineer set up two local DNS servers (10.10.10.10 and 10.10.10.20) and was testing email connectivity to the local mail server using the mail command on a local machine when the following error appeared:

The local machine DNS settings are:

Which of the following commands could the engineer use to query the DNS server to get mail server information?

Options:

A.

dig @example.com 10.10.10.20 a

B.

dig @10.10.10.20 example.com mx

C.

dig @example.com 10.10.10.20 ptr

D.

dig @10.10.10.20 example.com ns

Buy Now
Questions 8

A Linux administrator needs to determine whether a hostname is in the DNS. Which of the following would supply the information that is needed?

Options:

A.

nslookup

B.

rsynс

C.

netstat

D.

host

Buy Now
Questions 9

A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command:

The following output is returned

Which of the following is MOST likely the issue?

Options:

A.

The service does not have permissions to read write the startupfile.

B.

The service startupfile size cannot be 81k.

C.

The service startupfile cannot be owned by root.

D.

The service startupfile should not be owned by the root group.

Buy Now
Questions 10

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 11

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:

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 12

A systems administrator made some unapproved changes prior to leaving the company. The newly hired administrator has been tasked with revealing the system to a compliant state. Which of the following commands will list and remove the correspondent packages?

Options:

A.

dnf list and dnf remove last

B.

dnf remove and dnf check

C.

dnf info and dnf upgrade

D.

dnf history and dnf history undo last

Buy Now
Questions 13

A systems administrator is tasked with mounting a USB drive on a system. The USB drive has a single partition, and it has been mapped by the system to the device /dev/sdb. Which of the following commands will mount the USB to /media/usb?

Options:

A.

mount /dev/sdb1 /media/usb

B.

mount /dev/sdb0 /media/usb

C.

mount /dev/sdb /media/usb

D.

mount -t usb /dev/sdb1 /media/usb

Buy Now
Questions 14

A Linux administrator is creating a new sudo profile for the accounting user. Which of the following should be added by the administrator to the sudo

configuration file so that the accounting user can run / opt/ acc/ report as root?

Options:

A.

accounting localhost=/opt/acc/report

B.

accounting ALL=/opt/acc/report

C.

%accounting ALL=(ALL) NOPASSWD: /opt/acc/report

D.

accounting /opt/acc/report= (ALL) NOPASSWD: ALL

Buy Now
Questions 15

Which of the following should be used to verify the integrity of a file?

Options:

A.

sha256sum

B.

fsck

C.

gpg —d

D.

hashcat

Buy Now
Questions 16

A Linux administrator is tasked with moving files in a database server. The administrator must not overwrite any existing files. Which of the following commands would indicate that the file already exists?

Options:

A.

mv-ifilename/tmp/backup

B.

mv-bfilename/tmp/backup

C.

mv-nfilename/tmp/backup

D.

mv-ffilename/tmp/backup

Buy Now
Questions 17

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 18

A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)

Options:

A.

Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.

B.

Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line.

C.

Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.

D.

Interrupt the boot process in the GRUB menu and add single=user in the kernel line.

E.

Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.

F.

Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.

Buy Now
Questions 19

An administrator created an initial Git repository and uploaded the first files. The administrator sees the following when listing the repository:

The administrator notices the file . DS STORE should not be included and deletes it from the online repository. Which of the following should the administrator run from the root of the local repository before the next commit to ensure the file is not uploaded again in future commits?

Options:

A.

rm -f .DS STORE && git push

B.

git fetch && git checkout .DS STORE

C.

rm -f .DS STORE && git rebase origin main

D.

echo .DS STORE >> .gitignore

Buy Now
Questions 20

A junior administrator is setting up a new Linux server that is intended to be used as a router at a remote site. Which of the following parameters will accomplish this goal?

Options:

A.

B.

C.

D.

Buy Now
Questions 21

A Linux administrator is troubleshooting a memory-related issue. Based on the output of the commands:

Which of the following commands would address the issue?

Options:

A.

top -p 8321

B.

kill -9 8321

C.

renice -10 8321

D.

free 8321

Buy Now
Questions 22

A DevOps engineer needs to allow incoming traffic to ports in the range of 4000 to 5000 on a Linux server. Which of the following commands will enforce this rule?

Options:

A.

iptables -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT

B.

iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT

C.

iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT

D.

iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT

Buy Now
Questions 23

At what point is the Internal Certificate Authority (ICA) created?

Options:

A.

During the primary Security Management Server installation process.

B.

Upon creation of a certificate.

C.

When an administrator decides to create one.

D.

When an administrator initially logs into SmartConsole.

Buy Now
Questions 24

Application code is stored in Git. Due to security concerns, the DevOps engineer does not want to keep a sensitive configuration file, app . conf, in the

repository. Which of the following should the engineer do to prevent the file from being uploaded to the repository?

Options:

A.

Run git exclude app. conf.

B.

Run git stash app. conf.

C.

Add app . conf to . exclude.

D.

Add app . conf to . gitignore.

Buy Now
Questions 25

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 26

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 27

A Linux engineer needs to block an incoming connection from the IP address 2.2.2.2 to a secure shell server and ensure the originating IP address receives a response that a firewall is blocking the connection. Which of the following commands can be used to accomplish this task?

Options:

A.

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j DROP

B.

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j RETURN

C.

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j REJECT

D.

iptables -A INPUT -p tcp -- dport ssh -s 2.2.2.2 -j QUEUE

Buy Now
Questions 28

Several users reported that they were unable to write data to the /oracle1 directory. The following output has been provided:

Which of the following commands should the administrator use to diagnose the issue?

Options:

A.

df -i /oracle1

B.

fdisk -1 /dev/sdb1

C.

lsblk /dev/sdb1

D.

du -sh /oracle1

Buy Now
Questions 29

An administrator deployed a Linux server that is running a web application on port 6379/tcp.

SELinux is in enforcing mode based on organization policies.

The port is open on the firewall.

Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.

The administrator ran some commands that resulted in the following output:

Which of the following commands should be used to resolve the issue?

Options:

A.

semanage port -d -t http_port_t -p tcp 6379

B.

semanage port -a -t http_port_t -p tcp 6379

C.

semanage port -a http_port_t -p top 6379

D.

semanage port -l -t http_port_tcp 6379

Buy Now
Questions 30

A new disk was presented to a server as /dev/ sdd. The systems administrator needs to check if a partition table is on that disk. Which of the following commands can show this information?

Options:

A.

Isscsi

B.

fdisk

C.

blkid

D.

partprobe

Buy Now
Questions 31

A cloud engineer needs to block the IP address 192.168.10.50 from accessing a Linux server. Which of the following commands will achieve this goal?

Options:

A.

iptables -F INPUT -j 192.168.10.50 -m DROP

B.

iptables -A INPUT -s 192.168.10.30 -j DROP

C.

iptables -i INPUT --ipv4 192.168.10.50 -z DROP

D.

iptables -j INPUT 192.168.10.50 -p DROP

Buy Now
Questions 32

Which of the following is a benefit of a service mesh?

Options:

A.

Encrypted communication between two services in a Kubernetes environment

B.

Direct access to the Kubernetes API services through the use of tokens

C.

Elevated privileges in a Kubernetes pod to allow root access in a hardened cluster

D.

Creating PVCs in a Kubernetes cluster to store and manage persistent data

Buy Now
Questions 33

A cloud engineer needs to check the link status of a network interface named eth1 in a Linux server. Which of the following commands can help to achieve the goal?

Options:

A.

ifconfig hw eth1

B.

netstat -r eth1

C.

ss -ti eth1

D.

ip link show eth1

Buy Now
Questions 34

A systems administrator is working on a security report from the Linux servers. Which of the following commands can the administrator use to display all the firewall rules applied to the Linux servers? (Select two).

Options:

A.

ufw limit

B.

iptables —F

C.

systemct1 status firewalld

D.

firewall—cmd ——1ist—a11

E.

ufw status

F.

iptables —A

Buy Now
Questions 35

A Linux administrator was tasked with deleting all files and directories with names that are contained in the sobelete.txt file. Which of the following commands will accomplish this task?

Options:

A.

xargs -f cat toDelete.txt -rm

B.

rm -d -r -f toDelete.txt

C.

cat toDelete.txt | rm -frd

D.

cat toDelete.txt | xargs rm -rf

Buy Now
Questions 36

A junior systems administrator has just generated public and private authentication keys for passwordless login. Which of the following files will be moved to the remote servers?

Options:

A.

id_dsa.pem

B.

id_rsa

C.

id_ecdsa

D.

id_rsa.pub

Buy Now
Questions 37

A systems administrator notices the process list on a mission-critical server has a large number of processes that are in state "Z" and marked as "defunct." Which of the following should the administrator do in an attempt to safely remove these entries from the process list?

Options:

A.

Kill the process with PID 1.

B.

Kill the PID of the processes.

C.

Kill the parent PID of the processes.

D.

Reboot the server.

Buy Now
Questions 38

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:

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

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 39

A systems administrator needs to verify whether the built container has the app.go file in its root directory. Which of the following can the administrator use to verify the root directory has this file?

Options:

A.

docker image inspect

B.

docker container inspect

C.

docker exec ls

D.

docker ps

Buy Now
Questions 40

Based on an organization’s new cybersecurity policies, an administrator has been instructed to ensure that, by default, all new users and groups that are created fall within the specified values below.

To which of the following configuration files will the required changes need to be made?

Options:

A.

/etc/login.defs

B.

/etc/security/limits.conf

C.

/etc/default/useradd

D.

/etc/profile

Buy Now
Questions 41

A Linux administrator has set up a new DNS forwarder and is configuring all internal servers to use the new forwarder to look up external DNS requests. The administrator needs to modify the firewall on the server for the DNS forwarder to allow the internal servers to communicate to it and make the changes persistent between server reboots. Which of the following commands should be run on the DNS forwarder server to accomplish this task?

Options:

A.

ufw allow out dns

B.

systemct1 reload firewalld

C.

iptables -A OUTPUT -p udp -ra udp -dport 53 -j ACCEPT

D.

flrewall-cmd --zone-public --add-port-53/udp --permanent

Buy Now
Questions 42

A Linux administrator logs in to a system and identifies that an important backup has been started. The backup process is consuming a considerable amount of CPU time but needs to continue. Which of the following should the administrator use to reduce the impact this process has on other services?

Options:

A.

renice -n 15 -p

B.

nice -n 15 -p

C.

renice -n -15 -p

D.

nice -n -15 -p

Buy Now
Questions 43

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 44

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 45

A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

Options:

A.

podman run -d -p 443:8443 httpd

B.

podman run -d -p 8443:443 httpd

C.

podman run –d -e 443:8443 httpd

D.

podman exec -p 8443:443 httpd

Buy Now
Questions 46

A junior administrator is trying to set up a passwordless SSH connection to one of the servers. The administrator follows the instructions and puts the key in the authorized_key file at the server, but the administrator is still asked to provide a password during the connection.

Given the following output:

Which of the following commands would resolve the issue and allow an SSH connection to be established without a password?

Options:

A.

restorecon -rv .ssh/authorized_key

B.

mv .ssh/authorized_key .ssh/authorized_keys

C.

systemct1 restart sshd.service

D.

chmod 600 mv .ssh/authorized_key

Buy Now
Questions 47

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 48

A Linux administrator wants to find out whether files from the wget package have been altered since they were installed. Which of the following commands will provide the correct information?

Options:

A.

rpm -i wget

B.

rpm -qf wget

C.

rpm -F wget

D.

rpm -V wget

Buy Now
Questions 49

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 50

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 51

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 52

A Linux system is failing to boot. The following error is displayed in the serial console:

[[1;33mDEPEND[Om] Dependency failed for /data.

[[1;33mDEPEND[Om] Dependency failed for Local File Systems

...

Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemct1 reboot" to reboot, "systemct1 default" to try again to boot into default mode.

Give root password for maintenance

(or type Control-D to continue}

Which of the following files will need to be modified for this server to be able to boot again?

Options:

A.

/etc/mtab

B.

/dev/sda

C.

/etc/fstab

D.

/ete/grub.conf

Buy Now
Questions 53

A junior Linux administrator is tasked with installing an application. The installation guide states the application should only be installed in a run level 5 environment.

Which of the following commands would ensure the server is set to runlevel 5?

Options:

A.

systemct1 isolate multi-user.target

B.

systemct1 isolate graphical.target

C.

systemct1 isolate network.target

D.

systemct1 isolate basic.target

Buy Now
Questions 54

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 55

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 56

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 57

A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?

Options:

A.

The checkdiskspace.service is not running.

B.

The checkdiskspace.service needs to be enabled.

C.

The OnCalendar schedule is incorrect in the timer definition.

D.

The system-daemon services need to be reloaded.

Buy Now
Questions 58

A Linux administrator needs to create a symlink for /usr/local/bin/app-a, which was installed in /usr/local/share/app-a. Which of the following commands should the administrator use?

Options:

A.

In -s /usr/local/bin/app-a /usr/local/share/app-a

B.

mv -f /usr/local/share/app-a /usr/local/bin/app-a

C.

cp -f /usr/local/share/app-a /usr/local/bin/app-a

D.

rsync -a /usr/local/share/app-a /usr/local/bin/app-a

Buy Now
Questions 59

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

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 60

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

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
Questions 61

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 62

A Linux administrator is troubleshooting SSH connection issues from one of the workstations.

When users attempt to log in from the workstation to a server with the IP address 104.21.75.76, they receive the following message:

The administrator reviews the information below:

Which of the following is causing the connectivity issue?

Options:

A.

The workstation has the wrong IP settings.

B.

The sshd service is disabled.

C.

The server’s firewall is preventing connections from being made.

D.

The server has an incorrect default gateway configuration.

Buy Now
Questions 63

A systems administrator received a request to change a user's credentials. Which of the following commands will grant the request?

Options:

A.

sudo passwd

B.

sudo userde 1

C.

sudo chage

D.

sudo usermod

Buy Now
Questions 64

An administrator wants to execute a long-running script in the terminal while troubleshooting another issue. Which of the following options will achieve this goal?

Options:

A.

bash script.sh &

B.

source script.sh

C.

sh script.sh | jobs

D.

nice -10 ./script.sh

Buy Now
Questions 65

An application developer received a file with the following content:

##This is a sample Image ##

FROM ubuntu:18.04

MAINTAINER demohut@gtmail.com.hac

COPY . /app

RUN make /app

CMD python /app/app.py

RUN apt-get update

RUN apt-get install -y nginx

CMD ["echo","Image created"]

The developer must use this information to create a test bed environment and identify the image (myimage) as the first version for testing a new

application before moving it to production. Which of the following commands will accomplish this task?

Options:

A.

docker build -t myimage:1.0 .

B.

docker build -t myimage: .

C.

docker build -t myimage-1.0 .

D.

docker build -i myimage:1.0 .

Buy Now
Questions 66

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 67

A Linux administrator needs to run a web application on a server that requires the use of a desktop web browser to enter the final configuration information. The administrator determines the server is running in multi-user mode. The administrator verifies that a web browser is installed on the server and that it has a display manager installed. Which of the following commands will best allow the administrator to temporarily use the web browser on the server?

Options:

A.

sudo systemctl isolate graphical.target

B.

sudo systemctl set-default runlevel5.target

C.

sudo systemctl restart gdm

D.

sudo systemctl --no-wall rescue

Buy Now
Questions 68

An administrator would like to securely connect to a server and forward port 8080 on a local machine to port 80 on the server. Which of the following commands should the administrator use to satisfy both requirements?

Options:

A.

ssh —L 8080: localhost:80 admin@server

B.

ssh —R 8080: localhost:80 admin@server

C.

ssh —L 80 : localhost:8080 admin@server

D.

ssh —R 80 : localhost:8080 admin@server

Buy Now
Questions 69

A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a reposito-ry to share with the systems team. A junior Linux administrator needs to re-trieve the scripts and make them available on a local workstation. Which of the following Git commands should the junior Linux administrator use to accom-plish this task?

Options:

A.

fetch

B.

checkout

C.

clone

D.

branch

Buy Now
Questions 70

Which of the following is the best tool for dynamic tuning of kernel parameters?

Options:

A.

tuned

B.

tune2fs

C.

tuned-adm

D.

turbostat

Buy Now
Questions 71

A systems administrator checked out the code from the repository, created a new branch, made changes to the code, and then updated the main branch. The systems administrator wants to ensure that the Terraform state files do not appear in the main branch. Which of following should the administrator use to meet this requirement?

Options:

A.

clone

B.

gitxgnore

C.

get

D.

.ssh

Buy Now
Questions 72

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:

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 73

A junior administrator updated the PostgreSQL service unit file per the data-base administrator's recommendation. The service has been restarted, but changes have not been applied. Which of the following should the administrator run for the changes to take effect?

Options:

A.

Systemct1 get—default

B.

systemct1 daemon—reload

C.

systemct1 enable postgresq1

D.

systemct1 mask postgresq1

Buy Now
Questions 74

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 75

An administrator would like to list all current containers, regardless of their running state. Which of the following commands would allow the administrator to accomplish this task?

Options:

A.

docker ps -a

B.

docker list

C.

docker image ls

D.

docker inspect image

Buy Now
Questions 76

A developer has been unable to remove a particular data folder that a team no longer uses. The developer escalated the issue to the systems administrator. The following output was received:

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

Options:

A.

chgrp -R 755 data/

B.

chmod -R 777 data/

C.

chattr -R -i data/

D.

chown -R data/

Buy Now
Questions 77

Which of the following can be used as a secure way to access a remote termi-nal?

Options:

A.

TFTP

B.

SSH

C.

SCP

D.

SFTP

Buy Now
Questions 78

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 79

A user reported issues when trying to log in to a Linux server. The following outputs were received:

Given the outputs above. which of the following is the reason the user is una-ble to log in to the server?

Options:

A.

User1 needs to set a long password.

B.

User1 is in the incorrect group.

C.

The user1 shell assignment incorrect.

D.

The user1 password is expired.

Buy Now
Questions 80

An administrator attempts to connect to a remote server by running the following command:

$ nmap 192.168.10.36

Starting Nmap 7.60 ( https://nmap.org ) at 2022-03-29 20:20 UTC

Nmap scan report for www1 (192.168.10.36)

Host is up (0.000091s latency).

Not shown: 979 closed ports

PORT STATE SERVICE

21/tcp open ftp

22/tcp filtered ssh

631/tcp open ipp

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds

Which of the following can be said about the remote server?

Options:

A.

A firewall is blocking access to the SSH server.

B.

The SSH server is not running on the remote server.

C.

The remote SSH server is using SSH protocol version 1.

D.

The SSH host key on the remote server has expired.

Buy Now
Questions 81

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 the 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-repository.mount

B.

ExecStart=/usr/bin/mount -a

C.

Requires=docker-repository.mount

D.

RequiresMountsFor=docker-repository.mount

Buy Now
Questions 82

An administrator needs to increase the system priority of a process with PID 2274. Which of the following commands should the administrator use to

accomplish this task?

Options:

A.

renice —n —15 2274

B.

nice -15 2274

C.

echo "—15" > /proc/PID/2274/priority

D.

ps —ef I grep 2274

Buy Now
Questions 83

A systems administrator pressed Ctrl+Z after starting a program using the command line, and the shell prompt was presented. In order to go back to the program, which of the following commands can the administrator use?

Options:

A.

fg

B.

su

C.

bg

D.

ed

Buy Now
Questions 84

A systems engineer is adding a new 1GB XFS filesystem that should be temporarily mounted under /ops/app. Which of the following is the correct list of commands to achieve this goal?

Options:

A.

B.

C.

D.

Buy Now
Questions 85

An administrator would like to mirror the website files on the primary web server, www1, to the backup web server, www2. Which of the following commands

should the administrator use to most efficiently accomplish this task?

Options:

A.

[wwwl ] rsync —a —e ssh /var/www/html/ user1@www2 : /var/www/html

B.

[ wwwl ] scp —r /var/www/html user1@www2 : / var/www/html

C.

[www2 ] cd /var/www/html; wget —m http: //wwwl/

D.

[wwwl ] cd /var/www/html && tar cvf —

Buy Now
Questions 86

A systems administrator needs to know the mail exchange (MX) record for the foo.com domain. Which of the following commands will accomplish this task?

Options:

A.

telnet mx foo.com

B.

dig mx foo.com

C.

nslookup mx foo.com

D.

host mx foo.com

Buy Now
Questions 87

After installing a new version of a package, a systems administrator notices a new version of the corresponding, service file was Installed In order to use the new version of the, service file, which of the following commands must be Issued FIRST?

Options:

A.

systemct1 status

B.

systemct1 stop

C.

systemct1 reinstall

D.

systemct1 daemon-reload

Buy Now
Questions 88

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the Is command. The

output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?

Options:

A.

su - Joe

B.

sudo Joe

C.

visudo Joe

D.

pkexec joe

Buy Now
Questions 89

A Linux administrator is trying to remove the ACL from the file /home/user/data. txt but receives the following error message:

Given the following analysis:

Which of the following is causing the error message?

Options:

A.

The administrator is not using a highly privileged account.

B.

The filesystem is mounted with the wrong options.

C.

SELinux file context is denying the ACL changes.

D.

File attributes are preventing file modification.

Buy Now
Questions 90

Which of the following commands will display the operating system?

Options:

A.

uname -n

B.

uname -s

C.

uname -o

D.

uname -m

Buy Now
Questions 91

A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?

Options:

A.

hostnamectl status --no-ask-password

B.

hostnamectl set-hostname "$(perl -le "print" "A" x 86)"

C.

hostnamectl set-hostname Comptia-WebNode -H root@192.168.2.14

D.

hostnamectl set-hostname Comptia-WebNode --transient

Buy Now
Questions 92

A systems administrator is encountering performance issues. The administrator runs 3 commands with the following output

The Linux server has the following system properties

CPU: 4 vCPU

Memory: 50GB

Which of the following accurately describes this situation?

Options:

A.

The system is under CPU pressure and will require additional vCPUs

B.

The system has been running for over a year and requires a reboot.

C.

Too many users are currently logged in to the system

D.

The system requires more memory

Buy Now
Questions 93

A systems administrator created a user cron to run a scheduled database backup cronjob on the server at 1 a.m. every day. The following is the cronjob syntax:

0 1 * * * /bin/sh backup.sh

The backups, however, are not being created. When checking the crontab file, the administrator sees the following error:

/var/spool/cron/crontab/cron: Permission denied

Which of the following will permit the cronjob to execute?

Options:

A.

Creating the file cron.allow and adding user cron to it

B.

Giving cron ownership of the file /usr/bin/crontab

C.

Running sudo cron restart to activate the cronjob

D.

Running sudo crontab -u cron -e to edit the file with sudo

Buy Now
Questions 94

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 95

Which of the following commands should a technician use to create an administrative account for the username Joe?

Options:

A.

sudo useradd -G wheel joe

B.

sudo useradd joe; sudo passwd -l joe

C.

sudo useradd joe; sudo cat key.pem > ~/.ssh/authorized_keys

D.

sudo useradd joe; groupadd admin joe

Buy Now
Questions 96

The development team created a new branch with code changes that a Linux administrator needs to pull from the remote repository. When the administrator looks for the branch in Git, the branch in question is not visible. Which of the following commands should the Linux administrator run to refresh the branch information?

Options:

A.

git fetch

B.

git checkout

C.

git clone

D.

git branch

Buy Now
Questions 97

Users have reported that the interactive sessions were lost on a Linux server. A Linux administrator verifies the server was switched to rescue.target mode for maintenance. Which of the following commands will restore the server to its usual target?

Options:

A.

telinit 0

B.

systemct1 reboot

C.

systemct1 get-default

D.

systemct1 emergency

Buy Now
Questions 98

A systems administrator was tasked with assigning the temporary IP address/netmask 192.168.168.1/255.255.255.255 to the interface eth0 of a Linux server.

When adding the address, the following error appears:

# ip address add 192.168.168.1/33 dev eth0

Error: any valid prefix is expected rather than "192.168.168.1/33".

Based on the command and its output above, which of the following is the cause of the issue?

Options:

A.

The CIDR value /33 should be /32 instead.

B.

There is no route to 192.168.168.1/33.

C.

The interface eth0 does not exist.

D.

The IP address 192.168.168.1 is already in use.

Buy Now
Questions 99

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.

Options:

Buy Now
Questions 100

A Linux administrator intends to start using KVM on a Linux server. Which of the following commands will allow the administrator to load the KVM module as

well as any related dependencies?

Options:

A.

modprobe kvm

B.

insmod kvm

C.

depmod kvm

D.

hotplug kvm

Buy Now
Questions 101

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 102

Joe, a user, is unable to log in to the Linux system. Given the following output:

Which of the following commands would resolve the issue?

Options:

A.

usermod -s /bin/bash joe

B.

pam_tally2 -u joe -r

C.

passwd -u joe

D.

chage -E 90 joe

Buy Now
Questions 103

A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task?

Options:

A.

echo 1 > /proc/sys/net/ipv4/ipv_forward

B.

sysctl -w net.ipv4.ip_forward=1

C.

firewall-cmd --enable ipv4_forwarding

D.

systemct1 start ipv4_forwarding

Buy Now
Questions 104

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 105

A systems administrator wants to delete app . conf from a Git repository. Which of the following commands will delete the file?

Options:

A.

git tag app. conf

B.

git commit app . conf

C.

git checkout app . conf

D.

git rm app. conf

Buy Now
Questions 106

A Linux administrator is providing a new Nginx image from the registry to local cache. Which of the following commands would allow this to happen?

Options:

A.

docker pull nginx

B.

docker attach nginx

C.

docker commit nginx

D.

docker import nginx

Buy Now
Questions 107

An administrator added the port 2222 for the SSH server on myhost and restarted the SSH server. The administrator noticed issues during the startup of the service. Given the following outputs:

Which of the following commands will fix the issue?

Options:

A.

semanage port -a -t ssh_port_t -p tcp 2222

B.

chcon system_u:object_r:ssh_home_t /etc/ssh/*

C.

iptables -A INPUT -p tcp -- dport 2222 -j ACCEPT

D.

firewall-cmd -- zone=public -- add-port=2222/tcp

Buy Now
Questions 108

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 109

The users of a Linux system are unable to use one of the application filesystems. The following outputs have been provided:

bash

$ cd /app

$ touch file

touch: cannot touch 'file': Readonly file system

Output 2

/dev/sdcl on /app type ext4 (ro,relatime,seclabel,data=ordered)

Output 3

/dev/sdcl /app ext4 defaults 0 0

Output 4

[302.048075] Buffer I/O error on dev sdcl, logical block 0, async page read

[302.048490] EXT4-fs (sdcl): Attempt to read block from filesystem resulted in short read while trying to re-open /dev/sdcl

Which of the following actions will resolve this issue?

Options:

A.

umount /app fsck -y /dev/sdcl mount /app

B.

xfs_repair /dev/sdcl mount -o rw,remount /app

C.

umount /app xfs_repair /dev/sdcl mount /app

D.

fsck -y /dev/sdcl mount -o rw,remount /app

Buy Now
Questions 110

The group owner of the / home/ test directory would like to preserve all group permissions on files created in the directory. Which of the following

commands should the group owner execute?

Options:

A.

chmod g+s /home/test

B.

chgrp test /home/test

C.

chmod 777 /home/test

D.

chown —hR test /home/test

Buy Now
Questions 111

Which of the following directories is the mount point in a UEFI system?

Options:

A.

/sys/efi

B.

/boot/efi

C.

/efi

D.

/etc/efi

Buy Now
Questions 112

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

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

Linux+ |

Exam Code: XK0-005
Exam Name: CompTIA Linux+ Exam
Last Update: Nov 24, 2024
Questions: 376
XK0-005 pdf

XK0-005 PDF

$25.5  $84.99
XK0-005 Engine

XK0-005 Testing Engine

$30  $99.99
XK0-005 PDF + Engine

XK0-005 PDF + Testing Engine

$40.5  $134.99