Troubleshoot connecting with EC2 Instance Connect (2024)

I receive the following error when I use Amazon Elastic Compute Cloud (Amazon EC2) Instance Connect to connect to my Amazon EC2 instance: "There was a problem setting up the instance connectionLog in failed. If this instance has just started up, try again in a minute or two."

Short description

The following are common reasons why you might receive an error when you use EC2 Instance Connect to connect to your instance:

  • EC2 Instance Connect doesn't support the operating system (OS) distribution.
  • The EC2 Instance Connect package isn't installed on the instance.
  • There are missing or incorrect AWS Identity and Access Management (IAM) policies or permissions.
  • Security groups that are associated with the instance don't list EC2 Instance Connect service IP addresses.
  • The network access or configuration is incorrect.

If your instance doesn't have a public IP address, then you must establish private network connectivity to your virtual private cloud (VPC). To establish private network connectivity to your VPC, use AWS Direct Connect, AWS Site-to-Site VPN, or VPC peering.

If your instance doesn't have a public IPv4 address, and your VPC doesn't have a private network connectivity configuration, then use EC2 Instance Connect Endpoint.

Note: If you turned on the EC2 serial console for Linux instances, then use the serial console to troubleshoot Nitro-based instance types. To access the serial console, use either the Amazon EC2 console or the AWS Command Line Interface (AWS CLI).

If you can't reach your instance and you didn't configure access to the serial console, then see Configure access to the EC2 serial console.

Note: If you receive errors when you run AWS CLI commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Resolution

To troubleshoot issues when you connect to your EC2 instance, confirm the following configurations:

Use browser-based SSH connections

Browser-based SSH connections require that your instance's security group inbound rules allow EC2 Instance Connect access to SSH on TCP port 22.

EC2 Instance Connect uses specific IP address ranges for browser-based SSH connections to your instance. These AWS IP address ranges differ between AWS Regions. To find the IP address range for EC2 Instance Connect in a specific Region, run the following commands.

Note: In the following commands, replace us-east-1 with the Region that your instance is in. Be sure your instance is in a Region that EC2 Instance Connect supports.

The following Windows command requires Windows PowerShell for AWS:

PS C:\> Get-AWSPublicIpAddressRange -Region us-east-1 -ServiceKey EC2_INSTANCE_CONNECT | select IpPrefix

The following Linux command requires curl and jq:

$ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json| jq -r '.prefixes[] | select(.region=="us-east-1") | select(.service=="EC2_INSTANCE_CONNECT") | .ip_prefix'

Update your security group inbound rules to allow TCP port 22 access from the IP address range that the preceding commands return.

Use EC2 Instance Connect CLI connection

Update your security group inbound rules to allow TCP port 22 access from your IP address.

Related information

Connect to your Linux instance with EC2 Instance Connect

How can I connect to my Amazon EC2 instance if I lost my SSH key pair after its initial launch?

How can I troubleshoot connecting to my Amazon EC2 Linux instance using SSH?

Troubleshoot connecting with EC2 Instance Connect (2024)

FAQs

Why is my EC2 instance connect not working? ›

The EC2 Instance Connect package isn't installed on the instance. There are missing or incorrect AWS Identity and Access Management (IAM) policies or permissions. Security groups that are associated with the instance don't list EC2 Instance Connect service IP addresses. The network access or configuration is incorrect.

How can you troubleshoot connectivity issues with an EC2 instance? ›

Resolution
  1. Verify that the security group that's attached to your instance allows access to port 22 for Linux and port 3389 for Windows.
  2. Verify that your network access control list (network ACL) allows access to the instance.
  3. Verify that your route table has a route for the connection.

Why can't I connect to a website that is hosted on my EC2 instance? ›

Check that the instance has the correct DNS configuration

Make sure that the instance has an Elastic IP address assigned to it. If you stop and start your instance, then the Elastic IP address is still associated with the instance. Make sure to map the public IP address or Elastic IP address to an A-record.

How do we connect to an EC2 instance? ›

Use the Amazon EC2 console to connect (only for instances with IPv4 Public address)
  1. Open the Amazon EC2 console.
  2. In the navigation pane, choose Instances.
  3. Select the instance, and then choose Connect.
  4. Choose EC2 Instance Connect.
  5. Verify the username, and then choose Connect to open a terminal window.

How do I test my EC2 connection? ›

To connect to the Amazon EC2 instance

Sign in to the management account for your organization and open the Amazon EC2 console . In the navigation pane, choose Instances. On the Instances page, select Console VPCE test instance that was created by the AWS CloudFormation template. Then choose Connect.

Why can t my EC2 instance connect to the internet using an internet gateway? ›

A local firewall that's running in the operating system (OS) might be blocking access. As a best practice, deactivate the local firewall and use security groups instead. Note: Firewall deactivation might affect your workload.

Why is my EC2 instance not connecting through RDP? ›

Confirm you're using the correct firewall and network configuration. 2. In the output of the preceding command, verify that TcpTestSucceeded is True. This indicates that the EC2 instance is responding over the network and you can reach the required RDP port.

Why am I unable to connect to a port on an EC2 Windows instance? ›

The following issues can prevent a connection to an EC2 Windows instance on a specific port: The service that uses the port isn't running on the instance. Windows Firewall is blocking traffic to the port. A security group is blocking traffic.

Why can't i ping an EC2 instance? ›

Some EC2 instances might have ICMP (ping) responses disabled by default for security reasons. Make sure your instance's security group rules allow ICMP traffic. The ping command will keep running until you manually stop it (usually with Ctrl+C).

How to connect to EC2 through SSH? ›

Step-by-Step Guide to Connect to EC2 Instance Using SSH
  1. Step 1: Retrieve Your Instance Information. First, log in to your AWS Management Console and navigate to the EC2 dashboard. ...
  2. Step 2: Set Permissions for Your Key File. ...
  3. Step 3: Connect Using SSH. ...
  4. Step 4: Verify the Connection.
Nov 15, 2023

Why is my EC2 instance not booting up? ›

Increase the root volume size. Extend the partition. Detach the volume from the temporary instance. Attach the volume to the original instance with device name (/dev/xvda for Linux), and then start the instance to confirm that it boots successfully.

How do I regain access to my EC2 instance? ›

Here are the steps to gain access:
  1. Stop broken instance.
  2. Detach broken instance root volume.
  3. Start new instance that you can login to.
  4. Attach broken instance volume to new instance.
  5. Mount the broken instance volume at the OS level.
  6. Fix/undo the configuration on the broken instance volume.
Dec 8, 2022

Top Articles
What is a Collateralized Debt Obligation (CDO)?
21 Ways You Can Save Money Today - Project Hot Mess
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Horacio Brakus JD

Last Updated:

Views: 5815

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Horacio Brakus JD

Birthday: 1999-08-21

Address: Apt. 524 43384 Minnie Prairie, South Edda, MA 62804

Phone: +5931039998219

Job: Sales Strategist

Hobby: Sculling, Kitesurfing, Orienteering, Painting, Computer programming, Creative writing, Scuba diving

Introduction: My name is Horacio Brakus JD, I am a lively, splendid, jolly, vivacious, vast, cheerful, agreeable person who loves writing and wants to share my knowledge and understanding with you.