How to connect to EC2 with PuTTy

Dhiraj Rai
3 min readApr 12, 2021

Step 1a: To setup an EC2 instance navigate to the AWS EC2 service and click on launch instances.

Step1b: Search and select the following instance.

Step1c: Just go with the default settings and click Review and Launch >> Launch.

Next you will be prompted to select a keypair, this is important for SSH to our EC2 instance (I will use PuTTy here).
1) Select “Create new keypair” >> Enter any name >> “Download Key Pair
2) This will download a .pem file to your local.
3) Click on “launch instance

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

Step1d:
1) In your local machine open/install PuTTY-GEN
2) Click on “load” and browse to the .pem file and select it
3) Click on “Save private key” [Do not click on Generate]
This will save a .ppk file to your local.

Step1e: Configure Security group.

Once the instance is created select the check box and click on “Security” and then “Security Groups”

Next, on the “Inbound rules” tab select “edit inbound rules”

Select, Type >> All traffic,
Source >> Any where
And “Save rules”

Step1f: Now connect to our newly created instance using PuTTY

From Connect >> SSH client >> copy the “Public DNS” of our EC2 instance

Connect to our EC2 instance using PuTTY by entering the “Public DNS” as the “Host Name” and select the “dhirajusescases.ppk” file in “Auth

Then login as “ubuntu”

Step 2: Do not forget to terminate the EC2 instance!

--

--