Description
Harden an Ubuntu server with least-privilege access, SSH controls, firewall rules, patching, and audit logging.
Objective
Prepare a secure and maintainable Linux host for production workloads.
Solution
Secure access
- 1Create named administrator accounts and disable direct root login.
- 2Require SSH keys, limit exposed ports, and configure fail2ban.
Apply host controls
- 1Configure UFW rules, unattended security updates, and audit logging.
- 2Remove unused packages and verify service permissions.
- 3
bash
sudo ufw allow OpenSSH sudo ufw enable sudo systemctl enable --now unattended-upgrades
Verify the baseline
- 1Scan listening ports and review authentication logs.
- 2Document the baseline and schedule recurring patch and access reviews.
Tool Stack Used
- π§Ubuntu
- π§SSH
- π§UFW
- π§Auditd