How to Connect an EC2 Linux Instance Using SSH

This tutorial explains, how to connect ec2 instance using SSH. In the previous tutorial, we explained how to create ec2 instance in aws. Click here to go to previous page.

Create Instance

Don't Miss

In the previous post, we already explained how to create EC2 instance using AWS. We can get the reference from how to create EC2 instance using AWS tutorial.

Check Instance Status

Once the instance is active then status of instance is running. Private IP assigned to Instance of AWS dynamically.
Running Ec2 Instance

Creating Elastic IP & Associate Elastic IP to Instance

Elastic IP is the static public IP that provided by AWS. When we create instance then we will get the dynamic private IP address attached with instance. Private IP always changed when we reboot/ stop instance. So, we will connect static public ip with instance. Follow below step to create Elastic Ip and associate to our instance:

  1. Go to Elastic Ip

    Click on the Elastic IPs under the Network & Security section of EC2 Dashboard.

  2. Allocate Elastic IP Address

    Click on the Allocate Elastic IP Address to go further action
    Allocate Elastic IP Address-min

  3. Allocate Public IPv4 address pool

    Allocate an Elastic IP address by selecting the public IPv4 address pool from which the public IP address is to be allocated. Elastic IP addresses incur charges if they are not associated with a running instance or a network interface that is attached to a running instance. Click on the Allocate button to create Elastic IP.

    Associate_Elastic_IP_Address-min

  4. Associate Elastic IP address

    • Click On the Action button then click on Associate Elastic IP Address
    • Search for instance & Associate the Private IP to it.
    • Associate_IP_Address-min
      Elastic_IP_Assoicated-min

    • Now We can see Elastic IP attached with Instance.
      Insatance_Associated_With _Instance-min
  5. Set the Permission of Key File

    In the previous tutorial, we downloaded the key file. Make sure our key (pem file) matches with instance key pair name. Set the permission 400 permission of key file.

$ chmod 400 OUR_KEY.pem;

Login to Ec2 using SSH

Now, we can connect via Public DNS (IPv4). Open terminal & use the below command:

$ ssh -i /PATH/OUR_KEY.pem user_name@public_dns_name
connect_ec2_using_ssh-min

Finally, we login to EC2 instance using SSH.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

564FansLike

Recent Posts

Concept of Session in Laravel Tutorial

Sessions are used to store details about the user throughout the requests. Laravel supplies various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used as a result of it's light-weight....

Laravel Url Generation Tutorial

Our web application revolves around routes and URLs. After all, they're what direct our users to our pages. At the end of the day, serving pages is what any web application should do. Our users may...

Concept of Laravel Views Tutorial

In MVC framework, the letter "V" stands for Views. It separates the application logic and presentation logic. Views are saved in resources/views listing. Generally, the view contains the HTML which might be served by the application.

Related Articles

Concept of Session in Laravel Tutorial

Sessions are used to store details about the user throughout the requests. Laravel supplies various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used as a result of it's light-weight....

Laravel Url Generation Tutorial

Our web application revolves around routes and URLs. After all, they're what direct our users to our pages. At the end of the day, serving pages is what any web application should do. Our users may...

Concept of Laravel Views Tutorial

In MVC framework, the letter "V" stands for Views. It separates the application logic and presentation logic. Views are saved in resources/views listing. Generally, the view contains the HTML which might be served by the application.
WP2Social Auto Publish Powered By : XYZScripts.com