Thursday, 13 May 2021

CREATE EC2 AND CONNECT VIA SSH TELNET

This post provides step-by-step instructions to create an EC2 instance and access the instance via SSH telnet. As a newbie in the AWS world, I struggled a lot to understand vocabulary related to it.

Hope this is helpful and happy learning !!!

----------------------------------------------------------------------------------------------------------------------------------


Steps to create EC2 instance:

1)  Navigate to https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:sort=instanceState.

2) Under the Instance tab in the EC2 dashboard. Go for launch instance and choose the AMI type. Here I am creating a Ubuntu instance.

3) Click next and choose the instance type. I have chosen the free tier here.

Instance Type
EC2 Instance Type

4)  Clik next and I am using the default VPC that is created when your AWS account is created and select any one of the subnets in which you want to launch your instance.

Instance Details
EC2 Instance Details


5) Clik next and go for “Add Storage”. Here I have chosen the basic volume type and size as default.

Storage
EC2 Storage

6)  Next add tag which is optional, if you have numerous number of instances running then it is better to add a unique tag name for recognition. 

I have added a tag for example.

Tag
EC2 Tag

    7) Then navigate to “Configure Security Group” and add the rule as below which allows any IP address can access the instance. You can SSH instance, if only you add this rule.

Security Group
EC2 Security Group

8) After this, we can “Review and Launch” the instance. While launching the instance create a new key pair or use the existing key pair.

Key pair allows you to connect to your instance securely. 

Accept the terms and condition and download the key pair, it will be in .pem format.

Key Pair
EC2 Key Pair


The instance might take few minutes for up and running.

----------------------------------------------------------------------------------------------------------------------------------

Steps to convert key pair from PEM into PPK format


You have to convert the key pair from PEM format to PPK format to access the EC2 instance.

    1) Open puttygen.exe and load the PEM file.

    2) The type of key to generate should be SSH-2 RSA and the number of bits generated should be 2048.

puttygen.exe
puttygen.exe

3) 
Once the file is imported, go ahead and save the file as private key.

----------------------------------------------------------------------------------------------------------------------------------

Steps to connect to the instance via SSH :

    1) Open putty and use the private IP address of the instance, which will be available under the Networking tab of the instance.

    2) And load converted PPK file under CONNECTION -> SSh ->AUTH. 

Putty
Putty

    3) And click open. Now login with user name as ubuntu, it requires no password.

Ubuntu EC2 Instance
Ubuntu EC2 Instance

    Voila !!! Now you are connected to the instance.

No comments:

Post a Comment