Comment on How to harden against SSH brute-forcing?
gerowen@lemmy.world 1 week ago
I generally do a few things to protect SSH:
- Disable password login and use keys only
- Install and configure Fail2Ban
- Disable root login via ssh altogether. You can still become root via sudo or su after you’re connected, but that would trigger an additional password request. I always connect as a normal user and then use sudo if/when I need it. I don’t include NOPASSWD in my sudoers to make certain sudo prompts for a password. Doesn’t do any good to force normal user login if sudo doesn’t require a password.
- If connecting via the same network or IPs, restrict the SSH open port to only the IPs you trust.
- I don’t have SSH internet visible. I have my own Wireguard server running on a separate raspberry pi and use that to access SSH when I’m away, but SSH itself is not open to the internet or forwarded in the router.
k_rol@lemmy.ca 1 week ago
I vote for wireguard here, I don’t expose anything other than game servers to the internet