Link: Convert keys between GnuPG, OpenSsh and OpenSSL

From Convert keys between GnuPG, OpenSsh and OpenSSL:

OpenSSL to OpenSSH

Private keys format is same between OpenSSL and OpenSSH. So you just a have to rename your OpenSSL key:

  cp myid.key id_rsa

In OpenSSL, there is no specific file for public key (public keys are generally embeded in certificates). However, you extract public key from private key file:

  ssh-keygen -y -f  myid.key > id_rsa.pub

[Update] Also converting from OpenSSH private key to .pem in X.509 format, which is a format required by Microsoft Azure VMs:

  openssl req -x509 -key ~/.ssh/id_rsa -nodes -days 365 -newkey rsa:2048 -out myCert.pem

Contents on this site are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Creative Commons License