Вот мое правило jail.local для ssh:
[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
logpath = /var/log/messages
maxretry = 5
Вот что создает мой журнал с BAN
2015-04-23 07:07:49,823 fail2ban.actions[27564]: WARNING [ssh-tcpwrapper] Ban xx.xx.xxx.xxx
2015-04-23 07:07:50,721 fail2ban.actions[27564]: WARNING [ssh-iptables] Ban xx.xx.xxx.xxx
2015-04-23 07:07:50,729 fail2ban.actions.action[27564]: ERROR iptables -n -L INPUT | grep -q 'fail2ban-SSH[ \t]' returned 100
2015-04-23 07:07:50,730 fail2ban.actions.action[27564]: ERROR Invariant check failed. Trying to restore a sane environment
2015-04-23 07:07:50,738 fail2ban.actions.action[27564]: ERROR iptables -D INPUT -p tcp --dport ssh -j fail2ban-SSH
iptables -F fail2ban-SSH
iptables -X fail2ban-SSH returned 100
теперь я тоже получаю это с UNBAN:
2015-04-23 16:18:48,828 fail2ban.actions[27564]: WARNING [ssh-tcpwrapper] Unban xx.xx.xxx.xxx
2015-04-23 16:18:48,835 fail2ban.actions.action[27564]: ERROR echo "/^sshd: xx.xx.xxx.xxx$/
d
w
q" | ed /etc/hosts.deny returned 7f00
2015-04-23 16:18:48,836 fail2ban.actions.action[27564]: INFO HINT on 7f00: "Command not found". Make sure that all commands in 'echo "/^sshd: xx.xx.xxx.xxx$/\nd\nw\nq" | ed /etc/hosts.deny' are in the PATH of fail2ban-server process (grep -a PATH= /proc/`pidof -x fail2ban-server`/environ). You may want to start "fail2ban-server -f" separately, initiate it with "fail2ban-client reload" in another shell session and observe if additional informative error messages appear in the terminals.
2015-04-23 16:19:04,847 fail2ban.actions[27564]: WARNING [ssh-iptables] Unban xx.xx.xxx.xxx
2015-04-23 16:19:04,855 fail2ban.actions.action[27564]: ERROR iptables -n -L INPUT | grep -q 'fail2ban-SSH[ \t]' returned 100
2015-04-23 16:19:04,855 fail2ban.actions.action[27564]: ERROR Invariant check failed. Trying to restore a sane environment
2015-04-23 16:19:04,863 fail2ban.actions.action[27564]: ERROR iptables -D INPUT -p tcp --dport ssh -j fail2ban-SSH
iptables -F fail2ban-SSH
iptables -X fail2ban-SSH returned 100
Это происходит в OpenSuse 13.2 с относительно нетронутой установкой fail2ban. Я больше похож на Centos, и я привык к таким вещам, которые у меня работают из коробки. На самом деле не знаю, куда обращаться с этими ошибками, потратил несколько часов на поиск в Google и просмотр стека, но ничего действительно надежного для решения не было, кроме «удалить и переустановить».
Я предполагаю, что это проблема среды, и что служба fail2ban не может выдать команду и / или каким-то образом команда имеет неправильный формат, но я не знаю, куда идти, чтобы это исправить.