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

Use short Fail2ban bans on Ubuntu for testing—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 = 3\nbantime = 300
Restart with
systemctl restart fail2ban
open SSH with
ufw allow 22
Trigger bans with 3 failed
ssh user@ip
attempts—check with
fail2ban-client status sshd
expecting a 5-minute (300s) ban On Hetzner this minimizes lockouts during setup—unban manually with
fail2ban-client unban ip
ensuring MySQL and FTP uptime

Back to All Tips