87

I wanted to connect to my Unix server using SSH keys. For that I had converted my id_rsa file from ./ssh directory to a ppk file using PuTTYgen, but after loading my .ppk key I get this warning:

PuTTY key format too new

enter image description here

If I use my default id_rsa file, then I get error:

OpenSSH SSH-2 private key (old PEM format)

Either way I am getting stuck. Can anyone please help me?

8 Answers8

111

Easy way to fix this issue, please follow the pictures.
Step1:
enter image description here Step2:
enter image description here

willie
  • 1,248
44

If you have a key in the new PPK version 3 format, you can use PuTTYgen to export it to the old PPK version 2 format.

I don't know what Operating System you're using PuTTYgen/PuTTY on, but if it's Microsoft Windows you can set PPK Version 2 by default for PuTTYgen selecting in the app menu:

Key->Parameters for saving key files... ->PPK file version: 2

PuTTYgen: Private Key File Parameters

9

You have probably used a newer version of PuTTYgen than the version of PuTTY.

There's new PPK format since PuTTY 0.75 (released 2021-05-09). So I guess you have used PuTTYgen 0.75 (or newer) to convert your key. But you are trying to use it in an older version of PuTTY.


If you are stuck with old version of PuTTU, the new PuTTYgen can generate even the old format: Go to Key > Parameters for saving key files > PPK file version.

3

I've put newer version of puttygen.exe and pageant.exe in TortoiseGit\bin folder and it works

3

Install the Latest version of putty at least 0.75 it will work fine

2

You can convert the openssh key to version 2 or 3 with the "puttygen" utility. Example:

puttygen id_rsa --ppk-param version=2 -o id_rsa.ppk 

to convert the openssh id_rsa identity file to a version 2 ppk file. Version 3 is currently the newest version of the ppk format at the time of this answer.

You can install puttygen natively on Linux, using a Homebrew or MacPort port on macOS(what I did), or on Windows, use the puttygen docker container at https://hub.docker.com/r/zinuzoid/puttygen. The Mac and Linux syntax's are identical.

The Windows(docker) example syntax looks like this:

docker run --rm -v $(pwd):/app zinuzoid/puttygen id_rsa -O private-openssh --ppk-param version=2 -o id_rsa.ppk
majorgear
  • 131
1

Had a similar issue,

  • key generated with PuTTYgen 0.75
  • works fine with PuTTY 0.75
  • fails with tortoiseGit 2.12.0.0 (format too new)

After reading answer by @martinprikryl

  • changed in TortoiseGit->Settings->Network->SSH client to PuTTY's plink - and it works again
noytzach
  • 19
  • 1
0

If you don't want to or you can't upgrade due to security policies on your computer, you can download the binary for the newer puttygen.exe, run the binary and load your .ppk file. Once loaded, go into "Conversions" and select "Export OpenSSH key" and save as a .pem extension.

Next, using the older puttygen, go into "Conversions" and import the .pem file you generated. Once loaded, "Save private key" to a new .ppk file.

At this point you should be able to use the older putty.exe file to connect to your host with the .ppk file that you saved.

You can verify, assuming you have the .pub file, by saving the file as a new public key and compare the signatures between the 2 .pub files. The public key signatures, from my experience are the same.

Or as some has already stated, load your .ppk file, go into: Key -> "Parameters for saving keys files ..." and select PPK file version 2 and "Save private key".

Yaway
  • 11