- Newest
- Most votes
- Most comments
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:
-
Security Group Configuration: Ensure that your instance's security group allows inbound SSH traffic (port 22) from the EC2 Instance Connect IP range for your specific region. You can find these IP ranges in the AWS-provided JSON file, filtering for "EC2_INSTANCE_CONNECT" as the service value.
-
Network Settings: Verify that your instance is in a public subnet with an internet gateway attached, allowing for outbound traffic necessary for Instance Connect to function.
-
Instance State: Confirm that your EC2 instance is in the "running" state and not in a transitional state like "pending."
-
IAM Permissions: Check that the IAM user or role you're using has the necessary permissions to use EC2 Instance Connect.
-
Region-specific Issues: Review the AWS Service Health Dashboard for any ongoing maintenance or disruptions in your region that might affect connectivity.
To resolve the issue:
-
Update your security group's inbound rules to allow SSH traffic (TCP port 22) from the EC2 Instance Connect IP range for your region.
-
Double-check your VPC and subnet configurations to ensure proper internet connectivity.
-
If the problem persists, try rebooting your instance.
-
Consider using alternative connection methods like AWS Systems Manager Session Manager if SSH continues to fail.
If you've verified all these settings and still can't connect, it may be worth reaching out to AWS support for more in-depth troubleshooting assistance.
Sources
Failed to connect to your instance | AWS re:Post
Why unable to connect with Instance Connect despite all inbound and outbound ports open | AWS re:Post
AWS Instance Issue | AWS re:Post
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago