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 →

A Linux system fails to boot and displays a kernel panic immediately after the GRUB menu. The administrator needs to boot into a rescue environment. Which GRUB boot parameter should the administrator add to the kernel line?

Question 2hardmultiple choice
Full question →

A Linux server experiences a kernel panic after a recent driver update. The system is still operational but unstable. Which command should be used to gather detailed information about the kernel modules currently loaded?

Question 3hardmultiple 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 4hardmultiple choice
Full question →

During a security audit, a Linux administrator finds that an unauthorized service is listening on TCP port 4444. The service is not managed by systemd. Which of the following commands should the administrator use to identify the process and disable it?

Question 5hardmultiple choice
Full question →

A Linux administrator is writing a Bash script to automate the backup of a database. The script must run a pre-backup command, check its exit status, and if successful, proceed with the backup; otherwise, log an error and exit. Which code snippet correctly implements this logic?

Question 6hardmulti select
Full question →

A system fails to boot with a kernel panic. The administrator suspects a corrupt initramfs or missing kernel module. Which three methods could be used to recover the system? (Choose three.)

Question 7hardmultiple choice
Full question →

A system administrator is configuring firewalld on a Linux server. They want to allow incoming HTTPS traffic permanently for the public zone. Which 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 →

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

An administrator is troubleshooting a service that fails to start. They want to trace the system calls made by the service binary. Which command should they use?

Question 11hardmultiple choice
Full question →

In a Bash script, the administrator wants to capture the output of a command into a variable. Which syntax should be used?

Question 12hardmultiple choice
Full question →

A Linux administrator wants to check the history of CPU usage for the past two days using the system activity reporter. Which sar option retrieves data from the daily history file for a specific date?

Question 13hardmultiple choice
Full question →

During boot, the system drops into an emergency target. Which command can be used to repair the root filesystem from this environment?

Question 14hardmultiple choice
Full question →

A system administrator configures PAM to enforce account lockout after 3 failed login attempts. Which PAM module should be used?

Question 15hardmultiple choice
Full question →

Given the journalctl output for the httpd service, which of the following is the most likely cause?

Exhibit

Refer to the exhibit.
$ journalctl -u httpd
-- Logs begin at Mon 2023-10-23 09:11:22 EDT, end at Mon 2023-10-23 10:45:17 EDT. --
Oct 23 10:45:00 server httpd[1234]: (13)Permission denied: AH00035: access to /var/www/html/index.html denied (filesystem path '/var/www/html/index.html') because search permissions are missing on a component of the path
Question 16hardmultiple 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 17hardmultiple choice
Full question →

Refer to the exhibit. A web server is experiencing performance issues. Based on the process list shown, which action should the administrator take first?

Exhibit

ps aux | grep apache
root      1234  0.0  0.1  12345  6789 ?        Ss   10:00   0:00 /usr/sbin/httpd -k start
apache    1235  0.2  2.3  45678 23456 ?        S    10:00   0:05 /usr/sbin/httpd -k start
apache    1236  0.3  2.4  45678 24000 ?        S    10:00   0:06 /usr/sbin/httpd -k start
apache    1237  0.0  0.1     0     0 ?        Z    10:05   0:00 [httpd] <defunct>

# cat /proc/sys/kernel/pid_max
32768
Question 18hardmulti select
Full question →

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

Question 19hardmulti select
Full question →

Which TWO commands can be used to immediately synchronize the system time with an NTP server, even if the time difference is large? (Choose two.)

Question 20hardmultiple 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

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.