Unable to connect to EC2 using SSH or Instance Connect

0

Error with Instance connect:

Failed to connect to your instance EC2 Instance Connect is unable to connect to your instance. Ensure your instance network settings are configured correctly for EC2 Instance Connect. For more information, see Set up EC2 Instance Connect at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html.

Error with SSH: ssh: connect to host <ec2ip>.<region>.compute.amazonaws.com port 22: Operation timed out

I followed this post but still no resolution : https://repost.aws/questions/QUXaZXuLx9QAKGa1o5vdlfkw/ec2-instance-error-failed-to-connect

AWS
已提問 1 年前檢視次數 508 次
2 個答案
2

I don't know what your configuration looks like so my apologies for not being able to give specific guidance. Assuming you've followed the steps outlined in the link you shared, then perhaps it's some condition not met from the prerequisites. Can you check to see if you've checked all the boxes in terms of Region, AMI, grant permissions, and the like?

profile pictureAWS
專家
pechung
已回答 1 年前
0

Hi,

Since this is a timeout error, the most likely scenario is that this is related to the network connectivity.

I would check on the following

  1. If the instance has access to the internet
  2. Check if SSH port (22) is allowed for inbound traffic from the security group and if the network ACL allows both inbound and outbound for port 22.
  3. If you are using browser-based SSH connection (Using the EC2 connect option in the EC2 Console) you will need to allow inbound traffic in your security group from EC2 connect IP range for your region in addition to your own IP.

IP Ranges -> https://docs.aws.amazon.com/vpc/latest/userguide/aws-ip-ranges.html

Simply search for EC2_INSTANCE_CONNECT and look for the IP range for the region your instance is located.

{
      "ip_prefix": "13.48.4.200/30",
      "region": "eu-north-1",
      "service": "EC2_INSTANCE_CONNECT",
      "network_border_group": "eu-north-1"
    },

Hope this helps

profile picture
Bisina
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南