EC Instance Connect says "Failed to connect to your instance"

0

Hello Forum;

My instance is AlmaLinux 8.8. The instance OS is the recommended, or maybe required, operating system for the cPanel platform. I established the instance from the AWS Marketplace using the cPanel&WHM for AlmaLinux option.

The EC Instance Connect function via the Connect to instance page in my AWS control panel is not working (see images).

I have set the permissions on port 22 to allow for my IP address at: EC2 > Security Groups > sg xxxyyyxxx > Edit inbound rules

The instructions on the page recommened at the error page do not address my specific Linux version: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html

I'm not sure it matters but the IP address (redacted with grey block) on the instance screenshot was (I think) the initial IP address before I established an elastic IP address. In other words, it's the initial IP address instead of the current elastic IP address. (the bottom image with the black background)

I would appreciate help with my problem. Thank you in advance.

EC Instance Connect

Connect to instance

Source: EC2 > Instances > i-xyzabcxyzetc. > Actions (dropdown menu) > Monitor and troubleshoot > Get instance screenshot Instance screenshot

knox
asked 9 months ago413 views
2 Answers
1

Afraid that EC2 Instance Connect cannot be used with Alma Linux.

The link in your original message https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html and look at the very first thing on that page.

To connect to an instance using EC2 Instance Connect, the instance must have EC2 Instance Connect installed. The following AMIs come preinstalled with EC2 Instance Connect:

Amazon Linux 2 2.0.20190618 or later

Ubuntu 20.04 or later

Alma Linux isn't on this list, so won't be pre-installed in your AMI.

Moreover, EC2 Instance Connect isn't supported on Alma Linux AMIs https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-prerequisites.html#eic-prereqs-amis so you're not even going to be able to install it yourself and then use it.

You will need to connect to your instance using an SSH client like PuTTY (if you are on Windows, which your browser screenshots looks like you are). You're on the right track with security groups, make sure that TCP port 22 is open inbound from your IP (at a minimum, for troubleshooting purposes open TCP from 0.0.0.0/0 i.e. everywhere, you can always close it up later on).

Make sure the instance is provisioned into a subnet that has an Internet Gateway associated with it (if you're in a default subnet in the default VPC then this will already be in place) and the default user for Alma Linux appears to be ec2-user (see usage instructions in https://aws.amazon.com/marketplace/pp/prodview-mku4y3g4sjrye ).

profile picture
EXPERT
Steve_M
answered 9 months ago
0

Can you please take a look at Resolution section of this re:Post Knowledge Center Article.

One of the four options would certainly help you as these are most common cases, where this issue occurs.

Feel free to comment here if that doesn't help

profile pictureAWS
EXPERT
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions