Server Fault is a question and answer site for system and network administrators. 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

is it possible to enable the use of password authentication or key authentication in CentOS 5.7? All I can find is setting PasswordAuthentication to no which forces the use of keys...


share|improve this question
Do you mean you want to allow users to login with either password or key, not both? – quanta Oct 31 '11 at 4:14
Yes either, not both. – Darren Oct 31 '11 at 5:07
up vote 4 down vote accepted

Disabling PasswordAuthentication doesn't force keys, it disables password authentication, as advertised.

PubkeyAuthentication determines whether key authentication is allowed.

So, to answer your question directly, the following config allows either password or key auth:

PasswordAuthentication yes
PubkeyAuthentication yes
share|improve this answer

Do you mean you want something like this:

Match User user1
    PasswordAuthentication no
    RSAAuthentication yes
    PubkeyAuthentication yes

Match User user2
    PasswordAuthentication yes
    RSAAuthentication no
    PubkeyAuthentication no
share|improve this answer

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.