XK0-006 security explained: Linux+ domain 3

Updated November 25, 2026

Security is 18% of XK0-006. It has six objectives (3.1 to 3.6): authorization, authentication and accounting; firewalls; operating system hardening; account hardening; cryptography; and compliance and audit. Questions usually describe a requirement, such as blocking a service or restricting root login, and ask which setting or command applies. The structure follows the CompTIA exam objectives.

3.1 Authorization, authentication and accounting

Polkit and PAM (pluggable authentication modules) control how users prove identity and what they may do. SSSD and Winbind connect to directory services, LDAP and Kerberos for central login, and Samba for Windows-style realms. Accounting means logging: journalctl, rsyslog, logrotate and /var/log. The audit system uses auditd and audit.rules.

3.2 Firewalls

Know firewalld: zones, services versus ports, rich rules, firewall-cmd, and the difference between runtime and permanent configuration (a runtime change is lost on reload unless made permanent). ufw is the simpler front end on Debian-style systems, and nftables, iptables and ipset work at the netfilter level. NAT concepts include SNAT, DNAT and PAT, and IP forwarding is enabled with net.ipv4.ip_forward. Be able to describe stateful versus stateless filtering.

3.3 OS hardening

This objective is wide:

  • Privilege escalation. sudo and /etc/sudoers (edit with visudo), /etc/sudoers.d, NOEXEC and NOPASSWD implications, the wheel and sudo groups, su - and sudo -i.
  • Permissions. chmod in octal and symbolic form, chown and chgrp, setuid, setgid, the sticky bit, umask, ACLs (setfacl and getfacl) and file attributes (chattr and lsattr, immutable and append-only).
  • SELinux. States are enforcing, permissive and disabled. Tools: getenforce, setenforce, getsebool, setsebool, semanage, restorecon, chcon, ls -Z, audit2allow and sealert.
  • Secure remote access. SSH with key versus password login, PermitRootLogin, AllowUsers and AllowGroups, disabling X forwarding, SSH agent, tunneling and SFTP.
  • Other. fail2ban, chroot, avoiding insecure services (Telnet, FTP, TFTP), disabling unused filesystems, removing unnecessary SUID permissions and UEFI secure boot.

3.4 Account hardening

Password complexity, length, expiry, reuse and history; multifactor authentication; checking against breach lists; restricted shells (/sbin/nologin and rbash); avoiding running as root; and pam_tally2 for lockout.

3.5 Cryptography

Data at rest: GPG for files, LUKS2 for filesystems (with Argon2 key derivation). Data in transit: OpenSSL, LibreSSL, TLS versions and WireGuard. Hashing with SHA-256 and HMAC, removing weak algorithms, managing trusted root certificates (no-cost versus commercial) and avoiding self-signed certificates.

3.6 Compliance and audit

Anti-malware, indicators of compromise, rkhunter, vulnerability scanning with CVE and CVSS, backporting patches, port scanners and protocol analysers; OpenSCAP and CIS Benchmarks; file integrity with AIDE and signed package verification; secure data destruction (shred, badblocks -w, dd from /dev/urandom or cryptographic destruction); security banners (/etc/issue, /etc/issue.net, /etc/motd); and the software supply chain.

Sample questions

Question 1. A firewalld rule opening port 8443 was added and works, but disappears after the firewall is reloaded. What was missing?

  • A. A change to the default zone
  • B. A rich rule instead of a port
  • C. Installing ufw alongside firewalld
  • D. The permanent option, or a runtime-to-permanent save
Show answer

Answer: D

Without the permanent option, firewall-cmd changes apply only to the runtime configuration and are lost on reload. The zone default, rich-rule syntax and ufw have nothing to do with persistence in this case.

Want more questions like this? Full XK0-006 practice tests →

Question 2. Which setting in the SSH daemon configuration prevents the root account from logging in directly over SSH?

  • A. PermitRootLogin no
  • B. AllowUsers root
  • C. X11Forwarding yes
  • D. PasswordAuthentication yes
Show answer

Answer: A

PermitRootLogin no stops direct root logins; administrators then use a normal account and sudo. AllowUsers restricts who can log in but does not by itself block root unless root is excluded, X11Forwarding concerns graphical forwarding, and PasswordAuthentication controls password logins in general.

Want more questions like this? Full XK0-006 practice tests →

Question 3. A directory must let all members of a group create files that automatically inherit the directory's group. Which special permission is used?

  • A. Sticky bit
  • B. setgid
  • C. setuid
  • D. Immutable attribute
Show answer

Answer: B

The setgid bit on a directory makes new files inherit the directory’s group. The sticky bit restricts deletion to the file owner, setuid applies to executables and runs them as the owner, and the immutable attribute prevents any change.

Want more questions like this? Full XK0-006 practice tests →

Next steps

Continue with automation, orchestration and scripting, or revisit services and user management.