# Sharing my fail2ban config

**URL:** <https://forum.hestiacp.com/t/sharing-my-fail2ban-config/20918>\
**Category:** Firewall\
**Created:** [January 29, 2026, 11:28am UTC](https://forum.hestiacp.com/t/sharing-my-fail2ban-config/20918 "2026-01-29T11:28:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wibol](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/w/2acd7d/32.png) [@Wibol](https://forum.hestiacp.com/u/Wibol)\
**Post date:** [January 29, 2026, 11:28am UTC](https://forum.hestiacp.com/t/sharing-my-fail2ban-config/20918/1 "2026-01-29T11:28:14Z")

</div>

This may be useful for anyone who is a little lost:

```auto
[DEFAULT]
maxretry = 5
findtime = 1d
bantime = 2d

[recidive]
enabled = true
filter = recidive
action = hestia[name=RECIDIVE]
logpath = /var/log/fail2ban.log
maxretry = 3
findtime = 1w
bantime = 1mo

[ssh-iptables]
enabled = true
filter = sshd
action = hestia[name=SSH]
logpath = /var/log/auth.log

[vsftpd-iptables]
enabled = true
filter = vsftpd
action = hestia[name=FTP]
logpath = /var/log/vsftpd.log

[exim-iptables]
enabled = true
filter = exim
action = hestia[name=MAIL]
logpath = /var/log/exim4/mainlog

[dovecot-iptables]
enabled = true
filter = dovecot
action = hestia[name=MAIL]
logpath = /var/log/dovecot.log

[mysqld-iptables]
enabled = false
filter = mysqld-auth
action = hestia[name=DB]
logpath = /var/log/mysql/error.log

[hestia-iptables]
enabled = true
filter = hestia
action = hestia[name=HESTIA]
logpath = /var/log/hestia/auth.log

[roundcube-auth]
enabled = true
filter = roundcube-auth
action = hestia[name=WEB]
logpath = /var/log/roundcube/errors

[phpmyadmin-auth]
enabled = true
filter = phpmyadmin-syslog
action = hestia[name=WEB]
logpath = /var/log/auth.log

```

# **Meaning**

If within a day (or less), an IP address commits 5 login errors on one or more services, it is banned for 2 days.

If within a week (or less), an IP address has been banned 3 times, it will be banned for 1 month.

The number of banned IP addresses is usually around 100.

---

<div class="post-metadata">

**Author:** ![bokishaNET](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/bokishanet/32/8868_2.png) [@bokishaNET](https://forum.hestiacp.com/u/bokishaNET)\
**Post date:** [February 3, 2026, 12:11pm UTC](https://forum.hestiacp.com/t/sharing-my-fail2ban-config/20918/2 "2026-02-03T12:11:23Z")

</div>

This is my settings for fail2ban:

```auto
[DEFAULT]
usedns = no
maxretry = 5
findtime = 1d
bantime = 2d
bantime.increment = true
bantime.factor = 2
bantime.max = 604800
ignoreip = 46.4.xxx.xxx 4x.x.xxx.xxx 

[recidive]
enabled = true
filter = recidive
action = hestia[name=RECIDIVE]
logpath = /var/log/fail2ban.log
maxretry = 3
findtime = 1w
bantime = 1mo
bantime.max = 2592000

[ssh-iptables]
enabled = true
filter = sshd
action = hestia[name=SSH]
logpath = /var/log/auth.log
bantime.max = 604800

[vsftpd-iptables]
enabled = true
filter = vsftpd
action = hestia[name=FTP]
logpath = /var/log/vsftpd.log

[exim-iptables]
enabled = true
filter = exim
action = hestia[name=MAIL]
logpath = /var/log/exim4/mainlog

[dovecot-iptables]
enabled = true
filter = dovecot
action = hestia[name=MAIL]
logpath = /var/log/dovecot.log

[mysqld-iptables]
enabled = false
filter = mysqld-auth
action = hestia[name=DB]
logpath = /var/log/mysql/error.log

[hestia-iptables]
enabled = true
filter = hestia
action = hestia[name=HESTIA]
logpath = /var/log/hestia/auth.log

[roundcube-auth]
enabled = true
filter = roundcube-auth.local
action = hestia[name=WEB]
logpath = /var/log/roundcube/errors.log
maxretry = 6
findtime = 15m
bantime = 12h
bantime.max = 604800

[phpmyadmin-auth]
enabled = true
filter = phpmyadmin-syslog
action = hestia[name=WEB]
logpath = /var/log/auth.log
bantime.max = 604800

```
