Cyberithub

How to Create Key Pairs Using AWS Management Console

Advertisements

In this article, we will see how to create key pairs using AWS Management Console but before that let's try to understand why we need to create key pairs. If you are creating an AWS EC2 instance then you will get an option to either create a new key pair or specify an existing one to connect to the instance through SSH protocol. This key pair is basically a combination of public and private key where public key will be generated and stored in your EC2 instance and private key will get downloaded and stored locally in your system so that whenever you needed to connect the instance you can use that private key.

Not just you but anyone who needed to securely connect to that instance has to use that private key that corresponds to the public key stored in the ~/.ssh/authorized_keys path then only connection to the instance will be successful. Any attempt to use some other private key for authentication will result in unsuccessful connection. Hence before creating an EC2 instance, it is mandatory to create a key pair in case you don't have it. You can follow below simple steps to create a key pair.

 

How to Create Key Pairs Using AWS Management Console

How to Create Key Pairs Using AWS Management Console

Also Read: How to Create an EC2 Instance Using Lambda Function in AWS

Step 1: Prerequisites

a) You should have a valid AWS Account.

b) You should have sufficient IAM access to create resources in your account.

 

Step 2: Login to AWS Management Console

Open AWS Management Console Login In page by visiting URL https://aws.amazon.com/console/ in your favorite browser and sign in with your valid AWS Credentials.

 

Step 3: Go to EC2 Dashboard

Once logged in, you will need to open EC2 Dashboard by searching EC2 service in the search box as shown below. Once it shows up, tap on it to open.

How to Create Key Pairs Using AWS Management Console 2

 

Step 4: Open Key Pairs

On EC2 Dashboard, you need to scroll down to Network & Security and click on Key Pairs option as highlighted below.

How to Create Key Pairs Using AWS Management Console 3

 

Step 5: Create a Key Pair

You will see key pairs section will open where you need to click on Create key pair to create a public and private key.

How to Create Key Pairs Using AWS Management Console 4

Under Create key pair, you need to provide the key pair name, select the key pair type and finally select the private key file format. In our case, we are selecting Key pair type as RSA and Private key file format as .ppk as shown below. You can also select any other available key format depending on your requirement. Once done, click on Create.

NOTE:

Please note that you can save the private key as .ppk file if you need to connect EC2 instance from a Windows based OS. But if you are planning to connect the instance from any Linux/Unix based machines then you need to save the private key as .pem file.

How to Create Key Pairs Using AWS Management Console 5

It should successfully create the key pair as shown below.

How to Create Key Pairs Using AWS Management Console 6

And now you should be able to download the Private key in your local machine as shown below.

How to Create Key Pairs Using AWS Management Console 7

Leave a Comment