Last Updated: February 25, 2016
· ftsanjuan

Retrieving ssh public key from a .pem file

If you've ever needed to retrieve the public key from a .pem private key file (like you might get from EC2), you could try this:

ssh-keygen -y -f key.pem >

key.pem is the path to your .pem file (your private key) and is the path you want to write the public key to.