SSH: I have a *.pem private key. How to create a SSH connection using it

puttyssh

I tried to use putty also. I select this pem key there and got this:

Unable to use key file "key.pem" (not a private key).

I read that it is possible to convert a pem to a pub key. I did it like there:

  1. Convert pem key to ssh-rsa format

  2. How can I convert a PEM key into a RSA key pair?

But I got the same error when trying to connect.

Best Answer

(Partial answer but too many links for reasonable comment.)

putty doesn't use PEM format (like OpenSSL and OpenSSH), instead its own format PPK. Run puttygen and it can Load (or Import) private-key from PEM and Save to PPK. Partial dupe of:

Can I use an SSH key generated on Linux from Putty?

What difference between openssh key and putty key?

Convert Amazon .pem key to Putty .ppk key Linux

https://stackoverflow.com/questions/3190667/convert-pem-to-ppk-file-format

Related Question