Creating an EC2 Key Pair
Start by logging on with your IAM account, and assume the role of admin.
- Go to Services > EC2.
- Select Key Pairs from the main screen or the left pane.
- Click the Create key pair button.
- Enter a Name (e.g. admin).
- Select the pem File format (e.g. pem for SSH).
- 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
You can now use this key pair to access an EC2 instance.
- Open your preferred Terminal.
- Run the following command
Thanks for visiting.