Ask HN: Alternatives to Fail2ban?
I'm administering a small number of Linux servers that run an ssh server exposed to the Internet. I usually connect using a cryptographic key, but I still allow password authentication in case of trouble (perhaps I'm being overly cautious). I've been using fail2ban with good results, but I'm annoyed at having to install a Python interpreter on every server.
Is there an alternative to fail2ban that is just a single binary? It doesn't need to have all of the features of fail2ban, blocking dictionary attacks against ssh is all I need.
12 comments
[ 0.48 ms ] story [ 14.0 ms ] threadEdit: I should add, there will still be some syslog entries, but that can be filtered out using regex filters in rsyslog one so desired. Only do so once it is confirmed most of the brute forcing has stopped.
[1] - https://nochan.net/b/Internet-Crap/20260108-Confuse-Some-SSH...
Thanks. I've replaced fail2ban with sshguard on one machine, we'll see how it goes.
You gotta get over that eventually and really, the sooner the better.
https://fail2zig.com
Thanks. I've had a quick look, and it looks like it's a drop-in replacement for fail2ban (it claims to parse fail2ban's configuration files unchanged), except that it doesn't require a Python runtime.
I haven't tried it, since I'm currently happy with sshguard. I'm keeping the link handy in case I find I need more features than what sshguard provides.
If not, use something like WireGuard (or Tailscale) and bind only to that interface.
You can also change the default port, your logs will quiet down dramatically.
Lastly, if you have a long enough passphrase with enough entropy/randomness, password authentication being enabled is probably fine, you can also set only a specific user allowed to SSH for additional hardening.