How to get a .pem file from ssh key pair?

According to this, this command can be used:

ssh-keygen -f id_rsa -e -m pem

This will convert your public key to an OpenSSL compatible format.
Your private key is already in PEM format and can be used as is (as Michael Hampton stated).

Double check if AWS isn’t asking for a (X.509) certificate in PEM format, which would
be a different thing than your SSH keys.

Leave a Comment