AWS

How to Connect to AWS EC2 Instance from Ubuntu

Amazon Web Services provides multiple services on the cloud for users across the globe. You can create an EC2 virtual machine on the cloud and connect to it using a simple command. Once the connection is made, you are inside the instance and use another operating system on your system. This post will discuss connecting to an AWS EC2 instance from Ubuntu.

Connect to AWS EC2 Instance from Ubuntu

To connect to the AWS EC2 instance, click on the “Launch Instances” button from the EC2 console:

Type the name of the instance and select “Ubuntu” as the machine image:

Scroll down the page, create a key pair file from the mentioned link in the screenshot below and select the type of instance. At the end, click on the “launch Instance” button to create an EC2 instance:

After the instance creation, select the instance from the list and click on the “Connect” button:

Select the “SSH client” section and copy the command from the platform:

Open the Terminal on Ubuntu and Paste the command on the Terminal to connect to the instance. After pasting the command simply change the path of the key pair file from your system:

ssh -i "/home/ubuntu/Downloads/bc.pem" ubuntu@ec2-18-142-229-148.ap-southeast-1.compute.amazonaws.com

This command will connect the AWS EC2 instance:

After the command is executed you will be prompted to type “Yes” to continue with the connection:

You have successfully connected to AWS EC2 from Ubuntu:

Conclusion

To connect to an EC2 instance you have to create an EC2 instance from the console inside the Ubuntu OS. Once the EC2 instance is ready simply connect with the EC2 instance from the platform. From there use the SSH client section to copy the command for the connection. Simply paste the command on the ubuntu terminal and press enter. It will prompt the user to enter “Yes” to continue the connection process.

About the author

Abdul Mannan

I am curious about technology and writing and exploring it is my passion. I am interested in learning new skills and improving my knowledge and I hold a bachelor's degree in computer science.