This project demonstrates the deployment and hardening of a cloud-based Ubuntu server to mimic a professional production environment.
- Cloud: AWS (EC2)
- OS: Ubuntu 24.04 LTS
- Security: UFW, Fail2Ban, OpenSSH
- **created a non-root user with sudo privileges * **
- Disabled Root Login: Prevented direct root access to mitigate high-impact attacks.
- Key-Based Authentication: Enforced Ed25519 SSH keys and disabled password logins.
-
Before running the hardening script, key-based authentication must be established between the local machine and the server:
ssh-keygen -t ed25519 -C "your_email@example.com"mkdir -p ~/.ssh chmod 700 ~/.ssh touch ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
- UFW Firewall: Configured a "Default Deny" policy, allowing only Port 22.
- Fail2Ban: Automated IP banning for brute-force detection.
- Unattended-Upgrades: Enabled automatic daily security patches.
To ensure the hardening measures are active, I implemented real-time monitoring:
The following shows the Fail2Ban service active and monitoring SSH login attempts:
The firewall is configured to a "Default Deny" state, only allowing traffic on Port 22:

