[issue] cannot import/convert openssh key to putty.ppk key

Advertisement

max123kl
Joined:
Posts:
3
Location:
germany

[issue] cannot import/convert openssh key to putty.ppk key

Hello,
I try to import a ssh key, generated on a debian machine with:
ssh-keygen -t rsa -b 4096
I copied the private key file to a win7 machine.
At command prompt as administrator I run:
winscp.com /keygen <path to key file>\id_rsa /output <path to new file>\id_rsa.ppk
I got the error message that says:
Private key file does not exist or cannot be opened. Error Code 2. System cannot find the named file.
I also have tried to to import the key file with the PuttyGen GUI, same result, but error message is different.
Couldn't load private key (unrecognised cipher name)
My openssh private key file is:
-----BEGIN OPENSSH PRIVATE KEY-----
b3Blb...
...2cWg==
-----END OPENSSH PRIVATE KEY-----
No encryption line can be seen as in privat key file created by PuttyGen.
Is it possible to tell WinSCP or PuttyGen which encription to use?
Or how to modify the ssh-keygen command on Debian.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: [issue] cannot import/convert openssh key to putty.ppk key

I can convert a key generated with ssh-keygen -t rsa -b 4096 without any problem. I can also load it to PuTTYgen. Tested with ssh-keygen from OpenSSH 7.7 and 5.3.

What version of OpenSSH are you using? Can you generate a test key and post it here?

Reply with quote

max123kl
Joined:
Posts:
3
Location:
germany

Re: [issue] cannot import/convert openssh key to putty.ppk key

martin wrote:

I can convert a key generated with ssh-keygen -t rsa -b 4096 without any problem. I can also load it to PuTTYgen. Tested with ssh-keygen from OpenSSH 7.7 and 5.3.

What version of OpenSSH are you using? Can you generate a test key and post it here?
I'm running debian/testing (buster) to create the keys. The installed openssh packages are:
~# apt list openssh* | grep installed
openssh-client/testing,now 1:7.8p1-1 amd64 [installed]
openssh-server/testing,now 1:7.8p1-1 amd64 [installed,automatic]
openssh-sftp-server/testing,now 1:7.8p1-1 amd64 [installed,automatic]
I generated a new test-rsa key without password and tried to import it to PuTTY and it worked!
So, in the next step, I had generated a new tst_with_PW key (PW=password) and tried to import it to PuTTY without success!
So my conclusion is, a given password does not work!

Both files are uploaded at <invalid hyperlink removed by admin> and <invalid hyperlink removed by admin>

I also generated these two keys with an older Debian/Jessie installation with the same result!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: [issue] cannot import/convert openssh key to putty.ppk key

Thanks. It's actually not the encryption itself. WinSCP and PuTTYgen can handle both. But it's a new encryption algorithm used by OpenSSH 7.6 and newer.

This issue has been added to the tracker:
https://winscp.net/tracker/1692

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.

Reply with quote

Advertisement

You can post new topics in this forum