Skip Navigation

Why disable ssh login with root on a server if I only log in with keys, not password?

On a server I have a public key auth only for root account. Is there any point of logging in with a different account?

81 comments
  • Zero-day exploits are security holes that exist and are used by bad actors, but aren't yet known to you, or anyone capable of closing the hole. The clock to patch the hole doesn't start running until the exploit is known: it stands at zero days until the good guys know it exists.

    What zero-day exploits exist for ssh?

    By definition, you don't know. So, you block root login, and hope the bad actor doesn't also know a zero-day for sudo.

  • One always minimises attack surfaces and the possibility of fat fingered mistakes. The lower privileges that you grant yourself the better.

    You'd think that Dave Cutler who, I believe, designed Windows NT coming from a Unix style background would have followed these principles but no. I discovered *nix late sadly.

  • I never login with the root account. Not even on the console. You don't want everything you do running as root unless it is required. Otherwise it is much easier for a little mistake to become a big mess.

81 comments