Puttygen generate pem

A few weeks ago I was working on a project in which the existing developers had setup access to their AWS EC2 instances using putty as their ssh client due to them running on Windows 7. They provided the putty private key file they setup but that didn’t do me any good because I was running OS X. Here is a list of steps I took to convert that PPK file to a PEM file that I could use to SSH into any EC2 instance.
  • To start you will need either macports or homebrew.
  • if using macports you will run the following command to install putty for mac:
  • if you are using homebrew you will run the following command to install putty:
  • The remaining commands will be the same when using macports or homebrew. To generate the pem file run the following command:
    puttygen privatekey.ppk -O private-openssh -o privatekey.pem

    puttygen privatekey.ppk -O private-openssh -o privatekey.pem

    Keep in mind that you will want to substitute the name of your ppk file in place of the privatekey.ppk name I used. You will also want to change the name of the pem file you want to create rather than using privatekey.pem, unless of course you want to use privatekey.pem.
  • Next you should place the privatekey.pem file in your ~/.ssh directory
  • Now, lets set the pem file to have the proper permissions:
    chmod go-rw privatekey.pem

    chmod go-rw privatekey.pem

That’s it. You now have a valid pem file that you can use to connect to your EC2 instances from your Mac. Below is an example of the command you can now run to connect to your instances:

Puttygen key generator

Puttygen cer pem

Puttygen generate SSH key

Puttygen generate PPK

Puttygen rsa private key