This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:linux:fail2ban [2013/09/26 16:59] gcooper |
networking:linux:fail2ban [2017/03/15 08:51] (current) gcooper |
||
---|---|---|---|
Line 85: | Line 85: | ||
# Don't know how well other backend options work. | # Don't know how well other backend options work. | ||
backend = polling | backend = polling | ||
+ | |||
+ | [apache-denied] | ||
+ | |||
+ | enabled | ||
+ | filter | ||
+ | action | ||
+ | # sendmail-whois[name=Denied, | ||
+ | logpath | ||
+ | maxretry | ||
+ | bantime | ||
+ | |||
+ | [apache-postflood] | ||
+ | |||
+ | enabled | ||
+ | filter | ||
+ | action | ||
+ | | ||
+ | logpath | ||
+ | findtime = 10 | ||
+ | maxretry = 10 | ||
+ | bantime | ||
[ssh-iptables] | [ssh-iptables] | ||
Line 129: | Line 150: | ||
[apache-badbots] | [apache-badbots] | ||
- | enabled | + | enabled |
filter | filter | ||
action | action | ||
| | ||
- | logpath | + | logpath |
+ | / | ||
/ | / | ||
/ | / | ||
maxretry = 1 | maxretry = 1 | ||
+ | bantime | ||
</ | </ | ||
Line 224: | Line 247: | ||
===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
+ | |||
+ | **Correctly count login failures**: http:// | ||
+ | |||
+ | < | ||
+ | sudo sed -i ' | ||
+ | sudo service rsyslog restart | ||
+ | sudo service fail2ban restart | ||
+ | </ | ||
:!: If you can test a filter successfully with '' | :!: If you can test a filter successfully with '' | ||
This shows failed SSH logins by date: | This shows failed SSH logins by date: | ||
+ | |||
+ | CentOS/ | ||
< | < | ||
cat / | cat / | ||
+ | </ | ||
+ | |||
+ | Debian/ | ||
+ | |||
+ | < | ||
+ | cat / | ||
</ | </ | ||
Line 248: | Line 287: | ||
===== Testing ===== | ===== Testing ===== | ||
+ | |||
+ | Count of banned IP addresses: | ||
+ | |||
+ | < | ||
+ | iptables -nL |grep " | ||
+ | </ | ||
< | < |