Skip to content

Instantly share code, notes, and snippets.

@groundcat
Created January 12, 2026 08:37
Show Gist options
  • Select an option

  • Save groundcat/928cc39b676948692a1c81597af2821c to your computer and use it in GitHub Desktop.

Select an option

Save groundcat/928cc39b676948692a1c81597af2821c to your computer and use it in GitHub Desktop.
apt update && apt upgrade -y && apt install -y fail2ban && printf "[DEFAULT]\ndestemail = your@email.here\nsendername = Fail2Ban\n\n[sshd]\nenabled = true\nport = 22\nmode = aggressive\n" | tee /etc/fail2ban/jail.local >/dev/null && systemctl restart fail2ban
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment