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

 

Related articles

Andrew Fletcher16 Jan 2025
get IP address from terminal OSX
When troubleshooting network issues or configuring devices, knowing your IP address can be essential. Whether you're connected via Wi-Fi, Ethernet, or tethering through a mobile provider, macOS offers powerful built-in tools to quickly identify your IP address. Here's a practical guide tailored to...