Hello, so after a lot of googling and testing, i found out how to fix various fail2ban messages, like:
So the problem is fail2ban runs too quickly, to fix it:
go to /etc/fail2ban/action.d
open iptables-multiport-log.conf
add
so it looks:
I haven't seen any errors since then, and ips are banned.
Ok, so errors is not stopping, i ran commands directly and this is what i found out.
Error log entry
Actual error message when typed directly
fail2ban.actions.action: ERROR iptables -N fail2ban-sasl#012iptables -A fail2ban-sasl -j RETURN#012iptables -I INPUT -p tcp --dport smtp -j fail2ban-sasl returned 200
iptables v1.4.7: Cannot use -A with -Z
fail2ban.actions.action: ERROR iptables -D INPUT -p tcp -m multiport --dports pop3,pop3s,imap,imaps -j fail2ban-dovecot-pop3imap#012iptables -F fail2ban-dovecot-pop3imap#012iptables -X fail2ban-dovecot-pop3imap returned 100
iptables v1.4.7: Invalid target name `fail2ban-dovecot-pop3imap#012iptables' (31 chars max)
fail2ban.actions.action: ERROR iptables -D INPUT -p tcp --dport smtp -j fail2ban-sasl#012iptables -F fail2ban-sasl#012iptables -X fail2ban-sasl returned 100
iptables v1.4.7: Cannot use -F with -D
fail2ban.actions.action: ERROR iptables -D INPUT -p tcp --dport ftp -j fail2ban-pure-ftpd#012iptables -F fail2ban-pure-ftpd#012iptables -X fail2ban-pure-ftpd returned 100
iptables v1.4.7: Cannot use -F with -D
fail2ban.actions.action: ERROR iptables -D INPUT -p tcp --dport ssh -j fail2ban-SSH#012iptables -F fail2ban-SSH#012iptables -X fail2ban-SSH returned 100
iptables v1.4.7: Cannot use -F with -D
fail2ban.actions.action: ERROR iptables -N fail2ban-dovecot-pop3imap#012iptables -A fail2ban-dovecot-pop3imap -j RETURN#012iptables -I INPUT -p tcp -m multiport --dports pop3,pop3s,imap,imaps -j fail2ban-dovecot-pop3imap returned 200
iptables v1.4.7: Cannot use -A with -Z
¿<27>fail2ban.filter : ERROR No 'host' group in 'dovecot-auth: pam_unix\(dovecot:auth\):'
So the problem is fail2ban runs too quickly, to fix it:
go to /etc/fail2ban/action.d
open iptables-multiport-log.conf
add
tosleep `perl -e 'print rand(3);'`
actionstart =
so it looks:
actionstart = sleep `perl -e 'print rand(3);'`
iptables -N fail2ban-<name>
I haven't seen any errors since then, and ips are banned.