I have an EC2 instance with (OS) Debian 11 installed and I'm having problems connecting using the EC2 Instance Connect endpoint where it shows the error
Failed to connect to your instance
Error establishing SSH connection to your instance. Try again later.
I made all the necessary settings like:
- IAM (user)
- Permissions ( user )
- Endpoints
- instance region
- Choice of AMI id
- Instance type ( t2.micro )
- Key Pair
- VPC id
- sub net id
- Security Group Id
Below is the configuration of permissions to establish connection with the instance, in Json format, and also follows the rules defined for SSH connection:
Custom Permission
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EC2DescribeInstances",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeInstanceConnectEndpoints"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Sid": "EC2InstanceConnect",
"Action": [
"ec2-instance-connect:SendSSHPublicKey",
"ec2-instance-connect:OpenTunnel",
"ec2-instance-connect:SendSerialConsoleSSHPublicKey",
"ec2:CreateInstanceConnectEndpoint",
"ec2:CreateNetworkInterface",
"ec2:CreateTags",
"iam:CreateServiceLinkedRole"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
Rules ( Security Group )
... IPv6 HTTP TCP 80 Custom ::/0 –
... IPv4 HTTPS TCP 443 Custom 0.0.0.0/0
... IPv6 HTTPS TCP 443 Custom ::/0
... IPv4 SSH TCP 22 Custom 177.16.108.18/32
... IPv4 HTTP TCP 80 Custom 0.0.0.0/0
0v0 ( I don't know if OS Debian 11 is compatible with the EC2 Instance Connect endpoint, maybe that's why the error is happening, thanks to anyone who can help me ).
I did the tests with instances of the Debian and Ubuntu type but I wasn't successful (perhaps due to lack of compatibility). Only with Linux from Amazon I was able to establish a connection. Thanks for the help...
You're welcome John. Can you accept the answer please, this will help anybody with the same issue in future as they will see that this is the accepted resolution.