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

Create a custom Fail2ban filter on Ubuntu for unique apps—install with
apt install fail2ban
then make a filter at /etc/fail2ban/filter d/custom conf with
nano /etc/fail2ban/filter.d/custom.conf
:
[Definition]\nfailregex = ^.*authentication failure.*client: .*$\nignoreregex =
Add a jail in /etc/fail2ban/jail d/custom conf:
[custom]\nenabled = true\nport = 12345\nlogpath = /var/log/custom.log\nmaxretry = 3\nbantime = 86400
Restart with
systemctl restart fail2ban
open port with
ufw allow 12345
On Linode test with fake logs—check bans with
fail2ban-client status custom
This secures niche services maintaining uptime with 24-hour bans

Back to All Tips