Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible with ssh to allow passwords from a certain user, but deny using passwords for everybody else?

Basically I want to allow password auth for user justin but everybody else must use public keys.

PasswordAuthentication no

Seems to be global though, no way to specify by user.

share|improve this question
3  
Why? If you're the administrator of the server, your account ought to be protected just as much as the rest of the users, if not more so. –  EEAA Sep 1 '11 at 22:49
1  
This question how to disable SSH login with password for some users? has the answer you want. –  Zoredache Sep 1 '11 at 22:50
    
When I try and use the match syntax, Match User justin PasswordAuthentication yes I am getting Bad configuration option: Match when I restart sshd. –  Justin Sep 1 '11 at 22:57
2  
Wow, how old is your SSH? –  womble Sep 1 '11 at 23:01
    
CentOS 5.6, looks to be: OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008. There inst an update in yum. –  Justin Sep 1 '11 at 23:06

1 Answer 1

Look at the sshd_config man page, and look at the section for the Match directive.

share|improve this answer

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.