프로그램 사용/fail2ban

fail2ban error 100

구차니 2017. 3. 6. 11:55

ssh가 차단이 안되서 좀 봤더니..

이런식으로 ssh 를 만들다가 실패하는거 같은데..

다시 보니.. unban이 실패네?

770 2017-03-06 11:33:08,276 fail2ban.actions[1253]: WARNING [ssh] Unban 117.179.164.237

771 2017-03-06 11:33:08,311 fail2ban.actions.action[1253]: ERROR   iptables -D fail2ban-ssh -s 117.179.164.237/24 -j REJECT --reject-with icmp-port-unreachable returned 100 


...


 828 2017-03-06 11:33:09,223 fail2ban.jail   [1253]: INFO    Jail 'ssh' stopped

 829 2017-03-06 11:33:09,893 fail2ban.jail   [1253]: INFO    Jail 'apache-multiport' stopped

 830 2017-03-06 11:33:09,896 fail2ban.server [1253]: INFO    Exiting Fail2ban

 831 2017-03-06 11:33:22,281 fail2ban.server [1184]: INFO    Changed logging target to /var/log/fail2ban.log for Fa     il2ban v0.8.13

 832 2017-03-06 11:33:22,297 fail2ban.jail   [1184]: INFO    Creating new jail 'ssh'

 833 2017-03-06 11:33:22,595 fail2ban.jail   [1184]: INFO    Jail 'ssh' uses pyinotify

 834 2017-03-06 11:33:22,891 fail2ban.jail   [1184]: INFO    Initiated 'pyinotify' backend


아무튼 이거는 race condition으로 추측되서 아래와 같이 수정해주면 된다는데 아직까진 티는 안나네

$ sudo vi /usr/bin/fail2ban-client

def __processCmd(self, cmd, showRet = True):

          beautifier = Beautifier()

          for c in cmd:

               time.sleep(0.1) 

               beautifier.setInputCmd(c)


[링크 : http://www.evilbox.ro/linux/fail2ban-iptables-error-on-ispconfig-on-ubuntu-11/]