짧은 버전 :
현재 차단 된 모든 IP를 나열하십시오.
fail2ban-client status | grep "Jail list:" | sed "s/ //g" | awk '{split($2,a,",");for(i in a) system("fail2ban-client status " a[i])}' | grep "Status\|IP list"
IP 금지 해제 :
fail2ban-client set postfix-mail unbanip 111.222.333.444
긴 버전 :
"공식적인"방법을 찾고 있다면 fail2ban https://www.fail2ban.org/wiki/index.php/Commands 명령 행 클라이언트가 있습니다 .
~ # fail2ban-client status
Status
|- Number of jail: 8
`- Jail list: roundcube, sshd, sogo, postfix-sasl, postfix-mail, dovecot, ssh, sshd-ddos
그럼 당신은 실행할 수 있습니다
~ # fail2ban-client status roundcube
Status for the jail: roundcube
|- filter
| |- File list: /var/log/mail.log
| |- Currently failed: 0
| `- Total failed: 12
`- action
|- Currently banned: 1
| `- IP list: 111.222.333.444
`- Total banned: 1
또는 기존의 모든 감옥에서 반복되는 내 명령을 사용할 수 있습니다.
fail2ban-client status | grep "Jail list:" | sed "s/ //g" | awk '{split($2,a,",");for(i in a) system("fail2ban-client status " a[i])}' | grep "Status\|IP list"
어떤 출력 :
Status for the jail: roundcube
| `- IP list:
Status for the jail: sshd
| `- IP list:
Status for the jail: sogo
| `- IP list:
Status for the jail: postfix-sasl
| `- IP list:
Status for the jail: postfix-mail
| `- IP list:
Status for the jail: dovecot
| `- IP list:
Status for the jail: ssh
| `- IP list:
Status for the jail: sshd-ddos
| `- IP list:
sudo iptables -L -n
?