226

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 host.example.org 

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

0

2 Answers 2

290

Try ssh -o PasswordAuthentication=yes -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no host.example.org

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.

In addition, the PasswordAuthentication=yes option is to override any previously configured ssh options that may have disabled it.

13
  • 1
    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. Commented Apr 7, 2010 at 23:35
  • 12
    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.) Commented Apr 8, 2010 at 12:17
  • 8
    If you want to add this switch to ssh's config file (~/.ssh/config) it's PubkeyAuthentication no in that file. Commented Aug 24, 2012 at 16:17
  • 2
    ssh -o PubkeyAuthentication=no host.example.org worked for me, when ssh from debian to other debian. fyi Commented Oct 27, 2014 at 7:05
  • 14
    Doesn't work for me. I still get Permission denied (publickey). Looks like it's refusing to do anything else on the server end. Commented Jul 27, 2018 at 12:34
0

3rd party platforms such as virtual private server or cloud providers include their own settings in the Linux images provided which override custom SSH changes.

To enable SSH password authentication these changes also need to be made:

in /etc/ssh/ssd_config edit:

#Include /etc/ssh/sdd_confid./*conf 

in /etc/cloud/cloud.cfg edit:

disable_root: false ssh_pwauth: true 

in /etc/cloud/cloud.cfg.d/00_defaults edit:

ssh_pwauth: true 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.