How to Connect AWS EC2 Linux Instance Using PuTTY

Introduction
Amazon EC2 is a cloud service where you can run virtual servers.
When we create an EC2 instance, AWS gives us a .pem key file.
But PuTTY (Windows SSH tool) only accepts .ppk key file.
So, we must first convert .pem
to .ppk
, then connect using PuTTY.
Step 1: Launch a New EC2 Instance
Login to AWS Management Console.
Go to EC2 service.
Set Region
On the dashboard, click Launch Instance.
Step 2:
In the “Name and Tags” section, type a name for your instance.
Choose an Amazon Machine Image (AMI)
Choose Instance Type
- Select
t2.micro
(it’s free-tier and good for practice).
- Select
Step 3: Create a Key Pair
In the Key pair (login) section, click Create new key pair.
Give it a name, like
my-ec2-key
.File format → select .pem.
Download the
.pem
file and keep it safe (you cannot download it again).
Step 4: Launch Instance
Review your settings.
Click Launch Instance.
After a few seconds, your instance will start.
Step 5: Install PuTTY and PuTTYgen
To connect your EC2 instance from Windows, you need PuTTY (SSH client) and PuTTYgen (key converter tool).
Step 6: Convert PEM to PPK using PuTTYgen
Open PuTTYgen.
On the top menu, click Conversions → Import Key.
Select the .pem file you downloaded from AWS.
After it loads, click the Save private key button.
Step 10: Connect to EC2 Instance using PuTTY
Open PuTTY.
In the left menu, click Session.
In Host Name (or IP address) box, enter your Public IP (for example:
65.2.83.250
).Port: keep it 22.
Connection type: SSH.
In the left menu, expand SSH → Auth → Credentials.
Click Browse and select the .ppk file you created with PuTTYgen.
Click Open.
A terminal window will appear. First time it may ask “Do you trust this host?” → Click Yes.
Now you are connected to your EC2 instance!
Why do we need to convert .pem
to .ppk
using PuTTYgen? Why not create .ppk
directly?
When you create an EC2 instance on AWS, Amazon gives you the key pair in .pem
format.
This .pem
file is designed to work directly with OpenSSH clients (like on Linux or macOS terminal).
But on Windows, if you are using PuTTY, it does not understand .pem
files.
PuTTY only accepts its own format, which is .ppk
(PuTTY Private Key).
That’s why we need an extra step:
Use PuTTYgen → Import the
.pem
file → Save it as.ppk
.Then, PuTTY can use this
.ppk
file to connect to your EC2 instance.
AWS does not give .ppk
directly because not everyone uses PuTTY. Most Linux/macOS users connect with .pem
directly, without PuTTY. So .pem
is the default universal format.
In short: Conversion is only needed if you use PuTTY.
Subscribe to my newsletter
Read articles from Shubhanshu Mohanty directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by