Monday, April 4, 2016

AWS pem file to quickly connect to an Amazon AMI


  • Use the below steps to decrease the memorization of where your pem files are

  • Use the below steps to store the pem files into your profile so you can directly connect to ssh without the "-i [thefilename.pem]




Step 1: change the file permission of the file so that you can include it automatically.

chmod 400 [thefilename.pem]


Step 2: copy the file to the ssh directory so it can be searched via the handshake verses key stroke

cp [thefilename.pem] ~/.ssh/


Step 3: now add it to your keyring

ssh-add ~/.ssh/[thefilename.pem]

Finally you can connect by using the following command:

ssh [ip_address_or_FQD_hostname] -lec2-user


Enjoy