# cat /etc/fail2ban/jail.conf
1 #
2 # WARNING: heavily refactored in 0.9.0 release. Please review and
3 # customize settings for your setup.
4 #
5 # Changes: in most of the cases you should not modify this
6 # file, but provide customizations in jail.local file,
7 # or separate .conf files under jail.d/ directory, e.g.:
8 #
9 # HOW TO ACTIVATE JAILS:
10 #
11 # YOU SHOULD NOT MODIFY THIS FILE.
12 #
13 # It will probably be overwritten or improved in a distribution update.
14 #
15 # Provide customizations in a jail.local file or a jail.d/customisation.local.
16 # For example to change the default bantime for all jails and to enable the
17 # ssh-iptables jail the following (uncommented) would appear in the .local file.
18 # See man 5 jail.conf for details.
19 #
20 # [DEFAULT]
21 # bantime = 1h
22 #
23 # [sshd]
24 # enabled = true
25 #
26 # See jail.conf(5) man page for more information
[DEFAULT ]
ignorecommand = ##
bantime = 10m ## 禁止时长,默认10分钟
findtime = 10m ## 执行操作的窗口时长,默认10分钟
maxretry =5 ## 最大尝试次数
backend = auto ## 指定用于获取文件修改的后端
usedns = warn ##
logencoding = auto
enabled = false ## jails 默认关闭,在自定义的 .local 中打开需要用到的项
mode = normal ## 过滤器类型
filter = %( name )s [mode=%(mode)s ] ## 定义过滤器
destemail =root@localhost ## 通知将被发送到的电子邮件地址
sender = root@ ## 发件人姓名
mta =sendmail ## 邮件传输代理(默认是 sendmail,可以改成 mail)
protocol = tcp
chain = <known/chain>
port = 0:65535
fail2ban_agent = Fail2Ban/%(fail2ban_version)s
banaction = iptables-multiport ## 动作的捷径,用于定义动作参数
banaction_allports = iptables-allports
action_abuseipdb =abuseipdb
......
action = %(action_)s