Harden a Linux server: SSH keys, firewall, fail2ban, updates

12 steps · about 4 h 35 min · Beginner

  1. Initial Server Setup with Ubuntu (article, DigitalOcean Community, 25 min)

    It covers the first-login routine of making a non-root sudo user and a basic firewall, so every later hardening step has a foundation.

  2. Initial Server Setup on Ubuntu 26.04 (article, Linuxize, 20 min)

    This second walkthrough, written for a current Ubuntu release, adds SSH key login, disabling direct root login, and updates, which reinforces the basics.

  3. Security and Hardening · Textbook of Linux (article, Textbook of Linux, 25 min)

    It explains least privilege and the reasons behind each control before you apply the commands.

  4. How to Secure a New Linux VPS in 10 Minutes (article, SurfVPS, 15 min)

    It gives a short overview of all five pillars (keys, no root or password login, UFW, fail2ban, unattended-upgrades) so you can see how they fit together.

  5. How to Set Up a Firewall with UFW on Ubuntu (article, DigitalOcean Community, 20 min)

    It teaches default-deny rules and the allow-SSH-before-enable ordering that stops you locking yourself out.

  6. Ubuntu UFW Firewall Guide: Safe Rules Without SSH Lockout (article, Harnessing the Power of Open Source with Ubuntu, 15 min)

    It adds safe-change habits, such as keeping your session open until a second connection works.

  7. SSH Hardening Checklist: How to Secure a Linux VPS (article, StealthRDP, 30 min)

    It goes deeper on ed25519 keys, sshd settings, rate-limiting with UFW, and finding out what else is listening.

  8. Linux Server Hardening Checklist (article, Serverside, 25 min)

    It explains when fail2ban is worth adding once passwords are off, with advice on ignoreip and on whether changing the SSH port helps.

  9. Ubuntu VPS Automated Security Updates and Unattended Upgrades (article, MassiveGrid, 20 min)

    It shows why patching quickly matters and how to set up unattended-upgrades with a reboot plan.

  10. Understanding sudo in Linux: How to Gain Administrator Privileges Safely (article, Techietory, 20 min)

    It ties sudo to least privilege so you can see why you use sudo and avoid logging in as root.

  11. Understanding the Linux sudo Command: A Comprehensive Guide (article, howtouselinux, 20 min)

    It shows how to write narrow sudoers rules, such as allowing only a single systemctl restart, instead of blanket root access.

  12. Server Hardening Tutorial (2026): Secure a New Ubuntu VPS (article, HostMyCode, 40 min)

    You finish by running one full hardening pass on a fresh server and then working through its validation checklist.