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
질문됨 2년 전706회 조회
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
전문가
답변함 2년 전
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
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠