the fail2ban-client has an interaction mode which will make it easy to unban an IP without many complications. To access interactive mode use:
$ fail2ban-client -i
once in interactive mode type ssh
, or in some cases sshd
(this was the case in my installation)
fail2ban> status ssh
you'll get something like this:
Status for the jail: ssh
|- Filter
| |- Currently failed: 0
| |- Total failed: 6
| `- File list: /var/log/auth.log
`- Actions
|- Currently banned: 1
|- Total banned: 2
`- Banned IP list: 203.113.167.162
Under Banned IP list
find the IP you want to unban, and then use the set ssh unbanip
(or set sshd unbanip
if you used status sshd
above) command to unban the IP. Using the IP listed above as an example you would type:
fail2ban> set ssh unbanip 203.113.167.162
Once you do that the IP should no lonber be banned. You can proceed to exit the interactive mode
fail2ban> exit
To make sure the IP is no longer banned, you can check the ip tables:
$ iptables -L