Linux Server Hardening

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

  1. 1Create named administrator accounts and disable direct root login.
  2. 2Require SSH keys, limit exposed ports, and configure fail2ban.

Apply host controls

  1. 1Configure UFW rules, unattended security updates, and audit logging.
  2. 2Remove unused packages and verify service permissions.
  3. 3
    bashsudo ufw allow OpenSSH
    sudo ufw enable
    sudo systemctl enable --now unattended-upgrades

Verify the baseline

  1. 1Scan listening ports and review authentication logs.
  2. 2Document the baseline and schedule recurring patch and access reviews.

Tool Stack Used

  • πŸ”§Ubuntu
  • πŸ”§SSH
  • πŸ”§UFW
  • πŸ”§Auditd