0

All:

I have an EC2 instance (based on Linux 2, Kernel 4.14), which seems to be in good running condition. I am able to SSH to it (using user name and password. I enabled this). I also verified that the system can be rebooted, and after it, I can still login.

I created an AMI image for the instance, and then launched an instance from the AMI. The status of this new instance showed: "2/2 checks passed", "Instance reachability check passed".

But I could NOT connect to it. When I tried to connect to it from AWS console, it always shows:

"There was a problem connecting to your instance Log in failed. If this instance has just started up, wait a few minutes and try again. Otherwise, ensure the instance is running on an AMI that supports EC2 Instance Connect."

I checked the log, the last steps were:

<14>Jan 29 07:57:25 ec2: ############################################################# <14>Jan 29 07:57:25 ec2: -----BEGIN SSH HOST KEY FINGERPRINTS----- : <14>Jan 29 07:57:25 ec2: -----END SSH HOST KEY FINGERPRINTS----- <14>Jan 29 07:57:25 ec2: ############################################################# -----BEGIN SSH HOST KEY KEYS----- : -----END SSH HOST KEY KEYS----- [ 48.990743] cloud-init[3400]: Cloud-init v. 19.3-44.amzn2 finished at Sat, 29 Jan 2022 07:57:25 +0000. Datasource DataSourceEc2. Up 48.98 seconds

Instance screenshot also shows that it is ready to be connected.

In summary, my question is, the original instance works fine. From it, an AMI image was created. And instance launched from the image can NOT be connected.

What causes this problem ? How to fix it ?

enter image description here enter image description here

david
  • 101
  • 2
  • "ensure the instance is running on an AMI that supports EC2 Instance Connect." Does the AMI you're using support EC2 Instance Connect? :) – AKX Jan 29 '22 at 18:59
  • @AKX The AMI was created from an working instance with SSH connection. – david Jan 29 '22 at 19:36
  • EC2 Instance Connect is not just SSH. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html#ec2-instance-connect-install – AKX Jan 29 '22 at 19:44
  • I checked the original working instance: "Package ec2-instance-connect-1.1-15.amzn2.noarch already installed and latest version". – david Jan 29 '22 at 19:48
  • What is the configuration of the Security Group inbound rules associated with the instance? Also, can you SSH into it using an SSH client (as opposed to EC2 Instance Connect)? – John Rotenstein Jan 29 '22 at 23:11
  • 1
    I can NOT SSH into it using an SSH client. Security Group is NOT issue. I checked SSH port are open. – david Jan 29 '22 at 23:34
  • @david Did you find any solution to this? – Queen Sep 11 '22 at 18:00
  • @Queen: I did NOT find a solution. – david Sep 14 '22 at 02:36
  • @david For me it worked with the old password of the instance from which the image was created – Queen Sep 19 '22 at 18:44

0 Answers0