If I understand you correctly, you didn't use puttygen
to create a keypair, instead, you used ssh-keygen
to generate a keypair with passphrase, then you loaded that private key into Putty and saved it as Putty.ppk
and got the error Couldn't load Private Key (cannot open file)
.
What format was the private key (id_rsa
) you created in?
If you open it in a text file is the first like similar to this:
-----BEGIN RSA PRIVATE KEY-----
or does it look like this:
ssh-rsa AWEdxRASFLMAF......
This appears to be, likely, an issue with you loading the public key instead of the private key to save as a .ppk
. The screenshot you show has 2 files: id_rsa
and id_rsa
, but one of them is the private key file and the other is the public key. It's probable that you selected the public key if no file extensions were shown. Try re-importing the key by selecting the id_rsa
file with the timestamp of 05-03-2018 12:36
in your screenshot above.
Verify the first line in that file is
-----BEGIN RSA PRIVATE KEY-----
before you do.
Best Answer
openssh
andPuTTY
are using different key types (but you can convert between them). In PuTTYgen you need to go toConversions->Export OpenSSH
, export your private key and store it asid_rsa
.More on SO.