Audit your server's security in seconds, then fix it in one command. A conservative SSH + UFW + Fail2ban baseline for Debian/Ubuntu — with a scorecard so you can see exactly where you stand before and after.
Most "hardening guides" are 40 manual steps you do once and never re-check. This kit gives you a read-only audit that scores your box, and an apply mode that fixes the gaps — backing up every config first and refusing to lock you out of SSH.
sudo ./harden.sh audit # read-only — scores the box, changes nothing sudo ./harden.sh apply # interactive — applies the baseline (with backups)
== Security scorecard ==
[+] SSH: root password login disabled
[-] SSH: password authentication disabled
[+] Firewall: UFW installed
[-] Firewall: UFW active
[-] Fail2ban installed
...
Score: 4/8 (50%)
[!] Decent, but gaps remain — run: sudo ./harden.sh apply
| Area | Baseline |
|---|---|
| SSH | PermitRootLogin prohibit-password, MaxAuthTries 4, optional PasswordAuthentication no (only after you confirm keys work) |
| Firewall | Installs UFW, allows your current SSH port first, then default-deny incoming + enable |
| Fail2ban | Installs + enables an sshd jail (1h ban, 5 retries / 10 min) |
Every edited file is copied to /var/backups/hardening-kit/ before changes.
git clone https://github.com/Lalatenduswain/linux-server-hardening-kit.git
cd linux-server-hardening-kit
chmod +x harden.sh
sudo ./harden.sh audit- 🏠 Proxmox Homelab Toolkit — day-1/day-2 Proxmox chores
- ☁️ RClone Cloud-Backup Suite — verified cloud backups
- 🛡️ Linux Server Hardening Kit — you are here
If this kit hardened your servers, a GitHub Sponsorship keeps it current with new checks — and ⭐ starring helps other admins find it.
New audit checks and distro support (RHEL/Alma/Rocky) are very welcome — open an issue or PR.
MIT © Lalatendu Swain