versi singkat :
daftarkan semua ips yang saat ini diblokir:
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"
batalkan pembatalan ip:
fail2ban-client set postfix-mail unbanip 111.222.333.444
versi panjang :
jika Anda mencari cara "resmi" untuk melakukan itu, ada klien baris perintah untuk 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
maka kamu bisa lari
~ # 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
atau Anda dapat menggunakan perintah saya, yang mengulangi semua penjara yang ada:
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"
yang keluaran:
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
?