Get out of fail2ban jail

Ever get locked out of your own computer because you tried the password too many times when you were, well, not paying attention? I found it tough to find how to unban myself and was pretty frustrated by the ambiguity of the instructions. Not ambiguous. Comprehensive. I don't really want to know any more about fail2ban than how to remove one particular IP.

First, get a list of the jails
# fail2ban-client status

Status
|- Number of jail: 1
`- Jail list: sshd

Then review the banned things

# fail2ban-client status sshd

Status for the jail: sshd
|- Filter
| |- Currently failed: 2
| |- Total failed: 634
| `- Journal matches: _SYSTEMD_UNIT=sshd.service + _COMM=sshd
`- Actions
|- Currently banned: 2
|- Total banned: 4
`- Banned IP list: 219.137.44.150 229.137.39.8

# fail2ban-client set sshd unbanip 219.137.44.150

I didn't find this recipe written down anywhere, probably it is too obvious for an expert to write it own.

However, this guy writes interesting scripts and I was able to deduce the required actions from reading his code

http://www.iredmail.org/forum/topic7498-iredmail-support-handy-script-for-unbanning-ips.html

About pauljohn

Paul E. Johnson is a Professor of Political Science at the University of Kansas. He is an avid Linux User, an adequate system administrator and C programmer, and humility is one of his greatest strengths.
This entry was posted in Linux and tagged . Bookmark the permalink.

Leave a Reply