How to only make one user authenticate via SSH keys and allow password authentication to all others

David Razdolski

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.

Amith KK

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Allow password authentication in SSH only when there is no key in authorized_keys

From Dev

How can I make a user able to log in with ssh keys but not with a password?

From Dev

SSH authentication: either SSH keys or one time password

From Dev

How can I allow SSH password authentication from only certain IP addresses?

From Dev

Only allow one user on system to be SSH'd into

From Dev

How to allow a user ssh using password only if he's using the local network?

From Dev

How to authenticate the express API to allow only logged In user

From Dev

How to use only one field for webpage authentication (instead of both user and password)

From Dev

SSH.NET Authenticate via private key only (public key authentication)

From Dev

How to allow only one User to see "UpdateView"?

From Dev

How to allow only one user to register with Stormpath

From Dev

How to allow only one User to see "UpdateView"?

From Dev

How to restrict an SSH user to only allow SSH-tunneling?

From Dev

How to allow SSH only with RSA key, and SFTP with password and chroot?

From Dev

Allowing only specific users to login via ssh at one port and others to login via another port

From Dev

Only one user cannot log into an app via Google ID Authentication

From Dev

How to make sudo use root password for some commands and user password for others

From Dev

Android :: How to automatically re-authenticate the User when the token expires (Email + Password authentication)

From Dev

When using SSH is it possible to prevent password authentication only if a certificate exists in the user's home directory?

From Dev

SSH keys not working, still asking for user password

From Dev

Allow user to only change their own password/details

From Dev

Allow user to only change their own password/details

From Dev

Allow access only for robot.txt via http, others at https

From Dev

Failure to authenticate SSH keys

From Dev

How do I allow only one user to su to another account?

From Dev

how to allow only one active session per user

From Dev

how to allow only one active session per user

From Dev

How do I allow only one user to su to another account?

From Dev

How to allow authentication with `sudo` using an alternate password?

Related Related

  1. 1

    Allow password authentication in SSH only when there is no key in authorized_keys

  2. 2

    How can I make a user able to log in with ssh keys but not with a password?

  3. 3

    SSH authentication: either SSH keys or one time password

  4. 4

    How can I allow SSH password authentication from only certain IP addresses?

  5. 5

    Only allow one user on system to be SSH'd into

  6. 6

    How to allow a user ssh using password only if he's using the local network?

  7. 7

    How to authenticate the express API to allow only logged In user

  8. 8

    How to use only one field for webpage authentication (instead of both user and password)

  9. 9

    SSH.NET Authenticate via private key only (public key authentication)

  10. 10

    How to allow only one User to see "UpdateView"?

  11. 11

    How to allow only one user to register with Stormpath

  12. 12

    How to allow only one User to see "UpdateView"?

  13. 13

    How to restrict an SSH user to only allow SSH-tunneling?

  14. 14

    How to allow SSH only with RSA key, and SFTP with password and chroot?

  15. 15

    Allowing only specific users to login via ssh at one port and others to login via another port

  16. 16

    Only one user cannot log into an app via Google ID Authentication

  17. 17

    How to make sudo use root password for some commands and user password for others

  18. 18

    Android :: How to automatically re-authenticate the User when the token expires (Email + Password authentication)

  19. 19

    When using SSH is it possible to prevent password authentication only if a certificate exists in the user's home directory?

  20. 20

    SSH keys not working, still asking for user password

  21. 21

    Allow user to only change their own password/details

  22. 22

    Allow user to only change their own password/details

  23. 23

    Allow access only for robot.txt via http, others at https

  24. 24

    Failure to authenticate SSH keys

  25. 25

    How do I allow only one user to su to another account?

  26. 26

    how to allow only one active session per user

  27. 27

    how to allow only one active session per user

  28. 28

    How do I allow only one user to su to another account?

  29. 29

    How to allow authentication with `sudo` using an alternate password?

HotTag

Archive