×
☰ See All Chapters

AWS EC2 Key Pairs

Logging in to your virtual machine (we study virtual machines and EC2 instances in following chapters) requires a key. You use a key instead of a password to authenticate yourself. Keys are much more secure than passwords, and using keys for SSH is enforced for VMs running Linux on AWS. Generating keys is essential before creating virtual machines.  Key pairs use public-private keys to encrypt and decrypt the login credentials. 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.

Follow below steps to create key pairs:

Step 1:

Open AWS Console (https://console.aws.amazon.com) from your browser, Click All Services to expand the displayed links, and click the EC2 option.

amazon-ec2-key-pairs-0
 
amazon-ec2-key-pairs-1
 

Now under resources click on “Key Pairs”.

amazon-ec2-key-pairs-2
 

Step 2:

Click Create Key Pair.

amazon-ec2-key-pairs-3
 

Enter mykey for Key Pair Name, and click Create. Your browser downloads the key automatically.

amazon-ec2-key-pairs-4
 

Now you see the success message as shown below:

amazon-ec2-key-pairs-5
 

All Chapters
Author