Skip to main content

How to Convert PEM KeyFile into PPK KeyFile and vice versa?



Hi,

In this post, we will learn that how can we convert PEM KeyFile into PPK KeyFile and vice versa including the installation of the tool which we will use to accomplish this.

For the Windows Operating System


In Windows system is easy and straight forward. You just need a tool called "puttygen.exe" from the URL - https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Choose the appropriate version as per your OS.



Convert PEM into PPK in Windows

After downloading the PuTTYgen and open it, load your file (select All Files (*.*) in the bottom dropdown to select your PEM key file). 

You will get a message Successfully imported foreign key, Just click OK, Now click on Save private key button to save that key in the location where do you want to save it.

Convert PPK into PEM in Windows

Now we will convert PPK file into PEM using PuTTYgen in Windows PC

Open the PuTTYgen tool, now load your PPK file into it, and finally, Go to Conversions Menu and Click on Export OpenSSH key. It will ask you to save your PEM file, just name it "AnyName.pem".


Installation of PuTTY in Linux distributions



Install PuTTY, if it’s not already on your system, by running one of these commands:

RHEL - RPM-based

yum install putty
Debian -Dpkg-based

apt-get install putty
OR

apt-get install putty-tools
Fedora

dnf install putty
ARCH-Linux

pacman install putty


Installation of PuTTY in MacOSX

Install the Homebrew if not already installed in your macOSX if not already installed, Brew is the package manager like Apptitude for Debian-based and Yum is for RHEL-based Linux distribution. You can use Port also but I will recommend you to use Brew.

How to install Brew in you macOSX -

Just open the URL "https://brew.sh/" into your browser and you will get the brew installation command on the Homepage of the site like the image below -




Run the following command which you will get on the Homebrew page.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"


It will take at least 5-7 minutes according to your internet bandwidth connection (download 500MB-600MB).

Once the Brew package is successfully installed into you macOSX. Just run the following command to installed PuTTy into your system.


brew install putty


Now, How to convert PEM into PPK and vice versa into Linux and macOSX based distribution.


Conversion of PEM Key file into PPK in Linux and macOSX

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

  • key.ppk: the original file name/path. 
  • -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 name/path.

Conversion of PPK Key file into PEM in Linux and macOSX

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

If the above command is not working, then try this

puttygen pemKey.pem -o ppkKey.ppk -O private
OR

puttygen mykey.pem -o mykey.ppk

That's all about how can you convert your PEM KeyFile into PPK Key File and vice versa. :)

Popular posts from this blog

WordPress Site is not loading properly behind Google Cloud/AWS Load Balancer

Hello Guys, Today we are going to understand how can we fix a WordPress loading issue (CSS and JS loading issue) behind the Google Cloud Load Balancer or AWS Load Balancer. Generally, When we host a WordPress site directly with Google Cloud Compute Engine VM instance or AWS EC2 instance. It's loading perfectly fine. But once we added this WordPress server behind any Load Balancer either from GCP Load Balancer or AWS Load Balancer, you site will completely broken, means the CSS and JS of your site not loaded properly. The reason for this is - When you put a load balancer in front of WordPress, you need to modify wp-config.php to process the HTTP header HTTP_X_FORWARDED_PROTO to detect the protocol that the user is using and not the protocol the load balancer is using to connect to your backend. To fix this issue, we have to make following changes in the  wp-config.php  file and add the below code snippet on the top of  wp-config.php file - Google Cloud Platform Load Bal...

Git and GitHub Commands Mastery

1. Setup Git and GitHub Global Configuration  git config --global user.email "gautamthakur1983@gmail.com" git config --global user.name "Gautam Thakur" git config --global list git config --list 2. Git Lifecycle | Initilize, Status, Add, Commit git status git init git add git commit -m "Commit Message" git log git log --oneline 3. Git Difference between last commit changes and current version changes git diff 4. Git Compare between 2 different Git Commits git diff eac4c5b 82485b1 5. Git Statsh - To save some changes for temporary purpose ## Pop take out stash and clear but apply take out stash but not clear git stash (To save current changes for temporary) git stash pop (To take out all stash contents) git stash list git stash clear (To clear all the stash changes) git stash save "NAME"  git stash save "NAME1" (Working with multiple stash) git stash sapply 0 or 1 (0 for name, 1 for about) after that run git stash clear git stash clear 6...

How to Setup Kubernetes Cluster in Google Cloud Virtual Machine using "kubeadm"? | Ubuntu 20.04/22.04 LTS

  Hello Friends, In this post, we are going to setup Kubernetes Cluster on Virtual Machine in Google Cloud Platform using kubeadm tool. Hope this post will help you in Kubernetes learning Hand-On Labs (HOL). Requirements: Master Node: No. of VMs 1 Specifications - 2 vCPUs, 4GB RAM, 20 GB HDD (Balanced PD or SSD PD), Operating System (OS) Ubuntu 20.04 LTS x86/64, amd64  Firewall Rule - Ingress Allow 6443 (API Server) | 2379 (ETCD) | 10251 (Scheduler) | 10252 (Controller Manager) 10250 (Kubelet), sudo access with admin access  Worker Node: No. of VMs 2 Specifications - 2 vCPUs, 4GB RAM, 20 GB HDD (Balanced PD or SSD PD), Operating System (OS) Ubuntu 20.04 LTS x86/64, amd64  Firewall Rule - Ingress Allow 30000-32767 (Services) | 10250 (Kubelet),  sudo access with admin access  Disable Swap and comment fstab entry: First, Disable Swap and remove or comment the Swap entries from fstab file : sudo swapoff -a sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab Next...