Reading list Switch to dark mode

    Converting a ppk file to a pem file for accessing AWS ec2 instances on Linux

    Updated 4 April 2019

    Yesterday , i am working on the project in which i need to access the server which is a AWS EC2 instance. Putty ppk file has been provided to me to connect it, but i need to access it on linux so i need to convert this ppk file into equivalent pem file. I tried many things, google it, but nothing is working. Although i was able to connect via Filezilla but from terminal i can`t. Finally, by Hit-n-Try method, i got the solution.
    Here is a list of steps I followed to convert that PPK file into an equivalent PEM file that I could use access Ec2 instance on linux terminal via SSH –

    sudo apt-get install putty-tools
    • Generate the pem file run the following command: as-
    puttygen ppkkey.ppk -O private-openssh -o pemkey.pem
    • Place the pemkey.pem file in your ~/.ssh directory: as-
    cp pemkey.pem ~/.ssh
    • Set the pem file to have the proper permissions: as-
    chmod 400 pemkey.pem

    Thatโ€™s it
    Now, we have a valid pem file that we can use to connect to our EC2 instances from Linux. Below is an example:

    ssh -i pemkey.pem user@ec2-instancedotcom

    Similarly, if we want to convert pem file to ppk , we can do it like this –

    puttygen pemKey.pem -o ppkKey.ppk -O private
    
    #Flags:
    -o Tells it where to write out the converted putty private key
    -O private Tells it that you want a putty private key.

    That`s it !!!
    I hope it will help someone in the future.
    And by someone I most likely mean by me !

    [stextbox id=”info”]Your opinions, comments and suggestions are important to keep the page updated and interesting.ย [/stextbox]

    Start your headless eCommerce
    now.
    Find out More
    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    20 comments

  • Rajesh
    • Neelesh Singh (Moderator)
  • Ken
    • Mohit Chandra (Moderator)
  • lLisanderl
    • Webkul Support
  • Sunny Yadav
    • Mohit Chandra
  • Francis Kim
    • Mohit Chandra
  • Kshiteej Deshpande
    • Mohit Chandra
  • Wesley Gibbs
    • Mohit Chandra
  • Wesley Gibbs
    • Mohit Chandra (Moderator)
  • arjun dhar
    • Mohit Chandra
      • deepak
        • Mohit Chandra (Moderator)
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home