Fail2ban: Protect VPS from Brute Force Attacks

Security · 20.04.2025
Fail2ban: Protect VPS from Brute Force Attacks

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
← Back to Knowledge Base Ask Support