Why disable ssh login with root on a server if I only log in with keys, not password?
rtxn @ rtxn @lemmy.world Posts 19Comments 1,796Joined 2 yr. ago
rtxn @ rtxn @lemmy.world
Posts
19
Comments
1,796
Joined
2 yr. ago
It's another slice of Swiss cheese. If the user has a strong enough password or other authentication method through PAM, it might stop or hinder an attacker who might only have a compromised private key, for example. If multiple users have access to the same server and one of them is compromised, the account can be disabled without completely crippling the system.
Using
sudo
can also help you avoid mistakes (like accidentally rebooting a production server) by restricting which commands are available to the user.