Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Convert PPK to PEM file using Command

    How to Convert PPK to PEM file using Command

    RahulBy RahulJune 29, 20172 Mins ReadUpdated:June 28, 2022

    One of my clients provided me .ppk file to connect to his server using ssh. As I am a Ubuntu user, I need a key that supports the terminal command. So I decided it convert to a .pem file. I am sharing the steps to convert PPK to PEM format on the Linux terminal using a putty-gen command-line utility.

    The Windows Users may like: How to convert a PEM file to PPK?

    Method 1: Convert PPK to PEM in Linux

    Use the below steps to install the required packages and convert PPK to a pem file.

    • Step 1 – First of all, install the putty tools on your Linux system using below command.
      sudo apt-get install putty-tools 
      
    • Step 2 – Now, convert the ppk file to pem file using puttygen command line tool.
      puttygen server1.ppk -O private-openssh -o server1.pem 
      
    • Step 3 – Change the .pem file permissions. Set the read-only permissions to the owner of the file, remove any permission to group and other. Otherwise ssh will refuse this key for use.
      chmod 400 server1.pem 
      
    • Step 4 – Finally, connect to your remote Linux server with ssh using this pem key.
      ssh -i server1.pem [email protected] 
      

    Method 2: Convert PPK to PEM in Windows with PuTTYgen

    Windows users can also convert a PPK file to PEM using PuTTYgen utility. Assuing you already have downloaded Puttygen from its official download site.

    Next, follow the steps to convert PPK to PEM:

    1. Start PuTTYgen
    2. Under File menu, click Load private key.
    3. Select your .ppk file, and then choose Open.
    4. Now, under the Conversions menu, click Export OpenSSH Key.
    5. Set a new name with “.pem” extension
    pem ppk
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous Articlecd command in Linux with Examples
    Next Article Mkdir Command in Linux with Examples

    Related Posts

    How to Correctly Set the $PATH variable in Bash

    2 Mins Read

    What is the /etc/aliases file

    2 Mins Read

    What is the /etc/nsswitch.conf file in Linux

    2 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    How to Install Latest Git on Ubuntu 22.04

    Updated:May 31, 20222 Mins Read

    8 Comments

    1. prasanna on August 27, 2019 12:05 pm

      how to convert .ppk file to .key file ?

      Reply
    2. sindhu on August 15, 2019 5:57 am

      thanks !

      Reply
    3. Michael Quick on June 14, 2019 2:20 pm

      Or if you want a script to do it :

      #!/bin/bash
      [[ “${1##*.}” =~ “ppk” ]] && { puttygen ${1} -O private-openssh -o “${1%.*}.pem”; chmod 400 “${1%.*}.pem”; } || { puttygen ${1} -o “${1%.*}.ppk” -O private; chmod 400 “${1%.*}.ppk”; }

      (checks extension and writes a file)

      Reply
    4. Ahmed on May 17, 2019 9:17 pm

      When type:
      puttygen key.ppk -O private-openssh -o key.pem
      puttygen: unable to load file `key.ppk’: unable to open file

      What is this?

      Reply
    5. Dhananjay on April 26, 2019 7:31 pm

      what is [username] in
      ssh -i server1.pem [username]@11.22.33.44

      I am using my ftp username, and again it is asking for password

      Reply
    6. Rajesh on March 27, 2019 7:31 am

      Thank You Its Worked..

      Reply
    7. passerby on October 15, 2018 7:20 am

      thanks!

      Reply
    8. Arun on April 26, 2018 4:09 pm

      Thanks it worked!

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Import GPG Keys on Ubuntu & Debian (without apt-key)
    • How To Install Google Chrome On macOS
    • How to Install Minecraft on Ubuntu 22.04 & 20.04
    • Running a Cron job every Sunday (Weekly)
    • Running Multiple Commands At Once in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.