Converting between different SSH private/public key formats.
January
12th,
2013
PuTTY –> SSH
- PuTTY private key to SSH public key and private key.
puttygen
supports exporting to an OpenSSH compatible format.- Open PuttyGen
- Click Load
- Load your private key
- Go to
Conversions->Export OpenSSH
and export your private key - Copy your private key to
~/.ssh/id_dsa
(orid_rsa
). - Create the RFC 4716 version of the public key using
ssh-keygen
:
ssh-keygen -e -f ~/.ssh/id_dsa > ~/.ssh/id_dsa_com.pub
- Convert the RFC 4716 version of the public key to the OpenSSH format:
ssh-keygen -i -f ~/.ssh/id_dsa_com.pub > ~/.ssh/id_dsa.pub
- PuTTY public key to SSH public key
If all you have is a public key from a user in PuTTY-style format, you can convert it to standard openssh format like so:
ssh-keygen -i -f keyfile.pub > newkeyfile.pub