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 Fletcher18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...
Andrew Fletcher12 Mar 2024
How to determine the size of a directory in Terminal
To determine the size of a directory using the terminal, you can use the du (disk usage) command. The syntax for this command can vary slightly depending on the operating system you are using, but a common way to use it is as follows: For Linux and macOSdu -sh /path/to/directoryduDisk...