How to SSH into an EC2 Instance Using Windows and PuTTY
Secure Shell (SSH) is one of the most essential tools when working with AWS EC2 instances. It allows users to control remote machines securely via the command line. This guide will walk you through connecting to an Amazon Linux 2 EC2 instance from a Windows machine using PuTTY, a free SSH client.
Prerequisites
Before starting, ensure you have:
- An AWS EC2 instance running Amazon Linux 2.
- A public IP address assigned to your instance.
- A security group allowing SSH connections on port 22.
- PuTTY and PuTTYgen installed on your Windows machine.
Step 1: Install PuTTY
- Download PuTTY from the official website: https://www.putty.org/.
- Choose the 64-bit installer (or 32-bit if applicable).
- Run the installer and complete the setup by clicking Next → Next → Install.
Step 2: Convert the PEM Key to PPK Format (If Needed)
AWS provides PEM (Privacy-Enhanced Mail) format for private keys, but PuTTY requires the PPK (PuTTY Private Key) format. To convert:
- Open PuTTYgen (installed with PuTTY).
- Click Load, navigate to your PEM key file, and select it.
- Change the file type filter to All Files to see
.pem files.