Convert a putty ppk file to a pem file

Recently, I am working on the AWS project, so I have to access AWS EC2 instance. ppk file was provided me to connect it, But I have to connect it with Linux machine so I required pem file. Now I have to convert the ppk file to pem file. I tried numerous things, google it, but nothing works. Finally I got the solution.

For below Setups of convert ppk file to a pem file.

Install Putty

First we need to install putty on your machine.

  • If using MAC you will run the following command to install putty:
    # sudo port install putty
  • If using Ubuntu run the following command to install putty:
    # sudo apt-get install putty-tools
  • If using Linux/CentOS run the following command to install putty:
    # yum install putty
  • Generate pem file

    To generate the pem file run the following command:

    # puttygen awsprivatekey.ppk -O private-openssh -o awsprivatekey.pem

    Set Pemission

    Now, lets set the pem file to have the proper permissions:

    # chmod 400 awsprivatekey.pem

    Access AWS Server

    Now you have a successfully generated pem file that you can use to connect to your EC2 instances. Use following command to connect to your EC2 instances:

    # ssh -i awsprivatekey.pem ec2-user@ec2-server-ip
    1. 7 years ago
      • 7 years ago

    Leave a Reply

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

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    The reCAPTCHA verification period has expired. Please reload the page.