Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Tune Fail2ban’s maxretry on Ubuntu—install with
apt install fail2ban
then edit /etc/fail2ban/jail local with
nano /etc/fail2ban/jail.local
:
[sshd]\nenabled = true\nport = 22\nfilter = sshd\nlogpath = /var/log/auth.log\nmaxretry = 10\nbantime = 3600\nfindtime = 600
Restart with
systemctl restart fail2ban
open SSH with
ufw allow 22
This allows 10 fails in 10 minutes (600s) before a 1-hour ban—test with
ssh user@ip
check
fail2ban-client status sshd
On Linode this reduces false positives for MySQL or FTP—lower to 5 if too lenient ensuring uptime with balanced security

Back to All Tips