Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

It's easy enough to disable password authentication for SSH as a whole, but is there a way of allowing one user on the system the ability of logging in with a password?

The reason for this is we have several servers at rackspace and we'd like to allow rackspace access to the servers without having to set it up on all of the machines (there are lots!)

If it's simply not possible without editing the source of sshd or something that'd be good to know :)

share|improve this question
This includes all future users, so no per-user rules please unless they can be applied to future users.. perhaps that's the way to do it.. – John Hunt Apr 19 '13 at 13:00
up vote 2 down vote accepted

Within the sshd configuration, you can apply different settings for User, Group, Host, LocalAddress, LocalPort, and Address using the Match directive.

For what you need put this is the /etc/ssh/sshd_config file:

PasswordAuthentication no
PubkeyAuthentication yes
Match User <USERNAME>
  PasswordAuthentication yes
share|improve this answer
Excellent, works a treat! – John Hunt Apr 19 '13 at 14:15

Add the below commands in to the /etc/ssh/sshd_config

  1. ChallengeResponseAuthentication no
  2. PasswordAuthentication no
  3. UsePAM no
  4. PubkeyAuthentication yes

Then reload SSH service :

sepahrad@pc:~$ /etc/init.d/ssh reload

share|improve this answer
What about my one user that needs to use a password? – John Hunt Apr 19 '13 at 14:11
Sorry i forgot it! You can use Match User – Sepahrad Salour Apr 19 '13 at 14:16

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.