SSH asking for passphrase when none used

0

I am trying to ssh into a server from cygwin on Windows 7. I created public/private keys using ssh-keygen, and didn't add a passphrase. I then added them to the authorized_keys on the server. When I try to ssh, I get asked for a passphrase.

I used ssh -vvv, and I can see that the public key is accepted, and that my "empty" passphrase file doesn't work.

I also don't have any problems logging in when I ssh from my Ubuntu machine.

Finally, just for the sake of completeness, I tried making a new key pair, and adding a passphrase. When I get asked for it, it also fails to decrypt my private key.

Has anyone encountered something similar? Know what to do?

Eyal

Posted 2015-08-18T07:10:10.703

Reputation: 198

Please edit the question to include the exact ssh command that you're running and the output of ssh -vvv. You can obscure the remote user/hostname if you like. – Kenster – 2015-08-19T15:05:22.020

Answers

1

It turns out to be, as often is the case, something remarkably stupid. I manually added the name of my key file in my config file, and gave the public key - like this.

Host server
    HostName server.address
    User myuser
    IdentityFile ~/.ssh/id_rsa.pub

Instead of

IdentityFile ~/.ssh/id_rsa

Which, of course, works. (I know this line isn't necessary, because it's the default key name - I had been using a different key name)

Eyal

Posted 2015-08-18T07:10:10.703

Reputation: 198