I was wondering if it would be possible to only force SSH key based authentication to one user (admin) and allow all other users on the system (excluding root, who's ssh login is already disabled in sshd_config) to authenticate via Password.
1 Answer
You can do that by modifying your sshd_config
to add:
Match User <username>
PasswordAuthentication no
You can do the same for groups as well by using Match Group
instead
Don't forget to restart sshd
after
-
Is there any way to just have that as a catch-all for all users except a certain one? i,e admin? Jul 20, 2018 at 6:54
-
1
-
@DavidRazdolski That is possible by negation but note that it's broken in certain releases of OpenSSH– Amith KKJul 20, 2018 at 7:11