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

Adjust Fail2ban ban duration 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 = 5\nbantime = 604800\nfindtime = 600
Restart with
systemctl restart fail2ban
—this bans IPs for 7 days (604800s) after 5 failed attempts in 10 minutes (600s) Open SSH with
ufw allow 22
On Hetzner verify with
fail2ban-client status sshd
—expect banned IPs listed This long ban protects phpMyAdmin and FTP ensuring uptime against persistent attackers

Back to All Tips