Thursday, November 13, 2014

bypassing ssh keys

I have a system that has ssh keys setup, but there's something wrong with them. It tries to use the keys, fails, and doesn't allow a regular login.

The way to get around this is to use the -o option with special keywords to tell it not to use the ssh keys.

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host

The page where I got this hint from is this one:

http://linuxcommando.blogspot.com/2008/10/how-to-disable-ssh-host-key-checking.html

Update 11/17/2018: Looking into this a few months later, I got some oddly different suggestions. These are interesting but strangely they didn't solve my problem at the time. Here they are anyhow in hopes that I was just missing something and they are still useful.

Mainly, I found this suggestion compelling:
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no example.com
From here:https://unix.stackexchange.com/questions/15138/how-to-force-ssh-client-to-use-only-password-auth

From the same page, this suggestion is fascinating, also didn't work in my case. Username, colon, no password:
ssh user:@example.com


Here is a slight variation on the above:
ssh -o PreferredAuthentications=keyboard-interactive,password -o PubkeyAuthentication=no host.example.org
From here:https://serverfault.com/questions/130346/ssh-use-only-my-password-ignore-my-ssh-key-dont-prompt-me-for-a-passphrase