[ssh] Convert PEM to PPK file format

Is there a way to convert PEM files to PPK files? (you may guess that Amazon EC2 gives me a PEM file, and I need to use the PPK format for SSH connectivity).

This question is related to ssh putty pem

The answer is


If you have Linux machine just install puttygen in your system and use use below command to convert the key

pem to ppk use below command:

puttygen keyname -o keyname.ppk

Below command is use to convert ppk to pem not pem to ppk

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


  1. Download puttygen
  2. Then open puttygen
  3. click load
  4. Set the file type to . all files
  5. Save PrivateKey
  6. and then u can just save any name that file became an ppk file

I had the same issue with PuttyGen not wanting to import an openSSH private key. I tried everything and what I found out was the old version of PuttyGen did not support importing OpenSSH. Once I downloaded the latest Putty, puttygen then allowed it to import the openssh private key just fine. I now have a hole in the side of my desk for pounding my head against it for the past hour.


I'm rather shocked that this has not been answered since the solution is very simple.

As mentioned in previous posts, you would not want to convert it using C#, but just once. This is easy to do with PuTTYGen.

  1. Download your .pem from AWS
  2. Open PuTTYgen
  3. Click "Load" on the right side about 3/4 down
  4. Set the file type to *.*
  5. Browse to, and Open your .pem file
  6. PuTTY will auto-detect everything it needs, and you just need to click "Save private key" and you can save your ppk key for use with PuTTY

Enjoy!


To SSH connectivity to AWS EC2 instance, You don't need to convert the .PEM file to PPK file even on windows machine, Simple SSH using 'git bash' tool. No need to download and convert these softwares - Hope this will save your time of downloading and converting keys and get you more time on EC2 things.


  1. Save YourPEMFILE.pem to your .ssh directory
  2. Run puttygen from Command Prompt

    a. Click “Load” button to “Load an existing private key file”
    b. Change the file filter to “All Files (.)
    c. Select the YourPEMFILE.pem
    d. Click Open
    e. Puttygen shows a notice saying that it Successfully imported foreign key. Click OK.
    f. Click “Save private key” button
    g. When asked if you are sure that you want to save without a passphrase entered, answer “Yes”.
    h. Enter the file name YourPEMFILE.ppk
    i. Click “Save”


Use PuTTYGen

Creating and Using SSH Keys

Overview

vCloud Express now has the ability to create SSH Keys for Linux servers. This function will allow the user to create multiple custom keys by selecting the "My Account/Key Management" option. Once the key has been created the user will be required to select the desired SSH Key during the “Create Server” process for Linux.

Create and Use SSH Keys

  1. Create keys
    • Navigate to “My Account”
    • Select “Key Management”
    • Create New Key.
      • During the key creation process you will be prompted to download your private key file in .PEM format. You will not be able to download the private key again as it is not stored in vCloud Express.
      • The “Default” checkbox is used for the API.
  2. Deploy server and select key
  3. Connect

    • SSH (Mac/Linux)
      • Copy .PEM file to the machine from which you are going to connect.
      • Make sure permissions on .PEM file are appropriate (chmod 600 file.pem)
      • Connect with ssh command: ssh vcloud@ipaddress –i privkey.pem
    • Putty (Windows)
      • Download Putty and puttygen from - here
      • Use puttygen to convert .PEM file to .PPK file.
      • Start puttygen and select “Load”
      • Select your .PEM file.
      • Putty will convert the .PEM format to .PPK format. enter image description here
      • Select “Save Private Key” A passphrase is not required but can be used if additional security is required.
    • Connect with Putty.

      • Launch Putty and enter the host IP address. If connecting to the 10.X private address you must first establish an SSL VPN connection.
      • Navigate to Connection/SSH/Auth
      • Click “Browse” and select the .PPK file you exported from puttygen. enter image description here

      • Click “Open.” When connection comes up enter username (default is vcloud).

Instructions copied from here


PuTTYgen for Ubuntu/Linux and PEM to PPK

sudo apt install putty-tools
puttygen -t rsa -b 2048 -C "user@host" -o keyfile.ppk

I used a trial version of ZOC Terminal Emulator and it worked. It readily accepts the Amazon's *.pem files.

The trick is though, that you need to specify "ec2-user" instead of "root" for the username - despite the example shown in the EC2 console, which is wrong! ;-)


Convert .pem file to .ppk for Windows 10

You need to do following:


1. Download PuTTYGen with Pageant.
2. Press "load" button and select your ".pem" file.
3. Press "save private key" button and save your ".ppk" file.
4. Open Pageant and press "add key" button. Just all. Keep running Pageant in background.
5. Now login through SSH or SFTP without selecting password field.


enter image description here


enter image description here


enter image description here


Examples related to ssh

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" How to solve "sign_and_send_pubkey: signing failed: agent refused operation"? key_load_public: invalid format ssh connection refused on Raspberry Pi Getting permission denied (public key) on gitlab Verify host key with pysftp Can't connect to Postgresql on port 5432 Checkout Jenkins Pipeline Git SCM with credentials? How to open remote files in sublime text 3 how to setup ssh keys for jenkins to publish via ssh

Examples related to putty

Forward X11 failed: Network error: Connection refused Best way to script remote SSH commands in Batch (Windows) AWS - Disconnected : No supported authentication methods available (server sent :publickey) Change mysql user password using command line How to download a file from my server using SSH (using PuTTY on Windows) Using putty to scp from windows to Linux Saving the PuTTY session logging Putty: Getting Server refused our key Error Google server putty connect 'Disconnected: No supported authentication methods available (server sent: publickey) Batch file for PuTTY/PSFTP file transfer automation

Examples related to pem

Connect over ssh using a .pem file Node.js https pem error: routines:PEM_read_bio:no start line Generate .pem file used to set up Apple Push Notifications Differences between "BEGIN RSA PRIVATE KEY" and "BEGIN PRIVATE KEY" How to save public key from a certificate in .pem format Converting pfx to pem using openssl How to read .pem file to get private and public key scp (secure copy) to ec2 instance without password How to convert .crt to .pem Convert PEM to PPK file format