fail2ban essential reference

Get the active jails:

# fail2ban-client status
Status
|- Number of jail: 1
`- Jail list: sshd

Show the banned IP in a jail:

# fail2ban-client status sshd
Status for the jail: sshd
|- Filter
| |- Currently failed: 3
| |- Total failed:     1907
| `- File list:        /var/log/secure 
`- Actions
  |- Currently banned: 0
  |- Total banned:     381
  `- Banned IP list:

You can also list the banned IPs using iptables -L.

Unban an IP:

fail2ban-client set [JAIL] unbanip [IP]

Ban an IP:

fail2ban-client set [JAIL] banip [IP]

Log file:

/var/log/fail2ban.log