I love Fail2Ban, it’s a great way to secure your VPSs in the cloud. I deploy it on all of my servers and then enable certain “jails” based on the configuration necessary for the particular machine. Installing and configuring
fail2ban is pretty straightforward for Ubuntu, but since I needed to look up the directions again, I figured I’d replicated them here.
First we’ll setup a jail for SSH:
Now restart fail2ban.
I use the Caddy webserver a lot, unfortunately there’s not a lot out there about doing bad actor analysis for Caddy. In the future I plan to modify some of the Apache2 Fail2Ban configurations to do similar work for Caddy. Stay tuned!