Let's say you have an SSH private key. For example, on a Linux system, your user's /home/$(whoami)/.ssh directory may contain something like this.
~]$ ls -lisa /home/$(whoami)/.ssh
total 16
1091637 0 drwxr-xr-x. 2 john.doe admins 79 Dec 4 10:50 .
16919760 0 drwx------. 3 john.doe admins 111 Dec 4 10:50 ..
2966257 4 -rw-------. 1 john.doe admins 734 Dec 4 10:50 authorized_keys
2966249 4 -rw-------. 1 john.doe admins 3414 Dec 4 10:13 id_rsa
2966255 4 -rw-r--r--. 1 john.doe admins 763 Dec 4 10:13 id_rsa.pub
In this example, the id_rsa file is the SSH private key. The private key file should contain something like this.
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAl/qBJwMtUFnLns9cGCjnC1EKuWwwK+ItcLF7WoDOISxfmE/l
1TSBEos16nyqv6qMQOfNu/1sGJ8IHCWeqMuWJO4nY3RebOJ2jinw2aiLtMkzQjRQ
KGVs62h1VzLx2n8IVLXOSnEmTRRRpNIH5vWx2EEBtchtCXGiUcJIRt8Q1UVsfTbp
H7GvAVDqGMfnXqizqbGtfmDZTtAmq4JYReUUej1NnE8O8hLFNXqcrioo27puF8Ti
gPoTpp9p8ncidktd3NWck9jJGvEoaA3oxsKMgZGlPviMkhTv70Ovh7ShPpZ38ETB
7SkOcn6W4hbDHFqSihmrf0S7JaSN/RYKY2wVMQIDAQABAoIBADFOVkRf5X2iBEub
npc//eVP/5i0ntQ95twe2JQ+IaHlkYYKtdf71rw7adyPYZ4ZKLOOANMynrVGMw1e
-----END RSA PRIVATE KEY-----
Let's create a PEM file that contains the contents of the private key file.
cp id_rsa id_rsa.pem
Here is how you can create a PPK file using the PEM file.
Windows
- Download and install PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.
- Start puttygen.
- Ensure RSA is selected (since the PEM file contains an RSA private key in this example).
- Select Load and select the PEM file.
- Select Save private key button to create a PPK file.
Linux
On a Debian distribution (Ubuntu, Mint), apt-get can be used to install the putty-tool package.
apt-get install putty-tools
On a Red Hat distribution (CentOS, Fedora, Red Hat), dnf or yum can be used to install the putty package.
dnf install putty
And here is how you would create a PPK file using the PEM file.
puttygen id_rsa.pem -O private -o id_rsa.ppk
Add the content of the id_rsa.pub file to your users authorized_keys file.
~]$ cat /home/john.doe/.ssh/authorized_keys
ssh-rsa AAAAB123456. . . asdfasdfa213123w== john.doe
Did you find this article helpful?
If so, consider buying me a coffee over at 