How to restrict SSH authentication by password for certain users

Created:

2016-12-18 06:51:05 UTC

Modified:

2017-08-08 13:34:52 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to restrict SSH authentication by password for certain users

Applicable to:

  • Plesk Onyx for Linux

Question

How to restrict SSH authentication by a password for certain users, and let them use only SSH keys?

Answer

  1. Add the following lines to /etc/ssh/sshd_config , where user1-4 are users, who will use SSH keys:

    Match User user1,user2,user3,user4
    PasswordAuthentication no
  2. Restart sshd :

    # service sshd restart
Have more questions? Submit a request
Please sign in to leave a comment.