Difference Between .PEM And .PPK: Generate .PPK File For SSH

In this article, I'll describe the difference between .pem and .ppk and how to connect to your EC2 instances from a third-party SSH client (Putty).

What's the difference between .ppk and .pem?

The .pem and .ppk files are similar because they are both private key file formats.

The differences between .pem and .ppk are the following.

System platform compatibility

  • Linux users: .pem file format
  • Mac users: .pem file format
  • Windows PowerShell users: .pem file format
  • Windows PuTTY/Cygwin users: .ppk file format

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 the .pem format. Hence you have to convert it to .ppk format using PuTTyGen.

A lot of open-source software, as well as AWS, generate .pem files for you to use. But if you are using something like PuTTY or WinSCP, you will most likely need to use a .ppk file. Converting .pem files to .ppk is easy using a program called PuTTYgen.

Files created by PuTTYgen are known as PPK files. PPK files are PuTTY Private Key Files developed by Putty and they serve as storage for the private keys the program generated. These files are used to enable communication securely with another party having the corresponding public key.

How to connect to your EC2 instance from Putty?

Prerequisites

  1. Create EC2 instance
  2. Instance should be in running state
  3. User should have a .pem file stored into a machine.
  4. Download Putty ( to connect to your EC2 instance)
  5. Download Puttygen ( to convert .pem to .ppk).

Steps

  • Open Puttygen and load the .pem file.
    Puttygen and load
  • Save it as a Private key and click on Ok
    Save privste key
    Click ok
  • Open a Putty and enter the Host Name or IP address.
    Enter the host name
  • Browse the private key for authenication
    Browse
  • Click on Open
  • Login as a EC2-user
    Login Ec2

Conclusion

In this article, we have learned about the difference between the .pem file and .ppk file and also how to connect to an EC2 instance through Putty.


Similar Articles