IT in Education

Creating an EC2 Key Pair

awsThis important step is required if you are going to run any EC2 instances. Linux EC2 instances will use the Key Pair to define SSH access to your EC2 instance.

AWS Console

Start by logging on with your IAM account, and assume the role of admin.

  1. Go to Services > EC2.
  2. Select Key Pairs from the main screen or the left pane.
  3. Click the Create key pair button.
  4. Enter a Name (e.g. admin).
  5. Select the pem File format (e.g. pem for SSH).
  6. Click Create key pair button to save your key pair.

At this point a .pem file will be downloaded to your computer (e.g. admin.pem). You will need to move thsi file to the correct location on your computer, and modify its permissions, by running the following command:

mv ~/Downloads/admin.pem ~/.ssh/admin.pem
chmod 600 ~/.ssh/admin.pem

Remote access

You can now use this key pair to access an EC2 instance.

  1. Open your preferred Terminal.
  2. Run the following command
ssh -i ~/.ssh/admin.pem This email address is being protected from spambots. You need JavaScript enabled to view it.

Thanks for visiting,