3

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.

6
  • Why not just create a new OpenSSH key private key? Commented Feb 25, 2016 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. Commented Feb 25, 2016 at 17:47
  • But what does the self-signed certificate and its key have to do with SSH?
    – muru
    Commented Feb 25, 2016 at 17:50
  • Are you using certificate-based SSH authentication? (As described in the CERTIFICATES section of the ssh-keygen(1) manpage.) Commented Feb 25, 2016 at 17:51
  • Have a look at ssh-keygen's -i and -m options, anyway.
    – muru
    Commented Feb 25, 2016 at 17:52

1 Answer 1

1

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$ 
1
  • 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. Commented Feb 25, 2016 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .