Create a PEM from a PPK file [duplicate]

Solution 1:

  1. Install PuttyTools

    apt-get install putty-tools
    
  2. Generate a pem file form the ppk

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

The file server.pem file will be saved on same location

Solution 2:

If you're on a Mac and you've previously installed Homebrew, from Terminal:

$ brew install putty
$ puttygen server.ppk -O private-openssh -o server.pem

The first command was suggested in this comment and the second from Emizen Tech's answer.

Solution 3:

Try this to install putty-tools

sudo apt install putty-tools
puttygen key.ppk -O private-openssh -o key.pem
ssh -i ~/key.pem {user}@{ip}

Solution 4:

First, install PuTTY for Mac using

brew install putty

Then, use the following command to convert the .ppk format private key to a standard PEM format private key:

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

Make sure permissions on the private key file are set properly. It should only be readable by the user that owns it.

chmod go-rw privatekey.pem

You can now use the key for logins from scripts and command line with:

ssh -i privatekey.pem user@hostname