I have created an open-ssl private key which I would like to use to connect to my server through ssh. The openssl key was generated during certificate creation and I have to use this key on putty. The problem is that puttygen only allows openssh type keys to be converted to putty keys. How do I convert my open-ssl private key to openssh private key so I can convert it to putty key? The length of the private key is 2048 bits.

  • Why not just create a new OpenSSH key private key? – Stephen Kitt Feb 25 '16 at 17:46
  • Because I had to use openssl to create a self signed certificate which the server requires. In this process was the private key also generated. – The amateur programmer Feb 25 '16 at 17:47
  • But what does the self-signed certificate and its key have to do with SSH? – muru Feb 25 '16 at 17:50
  • Are you using certificate-based SSH authentication? (As described in the CERTIFICATES section of the ssh-keygen(1) manpage.) – Stephen Kitt Feb 25 '16 at 17:51
  • Have a look at ssh-keygen's -i and -m options, anyway. – muru Feb 25 '16 at 17:52

The RSA key formats look mighty similar to me.

bash-4.1$ openssl genrsa 4096 > whoble
...
bash-4.1$ ssh-keygen -t rsa -N '' -f bobble
...
bash-4.1$ head -c 123 whoble ; echo
-----BEGIN RSA PRIVATE KEY-----
MIIJJwIBAAKCAgEAw22KzezlaVt6/lAkuTeLNVyrPIK8rjMchGPmUBp6Gx1Bkcjk
zjoWNNH1d0gxVd0Yw2RmpJVVnH
bash-4.1$ head -c 123 bobble ; echo
-----BEGIN RSA PRIVATE KEY-----
MIIEoQIBAAKCAQEA1tUSesz83DwMiQj6aWDMRd/5DISMBnp9jXZVzWwmD61FqlO/
ZhbmdBFMvNUIZNcHVQjqL/Gso0
bash-4.1$ 
  • They are not similar enought for puttygen to convert a key for use with putty. I have tried, but it tells me it doesn't recognize the format. Keys generated with ssh-keygen convert fine with puttygen. – The amateur programmer Feb 25 '16 at 18:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.