Skip to content

Instantly share code, notes, and snippets.

@danielcbaldwin
Created March 12, 2020 17:53
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 danielcbaldwin/7375e9ee2627c2ac63f2fdfa965d0ed5 to your computer and use it in GitHub Desktop.
Save danielcbaldwin/7375e9ee2627c2ac63f2fdfa965d0ed5 to your computer and use it in GitHub Desktop.
Install Fail2Ban Arch
# Install
yay -S fail2ban
# Configure
sudo vim /etc/fail2ban/jail.d/sshd.local # refer to file below for content
# Enable & Start
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo systemctl restart sshd
# Check that it worked
sudo fail2ban-client status
sudo fail2ban-client status sshd
[sshd]
enabled = true
filter = sshd
banaction = iptables
backend = systemd
maxretry = 5
findtime = 1d
bantime = 2w
ignoreip = 172.70.0.0/1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment