By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Uable to connect to an EC2 instance created out of an AMI of another instance.

1

I am using the free tier (t2.micro) Windows EC2 instance. I created an AMI out of this instance and launched another instance (free tier t2.micro) out of that. Everything went well, but I'm unable to connect to this new instance using RDP. It reports ... Password is not available. The instance was launched from a custom AMI, or the default password has changed. A password cannot be retrieved for this instance. If you have forgotten your password, you can reset it using the Amazon EC2 configuration service. For more information, see Passwords for a Windows Server instance. I did some research and found from (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/common-messages.html) that this happens when my Windows instance isn't configured to generate a random password. I checked the EC2Launch settings of the initial instance from which we created the AMI and the following settings are shown. EC2LaunchSettings I do see that the 'Random' radio button is checked and assume that the AMI that was created with password generation enabled. Any idea what's happening ? How can I connect to the new EC2 instance ? Thanks Dipankar

asked a year ago602 views
1 Answer
3
Accepted Answer

Hello,

As you may know EC2 instances launched from custom AMIs take the Administrator password from the source instance. If the default password for the Administrator account was changed in the source instance used to create the AMI, then the new instance takes the same password. Decrypting the password using a key pair file isn't possible, unless you configure EC2Launch or EC2Config to generate a new password on the next instance boot.

However, it should not be a problem if the AMI was sysprep’d before creation like you said, and initialization tasks from EC2Launch was configured to enable auto-generated passwords.

Following the below docs might help you to connect the EC2 instance with reset password, [1] - https://repost.aws/knowledge-center/reset-admin-password

[2] - https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword.html

[3] - https://repost.aws/knowledge-center/ec2-windows-password-not-available-error

profile pictureAWS
SUPPORT ENGINEER
answered a year ago
profile picture
EXPERT
reviewed 8 months ago
  • Thanks for the help and guidance. Being new to AMI and recreating instances from them, I knew that I would have to go through the learning curve. My research too directed me towards the EC2Rescue and Run Command. Eventually, things got moving.

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