Linux Server Hardening
Shrink the attack surface of a Debian, Ubuntu or Rocky Linux server one measure at a time, then prove it with a Lynis audit and the ANSSI recommendations.
A MasterLinux course · Original text
What you will learn
- Build a simple threat model and measure a server's attack surface
- Lock down accounts, sudo and passwords with PAM, pwquality and faillock
- Harden SSH (keys, no root, AllowGroups, modern algorithms) without locking yourself out
- Write an nftables firewall with a "deny all except" policy and translate it to firewalld
- Shut down unneeded services and ports, and confine the remaining ones with systemd
- Automate security updates on Debian, Ubuntu and Rocky Linux
- Fix permissions, SUID/SGID, umask and mount options (noexec, nosuid, nodev)
- Make SELinux and AppArmor work for you instead of disabling them
- Log with journald and auditd, check integrity with AIDE, ban with fail2ban
- Audit with Lynis, rely on ANSSI and the CIS Benchmarks, and harden a web server end to end
Course content
13 lessons · 11 h 30 minSection 1 — Fundamentals
Section 2 — Shrinking the surface
Section 3 — Control and detection
Section 4 — Audit and project
Requirements
- The “Fundamentals” course (included) or solid hands-on experience with the Linux command line
- Able to administer a Debian or Rocky server (packages, services, users)
- A practice virtual machine (Debian 12 or Rocky 9) for the labs
Who is this course for?
- Technicians and system administrators who want to secure their servers
- Students aiming for a first job in cybersecurity or operations
- Developers and freelancers who host their own applications on a VPS