- Newest
- Most votes
- Most comments
Hello.
Are you using EC2 Instance Connect to connect to EC2?
In that case, you must meet the prerequisites listed in the following documents:
A common problem is that the security group does not allow the IP address of EC2 Instance Connect.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-prerequisites.html
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 2 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago