by illumen · 11y ago · 0 comments
You can also rate limit new connections to ssh depending on your use cases. So even if your whitelist is beaten you limit the number of attempts.
Now add fail2ban, so that even at 10 new rate limited connections per minute they get banned after X failed attempts.
Change the default port of ssh, to make it harder to find.
Remove password authentication, and make sure you have good secure keys.
You can also disable sudo, and root logins perhaps. As well you could try 2 factor auth, and perhaps move your keys to a secure(encrypted) USB drive.
But really, whitelisting who can connect to ssh in the first place will stop 99% of the automated brute force attacks, with all the rest stopping the remaining 0.99%.
EDIT: Oops, just saw that the article does talk about SSH brute-forcing. Your point is quite valid.
https://stribika.github.io/2015/01/04/secure-secure-shell.ht...
Since following the above guide, my auth log has been filled with nothing but this:
Sep 30 09:46:00 myserver sshd[74033]: fatal: no matching mac found: client hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160@openssh.com server hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com [preauth]
Of course, I can't use old SSH clients to connect, but it's a good tradeoff, IMO.There's only been a couple of remote ssh exploits (that I'm aware of) and both of them were stopped by white listing. If you can figure out your address ranges, I think it still makes sense to white list. I guess also the bots will catch up with modern ciphers.