I have some doubts about certain ssh server configurations on /etc/ssh/sshd_config
. I want the next behavior:
- Public key authentication is the only way to authenticate as root (no password authentication or other)
- Normal users can use both (password and public key authentication)
If I set PasswordAuthentication no
my first point is satisfied but not the second. There is a way to set PasswordAuthentication no
only for root?
Best Answer
You can do this using the
PermitRootLogin
directive. From thesshd_config
manpage:The following will accomplish what you want: