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

Scenario-based practice

Hard Difficulty 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.

20
scenario questions
XK0-006
exam code
CompTIA
vendor

Scenario guide

How to approach hard difficulty questions

These are the questions most candidates get wrong. They require connecting multiple concepts, reading tricky output, or knowing edge-case behaviour that isn't on most study cards. Practising them trains you to operate under uncertainty — a necessary skill on the real exam.

Quick answer

Hard Difficulty Questions questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider 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 1hardmultiple choice
Full question →

Based on the exhibit, which file has an incorrect SELinux context for serving web content via Apache?

Network Topology
-rw-rrRefer to the exhibit.~]$ ls -lZ /var/www/html
Question 2hardmultiple choice
Full question →

A DevOps engineer wants to reduce the size of a Docker image by combining build stages. Which Dockerfile feature should be used?

Question 3hardmultiple choice
Full question →

A system administrator runs 'umask 027' in a Bash shell. What will be the default permissions for a new directory created in that shell? (Assume no other umask changes.)

Question 4hardmultiple choice
Full question →

An administrator notices that an AppArmor profile is in complain mode for a service that should be enforcing. Which command changes the profile to enforce mode?

Question 5hardmultiple choice
Full question →

A company is implementing a security policy that requires all files created in a shared directory /data to be owned by the group 'engineers' and have group read/write permissions, regardless of the user's umask. Which approach should be used?

Question 6hardmultiple choice
Full question →

During the boot process, after the kernel is loaded and the initramfs is executed, which component is responsible for starting the user-space services and managing the system state?

Question 7hardmultiple choice
Full question →

A Linux security administrator needs to generate a self-signed certificate for a web server. They want to create a private key and a certificate signing request (CSR) in one step. Which OpenSSL command should be used?

Question 8hardmultiple choice
Full question →

During boot, the system stops at a shell with limited functionality. The administrator suspects the root filesystem is corrupted. Which target should the system be booted into to perform recovery?

Question 9hardmultiple 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 10hardmultiple choice
Full question →

A sysadmin needs to set a default gateway for a network interface. Which command(s) accomplish this?

Question 11hardmulti select
Full question →

Which TWO tools are specifically designed to detect rootkits on a Linux system?

Question 12hardmultiple choice
Full question →

An administrator is troubleshooting a web server that is running under SELinux enforcing mode. The web content is located in a non-standard directory /webfiles. Using the standard SELinux context 'httpd_sys_content_t', the files are still inaccessible. Which command will properly set the context recursively and persist across relabels?

Question 13hardmulti select
Full question →

A Kubernetes administrator is creating a YAML manifest for a Deployment. Which three fields are required in a valid Deployment specification? (Choose three.)

Question 14hardmultiple choice
Full question →

Refer to the exhibit. A security analyst notices repeated failed SSH login attempts from multiple IP addresses. Which two actions would best mitigate this brute-force attack? (Choose two.)

Network Topology
since "2023-10-05 08:00:00"until "2023-10-05 09:00:00"
Question 15hardmultiple choice
Full question →

Refer to the exhibit. A system administrator notices that the SSH service has failed. What is the most likely cause?

Network Topology
$ journalctl -u sshd.serviceno-pager$ systemctl status sshd.serviceLoaded: loaded (/usr/lib/systemd/system/sshd.serviceenabledvendor preset: enabled)5min agoDocs: man:sshd(8) man:sshd_config(5)Main PID: 1234 (code=exited, status=255)
Question 16hardmultiple choice
Full question →

A Docker container using port 8080 fails to start with the error 'port is already allocated'. Which command should the administrator use to identify the process using that port?

Question 17hardmultiple choice
Full question →

A Kubernetes pod has a container that fails with CrashLoopBackOff. The administrator runs 'kubectl logs pod-name' but sees no output. What is the most likely cause?

Question 18hardmultiple choice
Full question →

A storage administrator needs to automate the expansion of an LVM volume group when free space drops below 10%. The script must add a new physical volume from a spare disk. Which of the following commands should be used in the script to add the new disk to the volume group?

Question 19hardmulti select
Full question →

A server crashed with a kernel panic. After reboot, the administrator wants to analyze the crash dump. Which THREE actions should be taken to ensure a valid core dump is captured and accessible? (Choose THREE.)

Question 20hardmulti select
Full question →

A system administrator is working with compressed files. Which THREE commands can be used to view their contents? (Select THREE).

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.