CompTIA · XK0-006
CompTIA Linux+ validates the skills of IT professionals to configure, manage, and troubleshoot Linux systems used in cloud, cybersecurity, and enterprise environments. It covers system administration, scripting, automation, security hardening, and container management.
Practice Questions
699
≈ 7 practice exams
Duration
90 minutes
Passing Score
720/900
Difficulty
AssociateLast Updated
Mar 2026
Use this XK0-006 practice exam to prepare for CompTIA Linux+ (XK0-006) with realistic questions, detailed explanations, and focused study modes. The practice bank includes 699 questions for CompTIA XK0-006, so you can review the exam steadily instead of relying on one long cram session.
As you practice, pay extra attention to recurring topics such as System Configuration and Management, Storage and Device Management, Network Configuration, Shell Scripting and Automation, and Security and OS Hardening. Start with short sessions to identify weak areas, then move into timed quizzes once your accuracy is consistent.
The explanations are especially useful when you want to connect exam wording to the responsibilities and scenarios described in the official certification guidance. Use the free preview first, then unlock the full question bank when you are ready to build a complete study routine.
CompTIA Linux+ (XK0-006) validates the advanced skills of IT professionals to configure, manage, operate, and troubleshoot Linux systems in enterprise, cloud, and cybersecurity environments. This Associate-level certification demonstrates competency across system administration, storage and network configuration, security hardening, shell scripting, containerization, and troubleshooting. The exam emphasizes practical, hands-on knowledge required for modern Linux environments including hybrid cloud deployments, containerized applications, and enterprise security implementations. Successfully obtaining this certification indicates proficiency in automating tasks, implementing security best practices, and managing complex Linux infrastructure at scale.
CompTIA Linux+ is designed for IT professionals with foundational Linux experience seeking to advance into system administration, cloud infrastructure, or DevOps roles. Ideal candidates include junior Linux system administrators, junior cloud engineers, junior DevOps engineers, systems engineers, and network engineers managing Linux-based infrastructure. This certification appeals to those with 12 months of hands-on Linux server experience or equivalent knowledge from CompTIA A+, Network+, or Server+ certification. Career paths include Linux systems administrator, cloud infrastructure engineer, cybersecurity operations roles, and site reliability engineer positions.
Recommended prerequisites include 12 months of hands-on experience managing Linux servers in production or lab environments. While not mandatory, CompTIA strongly recommends foundational IT knowledge equivalent to CompTIA A+, Network+, or Server+ certifications. Candidates should be comfortable with command-line interfaces, basic system administration tasks, file permissions, networking concepts, and troubleshooting methodologies. Linux experience can be gained through home labs, free Linux distributions (Ubuntu, CentOS, Red Hat), or entry-level support roles. A solid understanding of basic networking, storage concepts, and security principles is beneficial.
The CompTIA Linux+ (XK0-006) exam consists of a maximum of 90 scored questions combining multiple-choice and performance-based (hands-on) questions. The exam is delivered online or at testing centers and must be completed within 90 minutes. The scoring scale ranges from 100 to 900, with a passing score of 720 required. Performance-based questions require candidates to demonstrate practical Linux skills in simulated environments. The exam launched July 15, 2025, and is ISO/IEC accredited by ANSI.
CompTIA Linux+ opens doors to well-compensated roles in high-demand areas of IT. Professionals with this certification earn between $68,000 and $120,000+ annually, with average salaries around $89,000–$91,000 in the United States; experienced professionals in senior roles can exceed six figures. The certification is particularly valuable given the industry shift toward cloud computing and containerization, where Linux expertise is essential. Linux+ validates competency across critical infrastructure technologies, making certified professionals significantly more marketable than non-certified peers. Career advancement opportunities include progression to senior systems administrator, infrastructure architect, cloud engineer, or DevOps engineer roles, with steady salary growth potential as experience accumulates.
5 sample questions with answers and explanations. The full bank has 699 questions, enough for 7 full-length practice exams.
Preview — answers shown1. A systems administrator at Contoso Ltd. is hardening an SSH server according to CIS Benchmark recommendations. The security policy requires that root must never be able to authenticate to the server via SSH using any method — including SSH key authentication — while still permitting root to log in at the local console. Which sshd_config directive and value should the administrator set? (Select one!)
Explanation
PermitRootLogin no completely blocks all SSH-based root login attempts, including both password authentication and public key authentication. This directive has no effect on local console logins, which are governed by PAM and the /etc/securetty file, so the requirement to allow local root access is fully preserved. PermitRootLogin prohibit-password blocks password-based root logins but still permits root to authenticate via SSH public key, which does not satisfy the requirement to block all SSH root access. PermitRootLogin forced-commands-only allows root to authenticate via SSH public key when a forced command is specified in the authorized_keys file — again allowing key-based SSH access. DenyUsers root is a valid alternative mechanism that prevents the root account from authenticating via SSH; however, PermitRootLogin no is the canonical, purpose-built directive for this specific goal and is the standard hardening setting documented by CIS and most Linux security guides.
2. A systems administrator at Northwind Traders is examining a server that has recently been rebooted. The administrator needs to view log messages from the previous boot session to investigate why the system rebooted unexpectedly. Which command should the administrator use? (Select one!)
Explanation
journalctl -b -1 displays log entries from the previous boot session. The -b flag specifies a boot ID offset, where -1 refers to the last boot before the current one, -2 refers to two boots ago, and so on. This is the correct way to investigate issues that occurred in a prior boot session. journalctl --since yesterday would show logs from the past 24 hours but includes the current boot and may miss events if the reboot happened more than a day ago. journalctl -b 0 or simply journalctl -b shows logs from the current boot session, not the previous one. dmesg -T only shows kernel ring buffer messages from the current boot and cannot access previous boot logs. Note that viewing previous boot logs requires persistent journal storage to be configured with Storage=persistent in /etc/systemd/journald.conf.
3. A systems administrator at Contoso needs to configure a Linux server to permanently route traffic between two network segments. The server must continue forwarding packets after every reboot without any manual intervention. Which approach correctly achieves persistent IP forwarding? (Select one!)
Explanation
Adding net.ipv4.ip_forward=1 to /etc/sysctl.conf and then running sysctl -p is the correct and standard method for making kernel parameter changes persist across reboots. The sysctl -p command reads the configuration file and applies all settings immediately without requiring a reboot. Changes made with sysctl -w are runtime-only and are lost when the system restarts, even if placed in rc.local, because rc.local execution is not guaranteed on all systemd-based distributions. Writing directly to /proc/sys/net/ipv4/ip_forward is also a runtime-only change; the /proc filesystem is a virtual interface to the running kernel and its values reset on reboot. The ip command does not manage kernel sysctl parameters, and NetworkManager does not control kernel forwarding settings.
4. A systems administrator at Adatum Corporation needs to create a new ext4 filesystem on /dev/sdb1 and ensure it is automatically mounted at /data at boot with the following requirements: read-write access, UUID-based identification to survive disk reordering, filesystem check skipped for this data volume, and the system should still boot if the disk is unavailable. Which /etc/fstab entry meets all requirements? (Select one!)
Explanation
UUID=abc123 /data ext4 defaults,nofail 0 0 satisfies all stated requirements. Using the UUID instead of the device path ensures the correct partition is mounted even if disk ordering changes when additional disks are added. The nofail mount option instructs the system to continue booting even if this filesystem cannot be mounted, preventing a boot failure if the disk is unavailable. The fifth field (dump) set to 0 disables dump backups. The sixth field (fsck order) set to 0 explicitly skips filesystem checks for this volume at boot. Using /dev/sdb1 instead of UUID violates the UUID requirement and is unreliable. The entry with fsck order 2 would run filesystem checks on this volume, contradicting the skip requirement. The entry without nofail would cause boot failures if the disk is removed or unavailable.
5. A systems administrator at Northwind Traders is troubleshooting a server where a user reports that after their SSH session disconnects, a long-running data processing script stops running. The script is started without any job control. Which two methods would allow the script to continue running after the SSH session terminates? (Select two!)
Multiple correct answersExplanation
When an SSH session terminates, the kernel sends SIGHUP to the session leader, which propagates to all child processes, causing them to terminate. Two methods prevent this. nohup (no hangup) runs a command immune to SIGHUP signals; the & background operator detaches it from the terminal's foreground. Using nohup ./script.sh & causes the script to ignore SIGHUP and continue running even after the terminal closes, with output redirected to nohup.out. Screen and tmux are terminal multiplexers that create persistent sessions on the server; the SSH user connects to the multiplexer session rather than directly to the shell, so disconnecting SSH does not affect processes inside the multiplexer. nice -n 19 only adjusts CPU scheduling priority and has no effect on process lifetime or SIGHUP handling. set -e is a bash error-handling option unrelated to session termination. Running with sudo changes privilege level but does not prevent SIGHUP.
$17.99
One-time access to this exam