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.
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.
-
Open PUTTY and enter the IP address of your EC2 instance.
-
Specify the username as
ec2-user
(depending on the AMI you are using). -
Add the previously converted .ppk file.
- Click on
Open
and you will be connected to your EC2 instance.