PuTTY — SSH into EC2 (Windows)

Beginner
⏱️ 7 min read
📚 Updated: Aug 2025
EC2 / SSH / PuTTY

What you’ll learn

PuTTY is a common Windows SSH client. With an EC2 instance, a stable public IPv4 (recommended), and a private key, you can open an interactive shell on your Linux instance.

This guide walks through reading the hostname and default user from the EC2 Connect panel, configuring PuTTY with a .ppk key, saving a session, and completing the first login.

EC2 and PuTTY at a glance

  • PuTTY — free SSH client for Windows (and components such as PuTTYgen for key conversion).
  • Amazon EC2 — virtual Linux servers in the cloud. SSH uses TCP port 22 with key-based authentication for official AMIs.

Prerequisites

  • PuTTY installed from the official site: PuTTY download (includes PuTTYgen).
  • A running EC2 instance and its public IPv4 DNS or address (see below).
  • A matching .ppk private key, or a .pem you convert with PuTTYgen (see callout).
EC2 instances list with instance in running state
Amazon EC2
  • ec2-user — many Amazon Linux AMIs.
  • ubuntu — official Ubuntu Server AMIs.

Configure PuTTY and connect

Gather the hostname and username from the console first so you can paste them into PuTTY without guesswork.

  1. In the EC2 console, open Instances, select your instance, choose Connect, then the SSH client tab. Copy the hostname shown for the example ssh command (public DNS or IP).

    1. Instances → select instance → Connect
    2. Open the SSH client tab
    EC2 Connect SSH client tab showing example hostname
    Amazon EC2
  2. On the same tab, note the username in the sample SSH command (for example ubuntu or ec2-user).

    1. Instances → select instance → ConnectSSH client
    EC2 Connect tab showing default SSH username
    Amazon EC2
  3. Open PuTTY. On the Session screen, set Host Name (or IP address) to the value you copied (port 22).

    PuTTY session dialog with EC2 hostname and port 22
    PuTTY
  4. In the category tree, go to Connection → SSH → Auth → Credentials (in older versions, Auth or Auth / Credentials). Under Private key file for authentication, browse to your .ppk file.

    PuTTY SSH Auth credentials with PPK private key
    PuTTY
  5. Return to Session, type a name under Saved Sessions, and choose Save so you can reopen these settings later.

    PuTTY save session with a custom session name
    PuTTY
  6. Select your saved session and choose Open to start SSH.

    PuTTY saved sessions list with Open button
    PuTTY
  7. On first connect, PuTTY shows a host key prompt. Verify the fingerprint against the EC2 console if you need high assurance, then choose Accept to cache the key.

    PuTTY security alert accept host key
    PuTTY
  8. At the login as: prompt, type the username from the EC2 Connect tab (for example ubuntu). With key auth configured, you should land in a shell without a password.

    PuTTY terminal logged in to Ubuntu on EC2
    PuTTY

You now have an SSH session on the instance. Next, you can use the same host, user, and key material for SFTP in FileZilla if you upload files graphically.

Troubleshooting

  • Connection refused / timeout — confirm the instance is running, has a public route, and the security group allows inbound TCP 22 from your IP.
  • Server refused our key — wrong private key, wrong username for the AMI, or key not loaded under SSH → Auth / Credentials.
  • No supported authentication methods — ensure you are using the key that matches the public key on the instance and that the image expects key auth (not password-only).

Key takeaways

1

Copy hostname and username from EC2 Connect → SSH client before filling PuTTY.

2

Load a .ppk under SSH → Auth / Credentials; convert .pem with PuTTYgen when needed.

3

Save a named session so you do not re-enter settings for every connection.

Frequently asked questions

No. OpenSSH on macOS, Linux, or Windows can run ssh -i key.pem ubuntu@host. PuTTY is one convenient option on Windows, especially with .ppk keys.
The default is TCP port 22. Change it only if your server listens on a different SSH port and your security group matches.
Accept only when you trust you are reaching the intended instance. After you replace an instance, the host key may change legitimately; investigate unexpected changes before accepting.

Next: Node.js on the instance

Use the same SSH session to run apt, install npm, and upgrade to a supported Node line with n.

Node.js on Ubuntu →
Did you know?

Modern Windows 10 and 11 include OpenSSH Client (ssh in PowerShell or Terminal). PuTTY remains useful when you prefer its session manager, .ppk keys, or jump-host workflows built around the classic toolkit.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful