Whats the difference between .ppk and .pem . Where .pem is stored in amazons ec2 cluster?

46.7k views Asked by At

I am using Amazon's EC2 cluster for running GraphLab. They want the location of my .pem file, which is my private key.

After searching I still I could not find the file in ubuntu. I am using PuTTY.

2

There are 2 answers

3
slayedbylucifer On

.pem file is what you have download from AWS when you created your key-pair. This is only a one time download and you cannot download it again.

Your software is asking for .pem file. Now you are the one who needs to locate that file. You might have downloaded it on you laptop/desktop...etc.

As I said above, .pem is not saved anywhere on EC2. It is a one time download and you have to keep it safe.

For Putty (windows ssh client), it does not support .pem format. Hence you have to convert it to .ppk format using PuTTyGen. It's essentially .pem but in a different format so that Putty can work with it.

1
Abel Callejo On

You have two questions here. I know I am late on answering this but I'll proceed anyway.

Question #1

Whats the difference between .ppk and .pem?

The .pem and .ppk files are similar because they are both private key file formats. The .pub file counterpart is the public key file format -- but that is a different story.

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

  1. System/platform compatibility

    .pem is kind of the de facto standard

    • Linux BASH users — .pem file format
    • Mac BASH users — .pem file format
    • Windows/Linux/Mac PowerShell users — .pem file format
    • Windows PuTTY/Cygwin users — .ppk file format
  2. File contents

    .pem

    -----BEGIN RSA PRIVATE KEY-----
    MIIEowIBAAKCAQEAxZls7NgRS5rtDH+mCgEeqSO12BiPAY2dhZZbTkPEoDUVqG46
    PHGIBBERISHFKS3xE4eMMY+uWPriviY0W12EFqYBUJDq6GmGSQPMSI8Kep7OgVGK
    d2t3/Lq+I8ZqlFwAgPwS7n18mlgTV/YyA0HCCIa+kZGKqbsuylfsODUAJGQqOtUM
    FKX4+O45RrJwcQGI2M+pbD4+Ow28iEsNP3flQKvamNuezm2VallhGiO/E39UITrB
    27FWM1pLQo5etyE378h5q8BKMGKt1ZPxPhjiNjBefGZ1Dscw7CA5
    -----END RSA PRIVATE KEY-----
    

    .ppk

    PuTTY-User-Key-File-2: ssh-rsa
    Encryption: none
    Comment: imported-openssh-key
    Public-Lines: 3
    AAAAB3NzaC1yc2EAAAADAQABAAABAQDFmWzs2BFLmu0Mf6YKAR6pI7XYGI8BjZ2F
    llGIBBERISHobjo8c6DjH6iBW0UpLfETh4wxj65Y+uK+JjRbXYQWpgFQkOroaYZJ
    1DxehJUvZpuZqLSUGvZrUzbYmx25oVE5+x6UBSA0NUiTpq6jWFPH
    Private-Lines: 3
    AAABAFLQsak2CVGhldYWLbWlsH78+3qdGFpzSuCxGoVbu63VccVMpVWutHBcVVgZ
    s4GIBBERISHcVhru01cUVf8w22pOmuB0TC+qAmDZmaWTZbXslun2Dc1tGjWu4n/F
    S0KOXrchN+/IeavASjBirdWT8T4Y4jYwXnxmdQ7HMOwgOQ==
    Private-MAC: 5fGIBBERISHda60d2e8b049e655e4a8a78bb18dc
    

Question #2

Where .pem is stored in amazons ec2 cluster?

In AWS, the .pem files are not directly stored to a single machine.

You can get the .pem file either by:

  1. Starting a new instance

    When you create an EC2 instance, you will be given a default .pem file where you can use to access the new instance.

  2. Creating a new .pem file through IAM