Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was just sent a PEM key from a client as a means to access their Amazon EC2 instance. How do I convert this into something I could use with OpenSSH?

share|improve this question
Does this SO question help? – jw013 Aug 5 '11 at 5:29
up vote 2 down vote accepted

You can extract a PEM public key from an OpenSSH private key using:

openssl rsa -pubout -in .ssh/id_rsa

But OpenSSH has no tools to convert from or too PEM public keys (note: PEM private keys are OpenSSH's native format for protocol 2 keys)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.