How to Create KeyPair for EC2 on Amazon Web Service(AWS).

A key pair, consisting of a private key and a public key, is a set of security credentials that you use to prove your identity when connecting to an instance. Amazon EC2 stores the public key, and you store the private key. You use the private key, instead of a password, to securely access your instances.

PEM (Privacy Enhanced Mail) is a base64 container format for encoding keys and certificates. . pem download from AWS when you created your key-pair. This is only a one time download and you cannot download it again.

PPK(Putty Private Key) is a windows ssh client, it does not support . pem format.

 

  • Login to aws portal.
  • Click on Services.

 

Fig 1

 

  • Under Compute select EC2.

 

Fig 2

 

  • Click on KeyPairs.

 

Fig. 3

 

  • Click on Create Keypair.

 

Fig. 4

 

  • Provide Keypair name.
  • Select file format like : pem or ppk.
  • PEM file use with SSH or PPK use with Putty.
  • Click on Add tag.

 

Fig. 5

 

  • Provide key name & value for key pair.
  • Then click on create key pair.

 

Fig. 5

 

  • After sometime key pair is ready.

 

Fig. 6

 

 

Create KeyPair using Shell

 

aws ec2 create-key-pair –key-name keypair_name

Leave a Reply