20+ practice questions focused on Security — one of the most tested topics on the CompTIA Linux+ (XK0-006) exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start Security PracticeAn administrator needs to allow incoming TCP traffic on port 8443 using firewalld. Which command should be used to make this change persistent?
Explanation: To make a firewalld port rule persistent, the `--permanent` flag must be used so the change is written to the permanent configuration, and `--reload` must be run to apply the permanent config to the running firewall. The combined command `firewall-cmd --add-port=8443/tcp --permanent && firewall-cmd --reload` accomplishes both.
A system is running SELinux in enforcing mode. A custom application needs to write to /var/log/app.log. The log file shows the correct context, but access is denied. What is the most likely cause?
Explanation: When the file context is already correct but access is still denied in enforcing mode, the most likely cause is that an SELinux boolean controlling the application's ability to write to that location is disabled. Booleans are runtime toggles that allow or deny specific policy behaviors without changing file contexts. The application's domain policy may permit writing to /var/log only when the relevant boolean (e.g., httpd_can_write_audit_log or a custom boolean) is enabled.
Which command displays the current SELinux mode?
Explanation: The `getenforce` command displays the current SELinux mode as either Enforcing, Permissive, or Disabled. It directly queries the SELinux status from the kernel and returns the current enforcement state without requiring elevated privileges. This makes it the correct command for simply viewing the current mode.
An administrator wants to audit all attempts to access the file /etc/shadow. Which auditctl command should be used?
Explanation: `auditctl -w /etc/shadow -p rwxa -k shadow` sets a watch on the file for all access types: read (r), write (w), execute (x), and attribute change (a). This captures all attempts to access the file, including reads, which matches the requirement. Option C uses `-F perm=wa`, which only logs write and attribute changes, excluding reads. Option A has invalid syntax (`-A` instead of `-a`). Option D uses `ausearch`, which is for searching audit logs, not setting rules.
Which command displays the last successful login times for all users?
Explanation: The `lastlog` command reads /var/log/lastlog and formats the most recent login time for every user account on the system, including accounts that have never logged in (shown as '**Never logged in**'). It is the purpose-built utility for reporting per-user last-login timestamps.
+15 more Security questions available
Practice all Security questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Security. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
Security questions on the XK0-006 frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. Security is tested as part of the CompTIA Linux+ (XK0-006) blueprint. Practicing with targeted Security questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free XK0-006 practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but Security is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full Security practice session with instant scoring and detailed explanations.
Start Security Practice →