Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 1 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 comment

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
add comment

Your Answer

 
discard

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.