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

Set up Fail2ban with email notifications on Ubuntu—install with
apt install fail2ban sendmail
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 = 3600\naction = %(action_mwl)s\ndestemail = admin@example.com\nsender = fail2ban@yourvps.com
Restart with
systemctl restart fail2ban
open SSH with
ufw allow 22
Test by triggering bans—check email for alerts like \"Ban 203 0 113 1\" On Linode this notifies you of SSH or FTP threats maintaining uptime with proactive monitoring

Back to All Tips