Skip to main content

How do you generate a .pem file from an existing .ppk key?

Is putty on your mac?

Check by running the command

puttygen -V

Which will generate a response similar to 

puttygen: Release 0.76
Build platform: 64-bit Unix
Compiler: clang 12.0.5 (clang-1205.0.22.9)
Source commit: 1fd7baa7344bb....

Don't have Putty, well easily fixed with homebrew.

brew install putty

 

Generate the key

We will use puttygen to generate the key.

puttygen key.ppk -O private-openssh -o key.pem
key.ppk the original file path and name of the ppt file
-O private-openssh the output type.
private-openssh is used to save an SSH-2 private key in OpenSSH’s format
-o key.pem the output file path and name of the new pem file

In my case the CLI became

puttygen /Users/andrewfletcher/Sites/PEM/AMH.ppk -O private-openssh -o /Users/andrewfletcher/Sites/PEM/AMH.pem

 

Usage and access to the remote staging server

With the rem file generated, time to test the login process.

ssh {username}@{remote-server-ip} -i /Users/andrewfletcher/Sites/PEM/{filename}.pem

Replace

{username} Remote server's access username
{remote-server-ip} Of course the IP address of the remote server
{filename} The path and rem file name