Fail2ban jail.local generator
Ban addresses that keep guessing passwords or scanning your site. Pick the jails, set how many failures earn a ban and for how long, and get a jail.local that works on current Ubuntu and Debian.
Why jail.local
jail.conf is replaced on package updates. Everything in jail.local overrides it and stays. List only what you change; the rest comes from the defaults.
Journal or log files
Newer Debian and Ubuntu no longer write /var/log/auth.log by default, so the SSH jail has to read the systemd journal (backend = systemd, which needs python3-systemd). nginx still writes plain log files, so its jails read those.
Useful commands
- sudo fail2ban-client status sshd shows the banned addresses.
- sudo fail2ban-client set sshd unbanip 203.0.113.7 lifts a ban.
- sudo fail2ban-client -t checks the files before a restart.
More tools
- VPS ping test
- VPS cost calculator
- chmod calculator
- Cron generator
- Subnet calculator
- SSH key generator
- Bandwidth calculator
- What is my IP
- Cloud-init generator
- SSH hardening generator
- UFW firewall generator
- WireGuard config generator
- Nginx reverse proxy generator
- Docker Compose generator
- Systemd service generator
- Swap size calculator
- DNS lookup