Cloud Technology

What are the steps to connect to a Linux EC2 instance from Windows using the PuTTY SSH client?

MA Asked by Mark Thompson · 14-08-2025
0 upvotes 15,887 views 0 comments
The question

I have just launched my first Amazon EC2 instance and downloaded the .pem key pair file. I am trying to access the instance from my Windows machine using PuTTY, but I'm getting "Format error" and "Connection refused" messages. How do I convert the AWS key file into a format PuTTY recognizes, and which specific configuration settings (like Port or Auth) do I need to adjust to successfully log in?

3 answers

0
SU
Answered on 16-08-2025

To connect via PuTTY, you first need to convert your .pem file to a .ppk file using the PuTTYgen tool, as PuTTY doesn't natively support the PEM format. Open PuTTYgen, load your .pem file, and click "Save private key." Once you have the .ppk, open PuTTY and enter your EC2 instance's Public IPv4 address in the Host Name field. Next, navigate to 'Connection' > 'SSH' > 'Auth' > 'Credentials' and browse for your .ppk file. Finally, ensure your EC2 Security Group allows inbound traffic on Port 22 for your specific IP address. When prompted for a username, use ec2-user for Amazon Linux, ubuntu for Ubuntu, or root depending on the AMI you selected.

0
DA
Answered on 18-08-2025

I followed the conversion steps, but I am still getting a "Network error: Connection timed out." Could this be related to my local firewall or something within the AWS VPC settings?

RO 20-08-2025

It's almost certainly a networking issue, David. Check your AWS Security Group and ensure there is an "Inbound Rule" for SSH on Port 22. Also, verify that your EC2 instance is in a Public Subnet with an attached Internet Gateway. If you are behind a corporate firewall, Port 22 might be blocked locally, in which case you might need to use the "EC2 Instance Connect" browser-based terminal instead of a standalone SSH client like PuTTY.

0
JE
Answered on 05-09-2025

Make sure you use the correct default username for your OS. If you try to log in as 'admin' on an Amazon Linux instance, it will reject the key even if your PuTTY setup is perfect.

MA 07-09-2025

Jennifer is spot on. I wasted an hour once because I forgot that Ubuntu instances require the username ubuntu specifically. Always double-check the AMI documentation for the default user!

Share your thoughts

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

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session