Read More
Read More
Menu Close

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

    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 [email protected]

    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.
    Read More
    . . .
    Discuss on Helpdesk

    Leave a Comment

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


    20 comments

  • Rajesh
    It really works. Thanks
    • Neelesh Singh (Moderator)
      Hello There,

      Thank you so much for your appreciation. For any suggestions, you can also email us at [email protected] and we will get back to you accordingly.

      Thank you

  • Ken
    Thanks Mohit. The terminal convert pem to ppk works like a champ. You don’t even know. You da man.
    • Mohit Chandra (Moderator)
      thanks
  • lLisanderl
    Thanks al lot!!!
    • Webkul Support
      You are most welcome.
  • Sunny Yadav
    Useful to me also πŸ™‚
    • Mohit Chandra
      Thanks for your feedback.
  • Francis Kim
    Thanks! πŸš€
    • Mohit Chandra
      your welcome πŸ™‚
  • Kshiteej Deshpande
    Thanks a lot!!
    • Mohit Chandra
      your welcome !
  • Wesley Gibbs
    Useful to me too πŸ™‚
    • Mohit Chandra
      πŸ˜€
  • Wesley Gibbs
    Useful to me too πŸ™‚
    • Mohit Chandra (Moderator)
      Thank you so much for your feedback. πŸ™‚
  • arjun dhar
    Was useful to me .. thanks
    • Mohit Chandra
      your welcome @arjun
      • deepak
        Nice explanation
        • Mohit Chandra (Moderator)
          Thank you so much for your feedback. πŸ™‚
  • Back to Top