Launch pricingNo GST added. What you see is what you pay.

Secure your server · 5 min

Stop brute-force logins with Fail2ban

Automatically ban IP addresses that keep failing to log in.

Fail2ban watches your logs and blocks IP addresses that fail to log in again and again. It's a good extra layer, even with SSH keys.

Install it

bash
sudo apt install -y fail2ban

Turn on the SSH protection

Create a local config (it survives updates):

bash
sudo tee /etc/fail2ban/jail.local > /dev/null <<'EOF'
[sshd]
enabled = true
maxretry = 5
findtime = 10m
bantime = 1h
EOF
sudo systemctl enable --now fail2ban
sudo systemctl restart fail2ban

This bans an IP for one hour after 5 failed logins within 10 minutes.

Check it's working

bash
sudo fail2ban-client status sshd

Unban yourself

If you lock yourself out, sign in through the web console and run (with your IP):

bash
sudo fail2ban-client set sshd unbanip 198.51.100.7

Stuck? Contact us or open a support ticket from your panel.