Convert Your AWS SSH Private Key Into Public Key

Today I will show you, how can you get SSH private key from AWS console and convert that key into public key. So, that you can use that key for create a SSH user.

So, First lets with downloading a key from AWS Console.

To create your key pair. Please follow the below steps:

  • Open the Amazon EC2 console at

  • In the navigation pane, choose Key Pairs.

    key pairs main page

  • Choose Create key pair.

    choose key pair

  • For Name, enter a descriptive name for the key pair.

  • For File format, choose the format in which to save the private key. To save the private key in a format that can be used with OpenSHH, choose pem. To save the private key in a format that can be used with PuTTY, choose ppk.

  • Choose Create key pair.

    create and download key pair

Now you have created a private key. Lets convert it into public keys.

To convert downloaded private key into public key. We can either use puttygen (Putty SSH key generation utility) or you can use linux command to convert it.

Method 1:

So, First let show you how can you convert private key into public key using putty.

  • First open puttygen. If you don't have puttygen, you can download it from this link.

  • Before uploading the key, change the parameter as per AWS recommendation.

change parameter for key

  • Upload your private key using load button.

load key

  • Now, You can either copy and paste the key from the top or you can download it using Save public key button.

public key

Method 2:

In method 2, We will use Linux command to convert the private key into public key.

  • Open Linux terminal.

  • Paste the below command, change the key-name and path.

1ssh-keygen -y -f /path_of_key_pair/key-pair.pem

convert using ssh-keygen

Note: If you are using AWS EC2 or any other cloud server, Please first upload you .pem key into the server.

Now you can use this public key and private key.

You can also checkout this article to generate key using ssh-keygen command.

I :heart: AWS! :smile: Enjoy