Key pairs
Key pairs are used to log in to the EC2 instances. They act like access credentials to EC2 instances. They use public-private keys to encrypt and decrypt the login credentials. While creating EC2 instances, we need to associate key pairs so that the user can use them to log in using SSH.
Store key pairs at a secure location because they act as a password for users to connect to your EC2 instance. If the key pair is lost, we cannot recover it. So, we need to generate another key pair and relaunch the EC2 instance with the new key pair.
AWS Management Console
Go to the AWS EC2 Management Console at https://console.aws.amazon.com/ec2/home.
Creating key pairs
Create a new key pair under your AWS account:
- Click
Key pairs
underNETWORK and SECURITY
in the left menu. - Click
Create Key Pair.
Provide a friendly name in theKey pair name
input field:
Figure 3.1: Creating a key pair
Usually, a key pair name should be able to identify the entity as an application or user, or department/group name...