How to convert Linux Openssh key to Putty format?

Install putty-tools:

sudo apt-get install putty-tools

Then:

cd ~/.ssh/

puttygen id_rsa -o id_rsa.ppk

 

If we would like to convert the Putty format key to Openssh key:

  • To generate the private key follow this command:
puttygen id_dsa.ppk -O private-openssh -o id_dsa
  • To generate public key follow this command:
puttygen id_dsa.ppk -O public-openssh -o id_dsa.pub 

 

Be sure that the permissions are set correctly for private and public key:

chmod 600 id_dsa
chmod 666 id_dsa.pub