Ssh – How to use PEM keys from EC2

amazon-web-servicessshssh-keys

I understand the concept of "ssh keys" to login to a server without entering a password, however, I am not understanding how/what PEM key files are to log in to EC2 instances.

In the AWS console, I can generate or import a PEM key, but where/how do I use this file on my laptop to login to cloud instances?

Thanks for help!

Best Answer

Or you can create an entry on your .ssh/config as follows:

host myserver
hostname ec2-xx-xx-xx-xx.eu-west-1.compute.amazonaws.com
user username
IdentityFile path/to/your.pem

So after that you can ssh to your server like this: ssh myserver

According to PEM files, it's also good keep a copy in a safe place as it can not be regenerated.

Related Topic