Courseiva
← Back to CompTIA Linux+ (XK0-006) questions

Scenario-based practice

Refer to the Exhibit Practice Questions

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

15
scenario questions
XK0-006
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-006 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 →

Refer to the exhibit. A user reports that the /var directory is not accessible. The system administrator checks the logical volumes and notices that the 'var' logical volume is not activated. Which command should be used to activate it?

Network Topology
root vg0 -wi-ao20.00gswap vg0 -wi-ao2.00gvar vg0 -wi-a10.00ghome vg0 -wi-ao50.00g
Question 2mediummultiple 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 3hardmultiple choice
Full question →

Refer to the exhibit. An API call returns HTTP 200 but an empty body. What is the most likely cause?

Exhibit

$ curl -v https://api.example.com/v1/users
*   Trying 203.0.113.5:443...
* Connected to api.example.com (203.0.113.5) port 443 (#0)
* ALPN, offering h2
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=api.example.com
*  start date: Jan 1 00:00:00 2023 GMT
*  expire date: Dec 31 23:59:59 2023 GMT
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
> GET /v1/users HTTP/2
> Host: api.example.com
> User-Agent: curl/7.68.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4)
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (3)
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/2 200
< date: Tue, 10 Oct 2023 12:00:00 GMT
< content-type: application/json
< content-length: 0
< server: nginx/1.18.0 (Ubuntu)
<
* Connection #0 to host api.example.com left intact
Question 4easymultiple choice
Full question →

An administrator needs to add a script to be executed daily. The script is placed at /etc/cron.daily/myscript. After placing the script, it does not run. Based on the exhibit, what is the most likely issue?

Exhibit

Refer to the exhibit.
```
$ ls -l /etc/cron.daily/
total 8
-rwxr-xr-x 1 root root 245 Mar 10 10:00 logrotate
-rwxr-xr-x 1 root root 123 Mar 10 10:00 syscheck
```
Question 5mediummultiple choice
Full question →

Refer to the exhibit. A web application running under Apache cannot write to /var/log/app.log. The file has permissions 664 and is owned by apache. What is the correct action to allow writes while maintaining SELinux policies?

Exhibit

Refer to the exhibit.
```
type=AVC msg=audit(1234567890.123:45): avc: denied { write } for pid=1234 comm="httpd" name="app.log" dev=sda1 ino=56789 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file
```
Question 6easymultiple choice
Full question →

Refer to the exhibit. A user wants to execute the script 'script.sh' but receives a 'Permission denied' error. Which action should be taken to allow execution?

Network Topology
-rw-rrRefer to the exhibit.
Question 7mediummultiple choice
Full question →

Refer to the exhibit. A Linux administrator created a systemd service file for a custom script. When starting the service, it fails with 'Unit myservice.service entered failed state.' Which of the following is the most likely cause?

Exhibit

[Unit]
Description=My custom service
After=network.target

[Service]
ExecStart=./myscript
Restart=always

[Install]
WantedBy=multi-user.target
Question 8hardmultiple choice
Full question →

Based on the exhibit, what is the most likely cause of the 'PV Status: not available'?

Exhibit

Refer to the exhibit.
[root@server ~]# lvm pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               data_vg
  PV Size               <500.00 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              127999
  Free PE               8192
  Allocated PE          119807
  PV UUID               abc123-...
  PV Status             not available
Question 9easymultiple choice
Full question →

Based on the exhibit, what best describes the security implication?

Exhibit

Refer to the exhibit.
ls -la /usr/bin/passwd
-rwsr-xr-x 1 root root 68208 Apr  1  2024 /usr/bin/passwd
Question 10hardmultiple choice
Review the full subnetting walkthrough →

Refer to the exhibit. A user cannot access a web server, but another host on the same subnet can. What is the most likely cause?

Exhibit

User reports: "I can't access the web server at https://example.com from my office network."

From the user's workstation:
$ nslookup example.com
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: example.com
Address: 10.0.0.5

From another host on the same subnet:
$ curl -I https://example.com
HTTP/2 200

From the user's workstation:
$ curl -I https://example.com
curl: (7) Failed to connect to example.com port 443: Connection refused

$ iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
Question 11mediummultiple 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 12easymultiple 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 13mediummultiple choice
Full question →

Refer to the exhibit. A Docker container using a bind mount fails to start with a permission error. What is the most likely cause?

Exhibit

Mar 10 08:15:22 host dockerd[1234]: Time=2025-03-10T08:15:22.123Z Level=error msg="failed to mount local volume: mount :/var/lib/docker/volumes/vol1/_data:/data, flags: 0x1000: permission denied"
Mar 10 08:15:22 host dockerd[1234]: Time=2025-03-10T08:15:22.124Z Level=error msg="error while mounting volume: permission denied"
Question 14hardmultiple choice
Full question →

A security policy requires that user passwords must expire after 90 days. The output in the exhibit shows the current configuration for the root user. Which command should the administrator run to enforce the policy for root?

Exhibit

Refer to the exhibit.

$ cat /etc/shadow
root:$6$xyz...:18000:0:99999:7:::
$ sudo passwd -S root
root P 08/15/2024 0 99999 7 -1
$ sudo chage -l root
Last password change                                    : Aug 15, 2024
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7
Question 15mediummultiple 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

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