Today I generated SSH-2 RSA key pairs using PuttyGen under Windows. It is a handy utility for creating RSA/DSA public/private keys for authentication. These key files can’t be used in Linux directly. I will try to explain how to convert Putty’s private key (.ppk) to Linux OpenSSH format.
- Open PuttyGen
- Click Load
- Load your private key (.ppk)
- Go to Conversions->Export OpenSSH and export your private key
- Copy your private key to ~/.ssh/id_rsa
- Next step is to convert your public key from SSH2 format to OpenSSH using:
ssh-keygen -i -f ~/rsa_ssh2.pub > ~/.ssh/id_rsa.pub
And of course you need to set the right permission to your private key file (chmod 600). Now you should be able to log into an SSH server using your private key. To install your public key simply copy from ~/.ssh/id_rsa.pub on your local machine to ~/.ssh/authorized_keys on the remote server.