OpenSSH SSH-2 private key (old PEM format)

Taken from here: https://stackoverflow.com/questions/60884217/openssh-ssh-2-private-key-old-pem-format-on-azure-linux-vm

You’ve used ssh-keygen to create a private key file called id_rsa.ppk. However this is an OpenSSH-format private key and needs to be converted to Putty’s own format to use in Putty.

Your options are:

  1. Use this key with command-line SSH (it’s in the correct format). You can either
    1. specify the file on the command line e.g. ssh -i id_rsa.ppk azureuser@vm
    2. make a folder C:\Users\Aquib\.ssh and move it there as C:\Users\Aquib\.ssh\id_rsa (no extension): ssh will now load this file by default to use for all servers that you try to connect to
    3. if you don’t want to use this for all servers, or e.g. if you already have a default id_rsa that you use with git, you can set up a C:\Users\Aquib\.ssh\config file that tells SSH where to find the key and tell it which servers it should use it for.
  2. Convert this file into the right format to use with Putty:
    1. In Puttygen, in the ‘Conversions’ menu choose ‘Import’ and load id_rsa.ppk
    2. ‘Save private key’ to a different file
    3. Use this new file with Putty, either on the connection properties menu or run Pageant (the Putty key agent) and ‘Add key’ the new file. (You can e.g. create a shortcut to pageant in your Startup menu and give it the key file name as a commandline parameter so this is loaded automatically for you.)

Leave a Reply