3.17 SSH over Windows AWS
In this lesson we connect to an AWS EC2 Linux instance from a Windows machine using PuTTY. Our EC2 server has a public IP and a security group authorizing SSH on port 22. SSH is the essential tool for taking control of a remote machine and running commands as if we were sitting in front of it, all over an encrypted channel. On Windows we will use the free PuTTY client to handle the connection.
Preparing PuTTY and the key
- Download and install PuTTY from the official website (64-bit version).
- Open PuTTYgen and click Load, switching the filter to All Files to find your
.pemkey. - Select the
.pemfile downloaded from AWS, then click Save private key to export it as a.ppkfile (PuTTY's own format). - Confirm saving without a passphrase if you do not want to be prompted on every connection.
Once the key is converted, open PuTTY. Copy the public IP from the EC2 console and paste it into the Host Name field, prefixed by the default user: ec2-user@<public-ip>. Save the session profile under a name like my first instance. If you try to connect now, the server replies No supported authentication methods available because the key is not yet attached to the profile.
To fix this, go to Connection > SSH > Auth, browse to your .ppk file, load it, then come back to the Session page and save again. Open the session: PuTTY connects you to the Amazon Linux 2 EC2 server as ec2-user. You can run any command — whoami confirms the identity and ping google.com verifies outbound network access. To leave, type exit or press Ctrl + D. You now have a persistent PuTTY profile to reach your EC2 instance from Windows.
Summary
This lesson covers connecting to AWS EC2 Linux instances from Windows using SSH via PuTTY. You will learn how to download and install PuTTY, convert your AWS key pair from .pem format to .ppk format, configure PuTTY with your key and instance details, and establish your first secure connection to an EC2 instance.
Key points
- SSH provides secure remote access and command execution on AWS EC2 instances from Windows
- PuTTY is a popular SSH client for Windows that enables direct EC2 connections
- AWS key pairs must be converted from .pem to .ppk format for compatibility with PuTTY
- Key authentication must be configured in PuTTY settings before attempting to connect
- Default EC2 user (ec2-user) is used in the SSH connection string format: ec2-user@instance-ip
- Connection success can be verified by executing commands on the remote EC2 instance
FAQ
Why do I need to convert the AWS key from .pem to .ppk format?
PuTTY uses the .ppk format for key authentication. The conversion ensures your AWS key pair is compatible with PuTTY's key authentication system.
What is the default username for connecting to EC2 Linux instances from Windows?
The default username is 'ec2-user' for Amazon Linux 2. The SSH connection follows the format: ec2-user@instance-ip-address
What should I do if I receive an authentication error when trying to connect?
Ensure the converted .ppk key file is properly configured in PuTTY's authentication settings. Load the key file in Connection > SSH > Auth section of PuTTY.