Connecting to Your EC2 Instances: SSH, Putty, and EC2 Instance Connect

When working in the cloud, one of the key challenges is accessing your EC2 instances to perform maintenance or administrative tasks. This guide will walk you through the different methods available, depending on your operating system.


1. SSH (Secure Shell) for Linux & Mac

If you're using Mac or Linux, you can use SSH, a built-in command-line utility, to securely connect to your EC2 instances. This method provides direct access through the terminal without needing additional software.

📌 To use SSH on Mac/Linux:

ssh -i your-key.pem ec2-user@your-ec2-public-ip

Ensure that:

✅ You have the correct private key (.pem file).

✅ The key permissions are set properly (chmod 400 your-key.pem).

✅ The EC2 instance’s security group allows inbound SSH traffic on port 22.


2. Putty for Windows (Versions Below 10)

For Windows users running versions older than Windows 10, SSH is not natively available. Instead, you can use Putty, a third-party tool that provides the same SSH functionality.

Steps to Connect Using Putty:

  1. Download & Install Putty from putty.org.
  2. Convert your .pem key to a .ppk format using Puttygen.
  3. Open Putty and enter the EC2 instance’s public IP address.
  4. Under "SSH → Auth", browse and select your .ppk private key.
  5. Click Open and log in with the default EC2 username (e.g., ec2-user).