How to SSH into Linux EC2 instance from a Windows machine

To ssh into the linux EC2 instance from a windows machine, you need to use putty which is an open source software. The .pem file that you have downloaded from AWS is not supported by Putty. You need to first convert the .pem file to .ppk. Download and install putty with all the utilities from here and open puttygen. Puttygen is a utility that can convert keys to the required .ppk format.

In the Puttygen, select SSH-1(RSA) for the type of key to generate and choose Load to load the source .pem key

Select the .pem file that you have previously downloaded and choose Open

You will see the confirmation message as shown in the below image. Choose OK.

Provide a name for the .ppk file and choose Save.

Login to the AWS Management Console and open the EC2 service dashboard. Right click on the EC2 instance that you would like to connect to and choose connect. A popup window appears with all the information required for establishing connection. Copy the ec2-user@XXXXXcompute-1.amazonaws.com shown under the Example section

Now open the putty session and paste the above copied string in the Host Name, type in Port as 22 and choose SSH for the connection type.

Click on Auth under SSH and choose Browse to select the .ppk file that you have saved previously and choose Open.

You will see the security alert if you are connecting to a server the first time. Choose Yes

Success !!! You are now connected to the Linux EC2 instance from a windows machine.

See also  How to create AMI of an EC2 Instance