Every public VPS faces thousands of SSH brute force attempts daily. Fail2ban monitors logs and auto-bans attacking IPs.
Installation
sudo apt install -y fail2ban
sudo systemctl enable --now fail2ban
Configure jail.local
[DEFAULT]
bantime = 3600
maxretry = 5
[sshd]
enabled = true
maxretry = 3
bantime = 86400
sudo fail2ban-client status sshd