Filezilla/Puttygen doesn't recognize private key file

I have generated a key for an Ubuntu Virtual Machine running on Azure Cloud Services http://www.windowsazure.com/en-us/manage/linux/how-to-guides/ssh-into-linux/

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout myPrivateKey.key -out   myCert.pem

When loading the private key into Filezilla, it asks me to convert the format, however, when converting the key it fails, the same happens with puttygen from linux console, using this:

puttygen myPrivateKey.key -o myKey.ppk

In both cases I have the following error:

puttygen: error loading `myPrivateKey.key': unrecognised key type

By the way, this key doesn't have a passphrase.

I found an old thread about it, but I'm using 0.6.3 version which is newer than what this thread recommends:

http://fixunix.com/ssh/541874-puttygen-unable-import-openssh-key.html

I've managed to solve this issue by using another gui client Fugu for Mac, but one of my co-worker uses windows and I still have to figure this out.

Since Filezilla is the de-facto ftp client, I thought it would be easier to solve it there.

Thanks


Solution 1:

puttygen understands openssh keys, not SSL keys. You need to generate an ssh key pair using ssh-keygen(1), then puttygen will convert the private key into its .ppk format.

Solution 2:

changing the password, as sugggested above, worked for me. I changed the password

ssh-keygen -p -f private_keyfile
then tried again to use puttygen to create a ppk file and it was successful.

puttygen private_keyfile -o private_keyfile_for_putty.ppk

before changing the password I got an error
"puttygen: error loading `rate_notices_key': unrecognised key type"

using puttygen on both windows and my FreeBSD vm. thanks for that, I searched high and low before finding your answer. Sure, I could have just created a new key pair with puttygen, but having used ssh-keygen and submitted the public key to a vendor for an account to access a secure ftp site, I wanted to use the private key I already had.

Solution 3:

Try this ssh-keygen -m PEM -t rsa -b 4096 -C "[email protected]".

this will force to add the header like

-----BEGIN RSA PRIVATE KEY-----

instead of

-----BEGIN OPENSSH PRIVATE KEY-----