<IfModule mod_ban.c>
BanEngine on
BanLog /var/log/proftpd/ban.log
BanTable /var/log/proftpd/ban.tab
#T以下是客户端被ban后输出的信息.
#%a: client IP address
#%c: client class (if none, will be empty)
#%u: USER name (if none, will be empty)
#Example:
#BanMessage "Host %a has been banned"
BanMessage "本机一个地址只限一个连接!由于你的IP地址 %a 在短时间内多次连续尝试建立新连接,你的IP将被封锁5分钟!请在5分钟后在登录"
# If the same client reaches the MaxLoginAttempts limit 2 times
# within 10 minutes, automatically add a ban for that client that
# will expire after one hour.
#以下是触发ban功能的指令
# AnonRejectPasswords
# MaxClientsPerClass
# MaxClientsPerHost
# MaxClientsPerUser
# MaxConnectionsPerHost
# MaxHostsPerUser
# TimeoutIdle
# TimeoutNoTransfer
#在每客户端连接数已经达到最大的时候还尝试在10秒内连接10次的封5分钟
BanOnEvent MaxClientsPerHost 10/00:00:10 00:05:00
BanOnEvent AnonRejectPasswords 2/00:00:02 00:05:00
BanOnEvent MaxConnectionsPerHost 2/00:00:2 00:05:00
# 允许root用户加入或者删除被ban的用户
BanControlsACLs all allow user root
</IfModule>