Back to CompTIA Linux+ XK0-005 questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise CompTIA Linux+ XK0-005 practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
XK0-005
exam code
CompTIA
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related XK0-005 topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1mediummultiple choice
Full question →

Based on the exhibit, which statement is true about the sshd service?

Exhibit

Refer to the exhibit.

$ systemctl status sshd.service
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-06-12 10:23:45 UTC; 2h 15min ago
 Main PID: 1234 (sshd)
   CGroup: /system.slice/sshd.service
           └─1234 /usr/sbin/sshd -D
Question 2mediummultiple choice
Full question →

A user reports that the /data directory is inaccessible. The Linux administrator runs the commands shown in the exhibit. Which of the following is the most likely cause of the issue?

Exhibit

Refer to the exhibit.

# mount | grep /data
/dev/sdb1 on /data type ext4 (rw,relatime,errors=remount-ro)
# df -h /data
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       9.8G  9.5G     0 100% /data
# ls -la /data | head
ls: reading directory /data: Input/output error
Question 3hardmultiple choice
Full question →

Based on the exhibit, what is the most likely cause of the sshd service failure?

Exhibit

Refer to the exhibit.

# systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2023-10-23 14:30:01 UTC; 5min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 1234 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
 Main PID: 1234 (code=exited, status=255)

Oct 23 14:30:01 server sshd[1234]: fatal: Cannot bind to port 22: Address already in use
Question 4mediummultiple choice
Full question →

Based on the exhibit, the myapp service fails to start. Which troubleshooting step should be taken first?

Exhibit

Refer to the exhibit.

# cat /etc/systemd/system/myapp.service
[Unit]
Description=My Application
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/myapp
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

# systemctl daemon-reload
# systemctl start myapp
# systemctl status myapp
● myapp.service - My Application
   Loaded: loaded (/etc/systemd/system/myapp.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since ...
  Process: 5678 ExecStart=/usr/local/bin/myapp (code=exited, status=1/FAILURE)

Oct 23 15:00:00 server myapp[5678]: Error: Configuration file not found
Question 5mediummultiple choice
Full question →

Based on the exhibit, why does the mv command fail?

Network Topology
-rw-rrRefer to the exhibit.$ getenforceEnforcing$ ls -Z /etc/shadow$ ls -Z /tmp/testfile$ sudo mv /tmp/testfile /etc/shadow
Question 6mediummultiple choice
Full question →

Refer to the exhibit. The system administrator runs the command 'auditctl -l' and sees the above rules. What is the purpose of these audit rules?

Exhibit

Refer to the exhibit.

# auditctl -l
-w /etc/passwd -p wa -k passwd_changes
-w /etc/shadow -p wa -k shadow_changes
-w /etc/group -p wa -k group_changes
Question 7mediummultiple choice
Full question →

An administrator runs the commands shown in the exhibit. The container is accessible via curl using the container IP. However, the administrator cannot access the web server using the host's IP address on port 80. What is the most likely cause?

Network Topology
$ docker inspect web1format='{{.NetworkSettings.IPAddress}}'Refer to the exhibit.$ docker ps172.17.0.2<!DOCTYPE html>listen 80 default_serverlisten [::]:80 default_server
Question 8hardmultiple choice
Full question →

An administrator runs 'mount -a' and receives the error shown in the exhibit. The /home partition was recently removed and replaced with a new disk. Which of the following steps should the administrator take to resolve the issue?

Exhibit

Refer to the exhibit.

# cat /etc/fstab
UUID=abc123 / ext4 defaults 0 1
UUID=def456 /boot ext4 defaults 0 2
UUID=ghi789 /home ext4 defaults 0 2
UUID=jkl012 swap swap defaults 0 0

# mount -a
mount: /home: special device UUID=ghi789 does not exist.
Question 9mediummultiple choice
Full question →

A user runs the ping command and receives the output shown in the exhibit. Which of the following is the MOST likely cause of the issue?

Exhibit

Refer to the exhibit.

$ ping -c 2 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Time to live exceeded
From 192.168.1.1 icmp_seq=2 Time to live exceeded

--- 8.8.8.8 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss
Question 10easymultiple choice
Full question →

Based on the exhibit, how often does the healthcheck.sh script run?

Exhibit

Refer to the exhibit.

```
$ crontab -l
*/5 * * * * /usr/local/bin/healthcheck.sh
```
Question 11hardmultiple choice
Full question →

After building and running the container as shown in the exhibit, the administrator tries to access http://localhost:8080 but receives a connection refused error. What is the most likely cause?

Exhibit

Refer to the exhibit.

```
$ cat Dockerfile
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y nginx
COPY index.html /var/www/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
$ docker build -t webapp .
$ docker run -d -p 8080:80 webapp
```
Question 12hardmulti select
Full question →

An administrator runs auditctl -l and ausearch -k auth_log -ts today as shown in the exhibit. The administrator expects to see audit events for /var/log/auth.log but gets no matches. Which TWO actions should the administrator take to resolve this issue?

Exhibit

Refer to the exhibit.

# auditctl -l
LIST_RULES: syscall=openat,open,creat,truncate,ftruncate key=file_monitor
-a always,exclude -F msgtype=CRED_DISP
-w /etc/passwd -p wa -k passwd_changes
-w /etc/shadow -p wa -k shadow_changes
-w /etc/group -p wa -k group_changes
-w /var/log/auth.log -p wa -k auth_log

# ausearch -k auth_log -ts today
<no matches>
Question 13mediummultiple choice
Full question →

Based on the exhibit, what is the most likely cause of the repeated connection refused errors?

Exhibit

Refer to the exhibit.

```
$ cat /var/log/containers/web.log | grep "ERROR" | head -5
[2024-03-21 10:15:23] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:24] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:25] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:26] ERROR: Connection refused to database at 10.0.0.1:3306
[2024-03-21 10:15:27] ERROR: Connection refused to database at 10.0.0.1:3306
```
Question 14easymultiple choice
Full question →

Based on the exhibit, what is the most likely cause of the sshd service failure?

Exhibit

Refer to the exhibit.

$ systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2023-06-12 09:15:22 UTC; 5min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 1234 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255)
 Main PID: 1234 (code=exited, status=255)
   Status: "Failed to start sshd"

Jun 12 09:15:22 server sshd[1234]: fatal: Missing privilege separation directory: /var/empty/sshd
Question 15hardmultiple choice
Full question →

Refer to the exhibit. Alice is the owner of file.txt. Bob is a member of the staff group. What permissions does Bob have on file.txt?

Exhibit

Refer to the exhibit.

$ getfacl file.txt
# file: file.txt
# owner: alice
# group: staff
user::rw-
user:bob:r--
group::r--
mask::rw-
other::---

These XK0-005 practice questions are part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style XK0-005 questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.