A Practical Linux Hardening Checklist
You've now covered users and permissions, package management, SSH, cron, logging, and firewalls. This lesson pulls all of it together into a single, practical checklist — the Linux-side counterpart to Path 07's "Securing a Windows Machine" lesson.
:::
The checklist
- Keep packages updated —
apt update && apt upgrade(or your distro's equivalent) on a regular schedule, from the package-management lesson - Remove unused packages — reduce attack surface by removing software you don't actually need, also from the package-management lesson
- Enforce least privilege on user accounts — no unnecessary
sudoaccess, no shared accounts, from the users-permissions lesson - Harden SSH — disable password authentication in favor of key-based auth, disable direct root login, from the SSH lesson
- Enable a default-deny firewall —
ufw default deny incoming, explicitly allowing only what's genuinely needed, from the firewall-basics lesson (and remembering not to lock yourself out of a remote session) - Review scheduled jobs — audit
crontab -land system-wide cron locations for anything unfamiliar, from the cron-and-scheduling lesson - Confirm logging is actually working — check
/var/logandjournalctlare capturing what you expect, and consider centralized/remote log forwarding, from the logging-basics lesson - Audit running services —
systemctl list-units --type=serviceto review what's actually running and whether it's genuinely needed, from the process-management lesson - Check for world-writable files in sensitive locations —
find / -perm -o+w -type f 2>/dev/nullsurfaces files any user can modify, connecting back to the filesystem-hierarchy lesson's/tmpwarning - Review shell scripts for injection risk — unquoted variables, unsafe
evalusage, from the shell-scripting-pitfalls lesson
Automating the checklist: don't rely on memory alone
Directly echoing Path 00's "building good digital habits" lesson: a checklist that lives only in your memory gets skipped under time pressure. Tools like Lynis (an open-source Linux security auditing tool) automate much of this checklist, scanning a system and producing a report flagging exactly these kinds of gaps — genuinely worth running periodically rather than relying entirely on manual review.
lynis audit system
Why order matters here
Notice the checklist's sequence isn't arbitrary: updates and account hygiene come first (foundational, low-risk to change), SSH and firewall hardening come next (higher-impact, needs care not to lock yourself out), and auditing/review steps come last (checking your own work). Working through hardening in a sensible order — rather than randomly — reduces the chance of a mistake locking you out or breaking something mid-process.
:::challenge Test yourself Why does this lesson recommend confirming SSH key-based authentication actually works before disabling password authentication entirely, rather than doing both steps simultaneously?
Show answer
If key-based authentication isn't actually configured correctly — a public key not properly installed, incorrect file permissions on the.ssh directory — and password authentication gets disabled at the same time, you can end up completely locked out of the machine with no working authentication method left at all, especially painful on a remote server with no console access. The safe sequence is: set up and thoroughly test key-based login first, confirm it genuinely works from a fresh connection, and only then disable password authentication as a separate, deliberate follow-up step — directly applying the same "verify before you cut off your own access" caution the firewall-basics lesson gave for enabling default-deny remotely.🧪 Hands-on lab — run the checklist on your own VM
Using the Kali or Ubuntu VM from earlier in this path, work through this lesson's ten-item checklist one item at a time, noting what you find at each step. If Lynis is available in your distro's repositories, install it and compare its automated findings against your own manual review.
Key terms
- Lynis — an open-source Linux security auditing tool that automates much of a hardening review.
Recap
This checklist consolidates everything covered across this path's earlier lessons — updates, least privilege, SSH hardening, firewalls, cron auditing, logging, service review, filesystem permissions, and shell-script safety — into one practical, sensibly-ordered sequence. Automated tools like Lynis complement, but don't replace, actually understanding why each item matters, which is exactly what the rest of this path has been building toward.
References
- Lynis — Linux Security Auditing Tool — the open-source tool referenced in this lesson
Next up → Linux Careers & Certifications