Many SSH brute-force attempts hit a public host. How do you stop them?
IntermediateScenarioSecurity: Firewalls, SGs, NACLs & VPN
Answer
Situation read → Reduce exposure, then rate-limit.
What I'd do →
- Close the port to the world and use SSM or a VPN
- If SSH must be public, disable passwords in
/etc/ssh/sshd_config:PasswordAuthentication noandPermitRootLogin no - Install fail2ban:
fail2ban-client status sshd - Use security group allow lists
- Review
journalctl -u sshandlastb
Why → Key-only auth makes brute force pointless, and allow lists remove the noise.
Interview tip → Say moving SSH to another port is cosmetic, not security.
More on Security: Firewalls, SGs, NACLs & VPN
Security group versus NACL: explain the differences.BeginnerHow do you let only your office IP SSH into a server?BeginnerWhat does it mean that a security group can reference another security group?BeginnerStateful versus stateless firewalls: what is the practical difference?BeginnerWhat is a WAF and where do you place it?BeginnerWhat is the difference between a site-to-site VPN and a client VPN?Beginner