Problems activating your account? Send notification email to: admin@post4vps.com
Host4Fun Budget VPS Hosting
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert PuTTY SSH Key Files to Linux Format
#1
How to convert PuTTY (.ppk) SSH key files to Linux format (.pem)


Hello everyone!

This tutorial is going to be a rather brief guide about how to convert SSH key files created with PuTTY (ppk file extension) to the Linux SSH key file format (pem file extension) so that they can be used with the Linux command line SSH client "ssh".

This tutorial will probably be very helpful for everyone who decided to switch to Linux and use the inbuilt tools instead of installing different / additional SSH clients. In this case you are right here. Unfortunately the Linux ssh client doesn't support the ppk format. Hence why a conversion has to be performed.

P.S.: Yes, there is a Linux version of PuTTY that supports the .ppk format. If you are using the Linux version of PuTTY then this tutorial is not for you. Please move along. Nothing to see here. Don't post a reply saying there is a PuTTY version for Linux. No offense!


First of all you will have to install PuTTY tools. The PuTTY tools package is usually called "putty-tools". It contains command line tools from PuTTY that can be used to create ppk SSH keys, read the content (e.g. public key) and convert the format of these keys (what we want to do).

So start a terminal if you're using a Linux distribution with a GUI or if you are already in a terminal just continue with the commands below.

Commands below have to be performed as root or with sudo!

Debian/Ubuntu/Mint:
apt-get install putty-tools

RHEL/CentOS:
yum install putty

Fedora:
dnf install putty

Arch:
pacman -S putty


Now you can use the PuTTY tool "puttygen" which is the general tool for SSH key creation and management to convert the format.

Run the command below to convert your key and make sure to adjust the key filenames and the path to the keys.

Convert private key:
puttygen /path/to/myprivatekey.ppk -O private-openssh -o /path/to/myprivatekey.pem

Convert publicy key:
puttygen /path/to/myprivatekey.ppk -O public-openssh -o /path/to/mypublickey.pem

If you have a passphrase on your key pair you need to enter your password to allow the converting to proceed.


That's about it! Now you should have .pem files in the folder where your .ppk key files are stored. You can use the .pem files with the Linux ssh client to connect to servers and authenticate yourself. To do so you have to use the -i flag and provide the path to the private key .pem file.

Example:
ssh -p22 root@123.123.123.123 -i /home/user/keys/server1-private.pem


Enjoy!
Kind regards
Hidden Refuge
Reply
 


Possibly Related Threads...
Thread Author Replies Views Last Post
  Setting Up MyBB Forum On a Linux Server ( Ubuntu / Debian ) Rehan 4 155 09-03-2019, 12:55 PM
Last Post: sohamb03
  install ogp agent in linux ubuntu os Khadeer143 2 225 07-10-2019, 04:02 PM
Last Post: Rehan
  Join split files (.001, .002, ...) easily on Linux Hidden Refuge 15 1,107 03-15-2019, 12:04 PM
Last Post: rudra
  Fix Intel GPU Tearing on Linux NomadicSingularityArray 0 393 12-02-2018, 06:35 PM
Last Post: NomadicSingularityArray
  [Tutorial] How to install MTA:SA gameserver in Linux arsalahmed786 3 978 09-20-2018, 04:43 AM
Last Post: Rehan

Forum Jump:


Users browsing this thread: 1 Guest(s)

Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - SSDBlaze - VPSlices - Abc-Hosters - Hyper Expert - Shadow Hosting - Bladenode - HostDoc - Hostlease


About Post4VPS

Post4VPS is a forum/destiny where you can Delploy Your Free VPSs just by the Power of Posts.

We Provide VPSs of many locations like Germany,US,Canada,France,London,etc.

We also Provide VPSs of Both Linux and Windows OS.