Skip to content

Instantly share code, notes, and snippets.

@jtzero
Last active September 19, 2016 20:20
Show Gist options
  • Save jtzero/7526a3e57fca434c309e6d4a7d8ef09b to your computer and use it in GitHub Desktop.
Save jtzero/7526a3e57fca434c309e6d4a7d8ef09b to your computer and use it in GitHub Desktop.

pre 0.9.0

shell# echo '
[sshd]
enabled = true
filter = sshd
action = iptables-multiport
logpath = /var/log/auth.log
maxretry = 3
bantime = -1
' > /etc/fail2ban/jail.d/sshd.conf

upgrading

shell#cat path_to_old_ip.blacklist | while read IP; do fail2ban-client set sshd banip $IP; done

verify

sqlite3 /var/lib/fail2ban/fail2ban.sqlite3

sqlite> select * from bans;

done! much easier this time around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment