- Newest
- Most votes
- Most comments
You shouldn't need a public/private keypair setup to login to an instance using EC2 Instance Connect.
Was this instance always able to be connected to using Instance Connect before today? Has anything changed in the networking, such as changes to a route table or the presence/absence of an Internet Gateway?
Might be worth checking that the instance itself is healthy, and that the EC2 section of AWS Console is the Status check column showing all checks passed (could be 2/2 or 3/3).
The error message dialogue directs you to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-prerequisites.html It would be worth going through the list of items on this page.
Hello,
It may also be worth checking to ensure your network connection is not the issue here.
Also, confirming that the instance is still up and running, as well as the firewall rule configuration - security group and NACL, may be useful.
Hello,
If you are connecting using an AWS EC2 Instance Connect, you need to allow port 22 to AWS IPs based on your region. In the link, you can search for "EC2_INSTANCE_CONNECT" and note the IP addresses based on your region, then allow port 22 to those IPs in the inbound rules.
Alternatively, you can execute the following curl command to filter and display the EC2 Instance Connect IPs:
$ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | select(.service == "EC2_INSTANCE_CONNECT")'
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 2 years ago
Yes i was able to connect to this instance and apparently no changes were made. Its just that I was previously having an error "ran out of memory'", I wonder if that's somehow the reason for for being able to connect to it. The instance is healthy and the status checks are also passed.