How to SSH into an EC2 Instance Using PuTTY

Published: December 16, 2021

How to SSH into an EC2 Instance Using PuTTY

If you're working with Amazon Web Services (AWS) and need to access your EC2 instances securely, PuTTY can be a valuable tool. However, PuTTY doesn't directly support the standard .pem files generated by AWS for SSH authentication. In this article, I'll show you how to connect to your EC2 instances using PuTTY by converting your .pem file to a .ppk file.

Download PuTTY and PuTTYgen

To get started, download PuTTYgen, a tool that will help us convert the .pem file to a format accepted by PUTTY. This is necessary because PUTTY doesn't directly accept .pem files generated by AWS.

Convert .pem to .ppk using PuTTYgen

Launch PuTTYgen and load your .pem file generated by AWS.

PuTTYgen Convert

Once the file is loaded, click on Save private key to save the private key as a .ppk file.

Open PUTTY and Add IP

Now that we have the converted .ppk file, let's use PUTTY to SSH into our EC2 instance.

  1. Open PUTTY and enter the IP address of your EC2 instance.

    PuTTY IP Address
  2. Specify the username as ec2-user (depending on the AMI you are using).

    PuTTY Username
  3. Add the previously converted .ppk file.

PuTTY Add .ppk file
  1. Click on Open and you will be connected to your EC2 instance.