Introduction
This guide will take you through the steps to create a new Key and then add it to your EC2 instance. There are 3 main steps.
- Create a new Key Pair in AWS
- Generate the Public Key from the Key Pair
- Adding the Public key to your EC2 authorized_keys file
If in doubt on step 3 ask someone who is more experienced or technically advanced to perform it. Steps 1 and 2 can be done without any risks.
Step 1: Create a new Key Pair
1. Go to AWS Management Console
2. Click on EC2
- While Keys are a security function you’ll find them under EC2 and not IAM options, this is due to their usage on instances rather than users.
3. Click on Key Pairs
- This is on the left hand menu, you might need to scroll down to see the option.
![image12](https://assets.allcode.com/wp-content/uploads/2022/06/image12.png)
4. Give the Key a descriptive name “name-of-the-key”
- If you’re working with Allcode on building a cloud service perhaps allcode-dev-key for example.
![image13](https://assets.allcode.com/wp-content/uploads/2022/06/image13-1.png)
5. Click on Create key pair
- The key will be automatically downloaded to your computer.
- Keep this key safe, this is the only time it can be downloaded
![image11](https://assets.allcode.com/wp-content/uploads/2022/06/image11-1.png)
Step 2: Generate the Public Key from the Private Key
Jake is a writer and marketing associate for AllCode with a wealth of experience in a variety of industries.