AWS

How to Connect to EC2 Instance Using Instance Connect

Learn how to connect to an AWS EC2 instance using Instance Connect.
September 20, 2023

Introduction to Instance Connect

Once you’ve launched an EC2 instance, a variety of ways are available to interact with the instance. A direct connection to the EC2 instance allows the user to issue commands at the instance level, update software, download software, verify operation, and more.

Instance Connect is a web-based method that allows the user to connect to their instances without the need of 3rd party software (unlike SSH). It’s provided by AWS and is accessible via the Instance Page through the EC2 Dashboard.

Prerequisite

To follow along with this tutorial, you will need:

Connecting Via Instance Connect

Step 1 - Navigate to the EC2 Console

1.1 - From the AWS Console, click on “Services.”

1.2 - From the drop-down menu, click on “Compute.”

1.3 - From the side menu, click on “EC2.”

Figure 2.1 - AWS EC2 Instance Connect | Navigating to the EC2 Dashboard on AWS
Figure 2.1 - AWS EC2 Instance Connect | Navigating to the EC2 Dashboard on AWS

Step 2 - Navigate to the Instance Dashboard

[Option 1] 2.1 - From the side-menu, click on “Instances.”

[Option 2] 2.2 - From Resources, click on “Instances.”

Figure 2.2 - AWS EC2 Instance Connect | Navigating to the Instances Dashboard on AWS
Figure 2.2 - AWS EC2 Instance Connect | Navigating to the Instances Dashboard on AWS

Step 3 - Access the Connect Menu

3.1 - From the list of instances, select the one you want to connect to, click on “✔️.”

3.2 - From the top menu, click on “Connect.”

Figure 2.4 - AWS EC2 Instance Connect | Connect to EC2 Instance

Step 4 - Select Connection Type & Connect to EC2 Instance

At this stage, you’re presented with a menu that contains a variety of options for you to use to connect to the instance. Note that we’ve covered the various methods in separate tutorials you can find on the main EC2 Page. For the purpose of this tutorials, we’re going to use EC2 Instance Connect

4.1 - From the top navigation bar, click on “EC2 Instance Connect.”

4.2 - From the Connection Type, click on “Connect using EC2 Instance Connect.”

4.3 - If you’re using the default AWS AMI, the “User name” field should be “ec2-user”. If you’re not using the Amazon AMI, the username may be different. If the username is incorrect, you’ll receive an error when trying to connect.

4.4 - On the bottom of the page, click on “Connect.”

Figure 2.4 - AWS EC2 Instance Connect | Connect via EC2 Instance Connect

Conclusion on Instance Connect

Once you complete the steps above, you should be presented with a new tab that will contain a Linux CLI that is running on your EC2 Instance. At this point you may proceed with installing, updating, removing, and other actions you’d need to perform on your instance.

Figure 3.1 - AWS EC2 Instance Connect | Instance Connect Linux Commands on AWS EC2 Instance