Thu. Sep 23rd, 2021
puttykeygen Main Screen

In AWS, if you launch any EC2 Linux example, you need to choose a key pair for that exact example.

AWS key pair will likely be in the usual exclusive key format with .pem file extension

However in case you are utilizing PuTTY in your Home windows laptop computer to login to AWS example, you might have an issue.

PuTTY doesn’t assist PEM format. PuTTY understands solely it’s personal PPK format.

PPK stands for Putty Non-public Key.

So, you need to convert your .pem file to .ppk file.

For this conversion, putty supplies a instrument referred to as PuTTYgen.

1. Obtain AWS PEM file

In AWS, if you first create a key pair file, that you simply need to use to your EC2 cases, AWS will assist you to obtain the PEM file to your native machine. Save this PEM file someplace in your machine.

On this instance, the .pem file I’ve is named thegeekstuff.pem, which is underneath C drive.

We’ll be changing this thegeekstuff.pem file to thegeekstuff.ppk and use the .ppk to login to EC2 example utilizing PuTTY.

BTW, the steps to transform pem to ppk for putty is strictly the identical for all of the Linux AMI photographs, together with CentOS, RedHat, Ubuntu, SuSE, Fedora, Amazon Linux, and many others.

2. Obtain PuTTYGen

Obtain PuTTYgen from right here.

In the event you’ve used the PuTTY MSI installer, then all of the PuTTY utilities comes with it together with puttygen.

See also  Devour Net API By MVC In .NET Core (1), Server And Framework

In case you are already utilizing solely putty.exe as a standalone, then it’s also possible to obtain the standalone puttygen.exe

Launch PuTTYgen by double clicking on it.

PuTTYGen is a RSA and DSA key technology utility. However, in our case, we’ll be utilizing this to transform the pem to ppk file.

The principle PuTTYGen display can have the next three sections:

Key Part: It will show the present key that’s loaded. i.e The important thing that you’re at the moment engaged on. Whenever you first launch the puttygen, this part will say “No Key”.

Actions Part: This part will show all of the potential actions that you would be able to carry out inside PuTTYGen. The next are the out there actions:

  1. Generate – It will allow you to generate a model new public/exclusive key pair
  2. Load – If you have already got an present exclusive key, you should use that by loading it right here
  3. Save – When you’ve generated a brand new key, or loaded an present key, it can save you both the public-key or the private-key to your native machine. Initially the save buttons will likely be disabled, as we’ve got not loaded a key but.

Parameters Part: Right here you’ll specify the kind of key to generate. You have got three choices right here: SSH-1 (RSA), SSH-2 (RSA), SSH-2 DSA. You may as well set the worth of variety of bits for the generated key. By default the kind will likely be SSH-2 (RSA) and 2048-bit.

For our goal of changing PEM to PPK, depart all of the parameters at their default worth. i.e SSH-2 (RSA) and 2048 bit.

See additionally: 10 Superior PuTTY Suggestions and Tips You Most likely Didn’t Know

See also  Learn how to Promote Your "Minecraft" Server and Get Extra Gamers

3. Load PEM file to PuTTYGen for Conversion

Within the following PuTTYGen most important display, click on on “Load” button, and choose your AWS PEM file.

puttykeygen Main Screen

Please be aware that if you click on on “Load”, within the file choice window, by default, it’s going to present “PuTTY Private Key Files (*.ppk)” as the choice. Click on on this drop-down listing and select “All Files” as proven beneath. After this, you possibly can browser to the listing the place you *.pem file is positioned, and cargo it.

Puttykeygen Select All File

As soon as the *.pem file is loaded, you’ll get a pop-up message saying “Successfully imported foreign key (OpenSSH SSH-2 private key)”. Click on on “OK” on this display.

4. Save your Transformed PPK Non-public Key

Now that we’ve got the keys loaded, you’ll see within the prime “Key” part, our key data will likely be displayed. It will show the important thing fingerprint, key remark. The important thing passphrase on this case will likely be empty, as we didn’t have any passphrase for our AWS PEM file on this instance.

Additionally, within the motion part, we’ll see the save button enabled.

Click on on the “Save Private Key” button, to save lots of our transformed ppk exclusive key.

PuTTYKeyGen Save Private Key

It will show a warning message saying: “Are you sure you want to save this key without a passphrase to protect it?”. Click on on “YES”.

Now, give a reputation to this file. In our case, I’ve named this transformed file as thegeekstuff.ppk

5. Use the PPK File in PuTTY

Now, that we’ve got the thegeekstuff.pem AWS PEM file transformed to thegeekstuff.ppk PuTTY key file, we are able to use this to login to our AWS EC2 example.

See also  When to Improve Your Internet hosting Plan

For this, launch the putty, and do the next:

First, within the “Host Name (or IP address)” discipline, enter the public-dns or ip of your AWS EC2 example.

Second, within the “Saved Sessions” discipline, enter the title that you simply wish to give for this AWS-EC2-instance in your putty, and click on on “Save” to save lots of this periods in your putty listing.

PuTTY Save Session Name

Third, on the left-hand aspect panel, develop the “Connections” -> develop “SSH” -> choose “Auth”. Click on on “Browse”, and choose your transformed ppk file for the “Private key file for authentication” as proven beneath.

PuTTY Select SSH Auth Key File

Fourth, at this stage you possibly can click on on “Open” to begin the connection, however you’ll lose the values that you simply simply entered. So, on the left-panel click on on “Sessions” once more, and click on on “Save” once more. It will save the details about the exclusive key that you simply offered to the putty-session that you simply saved earlier.

6. PEM and PPK File Codecs

When you’ve transformed the file, you possibly can view the content material of PEM and PPK file in a textual content editor, and also you’ll see that the content material seems completely different, as they’re of various codecs.

PEM Key File from Aamazon EC2 (e.g: thegeekstuff.pem)


The PPK file format (e.g: thegeekstuff.pem). That is the file that we transformed utilizing PuTTYGen instrument. That is the keyfile format that can work in your PuTTY to login to your Amazon AWS EC2 Linux example utilizing SSH protocol as proven above.

PuTTY-Consumer-Key-File-2: ssh-rsa
Encryption: none
Remark: imported-openssh-key
Public-Strains: 6
Non-public-Strains: 14
Non-public-MAC: 0827d5872ec564e75b370bc3eb6ddcc

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *