Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to enable ssh password authentication for one user on a system and disable it for an other.

If you add

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

to /etc/ssh/sshd_config you disable it for all users

Adding it to ~/.ssh/config doesn't seem to work

share|improve this question

migrated from Nov 12 '09 at 20:38

This question came from our site for professional and enthusiast programmers.

up vote 13 down vote accepted

Use a Match that matches all the users but the ones you want to be able to use password authentication and add the 'PasswordAuthentication no' in that Match block. Something like:

Match User someuser
PasswordAuthentication no

and so on.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.