AWS: Connecting to EC2 Instance (Linux Server)

In this article, we will go through the steps for connecting to a simple Linux server in Amazon Web Cloud service

We have seen in the previous article<link> on how to create an Amazon Web Service Linux Server

Steps to connect to AWS EC2 Linux Instance

Step 1: Login to the Amazon console, using username/password created in the previous article

From the services Menu, select Compute -> EC2 Submenu

0_aws_linux_instance_creation_service_select

 

Step 2: Once EC2 dashboard is displayed, you will find a table listing EC2 instances

The Linux instance created in the previous article will also be seen here

0_instance_dashboard

If the instance is in ‘Stop State’ as shown in the image above, it will not have a public IP address assigned to it

 

Step 3: In order to connect to this Linux instance, first we need to start the server up

Right click on the server instance and select Instance State –> Start

1_aws_linux_instance_connect_Start

 

When the server reaches the ‘Running state’ it will get a public IP address assigned to it.

We will wait till the ‘Status Check’ is complete

1-A_aws_linux_instance_connect_Running

 

Step 4: In the previous article, before launching the Linux instance, we have created a key pair named “testserver.pem”

We need this key pair to connect to the Linux instance. Since, key is in .pem format, first we need to change it to .ppk format

For that we need PuttyGen tool

Open PuttyGen tool and Load the previously saved key

2_PuttyGen_open

Traverse to the .pem file stored previously and select it

Note: Remember to change the filter from ‘.ppk’ to ‘All files’

3_puttygen_load_pem

If selected file is imported correctly, you will receive a popup message as below

4_puttyGen_load_key_successful

Click on the ‘Save private key’ button and save the .ppk file on your machine. A popup message will be seen asking if you want to save the key without a passphrase

Click Yes

5_puttyGen_save_privat_key

Save the file in .ppk format

6_puttyGen_save_private_key

 

Step5: Open a putty terminal and go to the Session pane suing the left hand side options

7_putty

 

In the Host Name (or IP address) textbox, enter public IP address of the Linux server created in the previous article

8_putty_ip

 

Now go to the SSH-> Auth pane using the Left hand side options

9_putty_Auth

 

Using the ‘Browse’ button traverse to the location where the newly created .ppk key file is saved

Select the key file ‘testServerKey.ppk’ and return back to the Session pane

9_putty_Auth_load_key

10_putty_Auth_open

Now Press the ‘Open’ button on the Session Pane

11_putty_Auth_open_yes

You will receive a message informing that server host key is not cached in your registry

Additionally it will also display the fingerprint of the key. Press ‘Yes’ button

11-A_putty_Auth_open_yes

It will be prompt to enter the user name. Enter ‘ec2-user’ which is the default user for newly created Linux server in AWS cloud

12_putty_user_login

Press enter and you will be logged into the Linux server successfully

13_putty_user_successful

Happy Reading !!
Happy Learning !!

Deploying ASP.NET MVC Web application to AWS using Visual Studio 2017
AWS: EC2 instance creation (Linux server)