SSH into EC2 using Putty Windows

HOW TO: SSH into EC2 instance in Windows using PUTTY

This post will show you step by step how to SSH into an EC2 instance from Windows using Putty.

What is SSH?

“SSH, also known as Secure Socket Shell, is a network protocol that provides administrators with a secure way to access a remote computer. SSH also refers to the suite of utilities that implement the protocol. Secure Shell provides strong authentication and secure encrypted data communications between two computers connecting over an insecure network such as the Internet. SSH is widely used by network administrators for managing systems and applications remotely, allowing them to log in to another computer over a network, execute commands and move files from one computer to another.” – Searchsecurity.techtarget.com

How to lunch an EC2 Instance?

HOW TO: Launch an EC2 instance in AWS

 

How to SSH into an EC2 instance in Windows?

This tutorial presumes that you already have your private key (.pem) downloaded locally. If you don’t, have a look at the “HOW TO: Launch an EC2 instance in AWS“.

Download and install Putty

You can download Putty from here. Install it on your machine and move on to the next step.

Open PuttyGen

Open Putty
Open Putty

Click Load.

Load key
Load key

As highlighted, select all file types and locate your .pem key. Click Open and then OK on the pop-up window.

Save private key
Save private key

Click Save private key, the button highlighted in yellow in the picture above. Click Yes in the next pop-up window that will show up.

Save Private Key in Folder
Save Private Key in Folder

Save the .ppk file into a folder. You will be using this to SSH into your instance.

Open Putty

Putty
Putty

Copy Public DNS (IPv4) from AWS -> EC2

Copy Public DNS
Copy Public DNS

Log in to AWS. Go to EC2. Copy Public DNS (IPv4) link.

 

Add hostname in Putty

putty-hostname
putty-hostname

Your hostname will be composed of ec2-user@Public DNS (IPv4) link. Follow the next step before clicking Open.

 

putty-ssh
putty-ssh

Select SSH from the left menu, then click on Auth. You should get to the page opened on the image above. Once you’re there, click Browse and select your .ppk private key. Once you selected the file, click Open. You should now see a terminal opening, similar to the one from the picture below:

Successfully SSH into EC2 instance
Successfully SSH into EC2 instance

That’s it. You have successfully SSH into an EC2 instance. If you have just launched this instance, this proves that it works perfectly fine. You can now start configuring your server.

As always, let me know in the comments if you encounter any errors or you need any further help.

How to install PHP, Apache and MySQL on Ubuntu

One thought on “HOW TO: SSH into EC2 instance in Windows using PUTTY

  1. hi,

    tried to connect the Windows EC2 instance using Putty and referring the steps above.
    generated the private key by associating the .pem file and tried launch EC2 instance from putty using the dns name

    getting “Fatal error – Network error : connection timeout”.
    however is able to connect through RDP using the .pem private file. please help me to know how to resolve and connect the EC2 instance through SSH

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.