So, I add ssh key, good. I can log in through ssh @root without password, great.
I keep reading about disabling root login for security, is this if you were not to set up an ssh key.? If i disable root login, then my whole ssh key would be worthless correct,.? I can create a second sudo account, disable root, but this second account would not be using the key, just the password I gave that account…
Is this correct.?
How do you all have accounts set up with ssh keys.?
Thank you, Fidel
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
From
man sshd_config
:You should not mistake permitting normal root login and root login through ssh. As above, authentication via password via key are two different things, and do not affect each other.
If you set
PermitRootLogin without-password
in your SSH server config, you will be able to log in only via the key and not the password. Hovewer, most server admins do set up a separate account with sudo access and disable root login completely (PermitRootLogin no
).