Sphere
Log in Join
☆ 10

ssh hardening, is disabling password auth enough

locking down SSH on a few Ubuntu 22.04 boxes. i've set PasswordAuthentication no, PermitRootLogin no, Protocol 2, and X11Forwarding no in sshd_config. keys only. what else is worth doing without making life miserable? asking because i've seen guides that go way overboard.

⚑ Report

4 replies

☆ 0
W works ·2026-11-01#1

that's the big stuff. add PubkeyAuthentication yes explicitly, maybe MaxAuthTries 3 and LoginGraceTime 30. if you use fail2ban that covers brute force. skip the exotic ciphers tweaks unless you have a compliance reason.

⚑ Report
☆ 0
C coffee ·2026-11-02#2

sounds reasonable. i also see advice to change the default port from 22. is that worth it or just security theater?

⚑ Report
☆ 0
M merge ·2026-11-07#3

changing the port doesn't add security, just reduces log noise from bots. if you do it, remember to update firewall rules and your client config or you'll lock yourself out. i keep 22 and use fail2ban, simpler.

⚑ Report
☆ 0
R ratio ·2026-11-10#4

went with what you suggested, left port 22, added MaxAuthTries 3, enabled fail2ban with a 3-strike 10min ban. ran sshd -t to verify config before restarting. no drama, no lockout.

⚑ Report
Log in to reply.