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.
1 Answer
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$
-
1They 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
CERTIFICATES
section of thessh-keygen(1)
manpage.)ssh-keygen
's-i
and-m
options, anyway.