fail2ban Configuration

Updated 14 Nov 2026 Published

fail2ban Configuration

Fail2Ban watches service log files (SSH, web servers, mail, FTP…) for repeated failures — brute-force attempts, wrong passwords, probing — and temporarily bans the offending IP address at the firewall. Protection is organised into jails: each jail watches specific logs with its own ban rules.

The Fail2Ban app is free on every plan, including the Free plan. Install it from the Vinza Store (top bar); it then appears in the sidebar under Security → Fail2Ban (/apps/fail2ban/). The page has the tabs Overview, Panel Protection, Service Jails, Configuration, FTP Bans and Info.

What the installer sets up

  • Installs the fail2ban package and enables the service.
  • Creates /etc/fail2ban/jail.local (only if it does not exist yet) with the sshd jail enabled and these defaults: bantime = 3600, findtime = 600, maxretry = 5.
  • Adds /etc/fail2ban/jail.d/zz-vinza-sshd.local so the SSH jail also catches failures logged by newer OpenSSH versions.

Fail2Ban Overview tab showing the service running, the active jails and banned IP counters

Overview: jails and bans

The Overview tab shows whether Fail2Ban is running (with Start, Stop and Restart), the active jails with their filter and ban counters, and the IPs currently banned. Click View on a jail to see its banned addresses.

  • Unban IP — lift a ban, for example when a customer locked themselves out.
  • Ban IP — ban an address by hand. The input is checked to be a valid IP first, and the server's own loopback address and the address you are signed in from are refused (a manual ban skips Fail2Ban's whitelist).

Sources at risk of being blocked lists addresses that are collecting failures but have not reached maxretry yet, sorted by risk. You can ban one straight away if it looks hostile. This list is built from Fail2Ban's own log lines, so it stays empty if you raise Fail2Ban's log level above INFO (the default).

Protect the panel login

The panel already locks an account for 30 minutes after 5 failed logins and throttles repeated failures from one IP. Panel Protection adds a firewall-level ban on top of that:

  1. Open the Panel Protection tab.
  2. Click Enable under Protect Panel Login.

This installs a dedicated vinzapanel jail (/etc/fail2ban/jail.d/vinzapanel.local, filter /etc/fail2ban/filter.d/vinzapanel.conf) that watches the panel's authentication log — data/logs/panel-auth.log inside the panel directory (/opt/vinzapanel by default) — and bans on the panel port. The tab shows separately whether the jail is configured and whether Fail2Ban has actually loaded it.

Tip

Add your own IP to the whitelist (Configuration tab) so a mistyped password can't lock you out of the panel at the firewall.

Service jails

The Service Jails tab offers ready-made jails you can switch on with one click:

JailWhat it catches
nginx HTTP auth / Apache HTTP authFailed HTTP basic-auth logins, from the web server's error logs and the per-site logs
WordPress loginFailed logins on /wp-login.php (a POST answered with 200), from the access logs
Postfix SMTP / Postfix SASL authRejected SMTP clients and failed SMTP logins in /var/log/mail.log
Dovecot IMAP/POP3Failed mailbox logins in /var/log/mail.log
Recidive (repeat offenders)Addresses banned again within a day are banned for a week on all ports

Only jails whose service is running and whose log files exist can be enabled. The panel's per-site logs under /home/USER/logs are watched too; sites added later are picked up at the next Fail2Ban reload.

Per-jail settings

Under Per-Jail Settings you can give one jail its own ban time, find window and max retries. Leave a field empty to use the default; a ban time of -1 bans permanently. The values are written to /etc/fail2ban/jail.d/vinza-JAIL.local and checked with fail2ban-client -t before reloading — a change Fail2Ban rejects is undone.

Default ban policy

On the Configuration tab, under Default Ban Policy, you can change the defaults shared by every jail that does not override them:

SettingMeaning
Ban time (seconds)How long a banned IP stays blocked (3600 = 1 hour, 86400 = 1 day). Minimum 60.
Find window (seconds)The time window in which failures are counted (600 = 10 minutes). Minimum 10.
Max retriesFailed attempts allowed before an IP is banned. Minimum 1.
Whitelisted IPs (never banned)Space-separated IPs or CIDR ranges. Localhost (127.0.0.1/8 ::1) is always kept.

Click Save & Apply: the values are written to /etc/fail2ban/jail.d/vinza-defaults.local and Fail2Ban reloads immediately. For anything the page does not cover, edit the local configuration file shown on the same tab (/etc/fail2ban/jail.local) and restart the service.

Fail2Ban Configuration tab with the Default Ban Policy form (max retries, find window, ban time) and the whitelist

FTP protection

The FTP Bans tab lists IPs banned for repeated failed FTP logins. If no FTP jail is active, click Enable FTP protection to turn on Fail2Ban's vsftpd jail (written to /etc/fail2ban/jail.d/vinza-ftp.local). Make sure vsftpd is installed and logging.

Command line

The usual fail2ban-client commands work as root:

# Status of the SSH jail and its banned IPs
sudo fail2ban-client status sshd

# Unban an IP from one jail
sudo fail2ban-client set sshd unbanip 192.0.2.55
Note

The page reads jails and bans through the VinzaPanel agent. If the vinza-agent service is down, jail data cannot be shown — see Service Recovery.

Related pages

On this page