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

Customize Fail2ban ban actions 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\naction = iptables[name=SSH, port=ssh, protocol=tcp]\nbantime = 3600
Restart with
systemctl restart fail2ban
open SSH with
ufw allow 22
Test with failed logins—check
iptables -L -n
for \"DROP\" rules and
fail2ban-client status sshd
for bans On Hetzner this uses iptables directly—ensure MySQL and phpMyAdmin uptime with precise SSH protection for 1 hour (3600s)

Back to All Tips