Skip to content

EC2 Instance Connect cannot connect to my instance !

0

EC2 instance connect cannot connect to my instance. It shows error as seen in the image attached

Enter image description here

Enter image description here

Please what can I do to resolve this ?

asked a year ago254 views
2 Answers
0

This error is common when trying to connect to an EC2 instance using EC2 Instance Connect. There are several potential causes and solutions to address this issue:

  1. Security Group Configuration: The most likely cause is that your instance's security group does not allow inbound SSH traffic (port 22) from the EC2 Instance Connect IP range for your specific region. You need to update your security group's inbound rules to allow SSH traffic (TCP port 22) from the EC2 Instance Connect IP range for your region. In your case, you need to add an inbound rule allowing access from 13.233.177.0/29.

  2. Network Settings: Ensure that your instance is in a public subnet with an internet gateway attached, allowing for outbound traffic necessary for Instance Connect to function.

  3. Instance State: Verify that your EC2 instance is in the "running" state and not in a transitional state.

  4. IAM Permissions: Check that the IAM user or role you're using has the necessary permissions to use EC2 Instance Connect.

  5. EC2 Instance Connect Package: Make sure the EC2 Instance Connect package is installed on your instance if you're using a supported Linux distribution.

To resolve the issue:

  1. Go to the EC2 dashboard in the AWS Management Console.
  2. Select your EC2 instance.
  3. Click on the "Security" tab in the instance details pane.
  4. Find the associated security group and click on it to edit its rules.
  5. Add a new inbound rule for SSH (port 22) with the source set to 13.233.177.0/29.
  6. Save the changes to the security group.

If you've verified all these settings and still can't connect, try rebooting your instance. If the problem persists, consider using alternative connection methods like AWS Systems Manager Session Manager, or reach out to AWS support for more in-depth troubleshooting assistance.

Sources
EC2 instance failed to connet | AWS re:Post
EC2 Instance Connect Fails to Connect - Network Configuration Issues or Misconfiguration? | AWS re:Post
Troubleshoot connection with EC2 Instance Connect | AWS re:Post
Why unable to connect with Instance Connect despite all inbound and outbound ports open | AWS re:Post

answered a year ago
EXPERT
reviewed a year ago
EXPERT
reviewed a year ago
0

Hello.

In addition to the AWS re:Post Agent answer, looking at the image you shared, one EC2 status check is failing.
This may be due to a problem with the OS inside the EC2 instance, which is causing the connection to fail.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html

The solution will vary depending on the cause, but first try starting and stopping the EC2 instance.
https://repost.aws/knowledge-center/ec2-linux-status-check-failure

EXPERT
answered a year ago
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.