Basic Server Hardening: Secure Your Linux Server in 10 Minutes

Security is not optional โ€” itโ€™s your first layer of defense.

๐Ÿ”น Update System

sudo apt update && sudo apt upgrade -y

๐Ÿ”น Install Fail2Ban

sudo apt install fail2ban -y

๐Ÿ”น Enable Firewall

sudo ufw allow OpenSSH
sudo ufw enable

๐Ÿ”น Disable Root Login

/etc/ssh/sshd_config

Edit:

/etc/ssh/sshd_config

Set:

PermitRootLogin no

๐Ÿ”น Restart SSH

sudo systemctl restart ssh

Always use SSH keys instead of passwords.

Leave a comment

Your email address will not be published. Required fields are marked *