Skip to content

Instantly share code, notes, and snippets.

@stephenscaff
Last active October 2, 2019 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenscaff/a0527da89b69dab57f93c09b4287b174 to your computer and use it in GitHub Desktop.
Save stephenscaff/a0527da89b69dab57f93c09b4287b174 to your computer and use it in GitHub Desktop.
Instructions for freeing an IP from fail2ban jail.
# First, use ip tables to find fail2ban rules
iptables -L -n
# Locate the block ip among the listed refs returned
...
Chain f2b-wordpress-hard (1 references)
target prot opt source destination
REJECT all -- 1.2.3.4.5 0.0.0.0/0 reject-with icmp-port-unreachable
RETURN all -- 0.0.0.0/0 0.0.0.0/0
...
# Then use fail2ban-client status to find actual jail names.
# Though, it might just be what's in Chain, minus the f2b- prefix.
fail2ban-client status
# Jail list status returned
...
|- Number of jail: 3
`- Jail list: sshd, wordpress-hard, wordpress-soft
...
# Now, remove the desired ip
fail2ban-client set wordpress-hard unbanip 1.2.3.4.5
# The provided ip should be returned, indicating that it's been set free and you're good to go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment