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

This is a question regarding the OpenSSH client on Linux, MacOSX and FreeBSD.

Normally, I log into systems using my SSH key.

Occasionally, I want my SSH client to ignore my SSH key and use a password instead. If I 'ssh hostname', my client prompts me for the Passphrase to my SSH key which is an annoyance. Instead, I want the client to simply ignore my SSH key, so that the server will ask me for my password instead.

I tried the following, but I am still prompted for the passphrase to my SSH key. After this, I am prompted for my password.

ssh -o PreferredAuthentications=password

I want to do this on the client side, without any modification of the remote host.

share|improve this question
up vote 103 down vote accepted

Try ssh -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no

In ssh v2, keyboard-interactive is another way to say "password". The -o PubkeyAuthentication=no option instructs the client not to attempt key pair authentication.

share|improve this answer
And in fact 'ssh -o PreferredAuthentications=keyboard-interactive host' also works. I was thrown off by SSH_CONFIG(5), which still mentions the 'password' keyword. Thanks for the clarification. – Stefan Lasiewski Apr 7 '10 at 23:35
Correction: In SSH v2, both password and keyboard-interactive are valid, and they are different things. (password requires a password, and keyboard-interactive can technically be anything.) – grawity Apr 8 '10 at 12:17
Bill could you update your answer according to grawity's comment? Look at the output of these commands: lucian@XXX:~$ ssh -o PreferredAuthentications=keyboard-interactive -o PubkeyAuthentication=no Permission denied (publickey,gssapi-with-mic,password). lucian@XXX:~$ ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no's password: – Lucian Adrian Grijincu Mar 15 '12 at 21:43
What does your server configuration look like? I've never seen that difference. As well, that wouldn't answer the original question, they were trying password. – Bill Weiss Mar 17 '12 at 12:00
If you want to add this switch to ssh's config file (~/.ssh/config) it's PubkeyAuthentication no in that file. – slm Aug 24 '12 at 16:17

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.