A key pair, consisting of a public key and a private key, is a set of security credentials that you use to prove your identity when connecting to an Amazon EC2 instance. Amazon EC2 stores the public key on your instance, and you store the private key. For Linux instances, the private key allows you to securely SSH into your instance. As an alternative to key pairs, you can use AWS Systems Manager Session Manager to connect to your instance with an interactive one-click browser-based shell or the AWS Command Line Interface (AWS CLI).
Reference documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html
Prerequisite: Having a valid AWS Account (Follow the step in this link to create an AWS Account) How to Sign Up for a new Amazon Web Services Account
Open the page: https://aws.amazon.com/account/
Type EC2 in the search box and select EC2
In the menu under Network and Security select Key Pairs
Enter the name of the Key Pair
Choose your Key pair type / your Private key file format (.pem for OpenSSH and .ppk for PuTTY)
Click on Create key pair
Confirm your key pair was successfully created and private key downloaded on your computer
Public key is used for the EC2 instance and private key for the SSH client (PuTTY SSH Client)
Credit: Azeez
Leave a Reply