How to convert rsa key to pem using X.509 standard

I've converted an rsa key to pem using the following command

openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem

However when I try uploading this key to my ubuntu server hosted on Azure I get an error

The certificate is in an invalid format. X.509 standard format in a .cer or .pem file is supported.

What is the correct way of converting an rsa key to pem format?

5

1 Answer

From the Azure site itself:

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

This will convert your private key into a public key that can be used with Azure.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like