1

I am just trying to do a simple ssh into a VPS using the terminal. It asks for me to enter my passphrase three times then says "permission denied (public key)."

I've tried:

ssh -i [key location] user@xxx.xxx.xxx

I'm able to SFTP into the server in Cyberduck, and have also tried their 'Open in Terminal' command, which again just asks me for the passphrase three times then says permission denied.

I am able to connect using PuTTY in Windows, WinSCP and Cyberduck, so I am pretty sure I have the right key and passphrase. What am I missing here? I have a feeling it's something stupid, but I just can't figure it out.

3

PuTTY is using different key format than the OpenSSH and OpenSSH is failing to report correctly the errors about unknown format in some versions.

If you want to use the PuTTY key in OpenSSH, you need to convert the private key to OpenSSH format in PuTTYGen (as described on SO):

  • Open PuttyGen
  • Click Load
  • Load your private key
  • Go to Conversions->Export OpenSSH and export your private key
  • Copy your private key to ~/.ssh/id_rsa
  • Thank you, that did the trick. I'm finally able to get into my server from my MacBook after converting the key. – user3485269 Jun 15 '17 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .