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] [email protected]

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.

1 Answer 1


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. Commented Jun 15, 2017 at 1:43

You must log in to answer this question.

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