Cannot connect to EC2 Instance shared from another account using RDP

0

So, here is what has been done. A Windows Server 2019 EC2 instance was created under one account and we decided that this needed to be moved to another account in a different region. So, I created an AMI from the original instance and copied it over to the correct region that we need it in. I then shared the AMI with the new account. I then logged into the destination account that the AMI was shared with. I launched an instance from that shared AMI. From what I have read, the new instance would use the same password that was created from the original instance that the AMI was created from. I have tried connecting to the new instance using RDP with the same password as the original one and it prompts me to enter the password stating that the credentials were wrong. I went back and attempted to get the Windows password from the instance and it just keeps saying "Password is not available. Please wait at least 4 minutes after launching an instance before trying to retrieve the auto-generated password." even though it has been way past the 4 minute mark. I have read from a repost that I should reset the administrator password, however, in the resolution it says to use the console to configure EC2Launch or EC2Config and to use RDP to connect to the instance. Well, that is my whole problem. I cannot RDP into the instance. So, I am confused as to what I need to do.

rminter
asked 4 months ago292 views
2 Answers
2
Accepted Answer

Hello there,

Greetings of the day and I hope you are well!

Thank you for reaching us through AWS Repost

I can understand you have the following query : "Cannot connect to EC2 Instance shared from another account using RDP"

• You might receive the following error when you try to connect to an Amazon EC2 Windows instance launched from Custom AMI :
	"Password is not available yet. Please wait at least 4 minutes after launching an instance before trying to retrieve the auto-generated password."
• If you continue to receive this error after the four-minute wait, verify if you correctly configured the local administrator account's password, and or check if the password entered is correct by first typing it in plain text in notepad first.
• By default, EC2 Windows instances that launch from a public Amazon Machine Image (AMI) use one of these services to automatically generate the administrator password:
	○ EC2Launchv2: for instances that run Windows Server 2022 and later 
	○ EC2Launch: for instances that run Windows Server 2016 and later
	○ EC2Config: for instances that run Windows Server 2012 R2 and earlier
Note: It's a best practice to change the administrator password from the default, generated password to your own password.
• Instances that you launch from custom AMIs take the administrator password from the source instance. However, you can change the default password for the administrator account in the source instance that you used to create the AMI. In this case, the new instance takes the same password. To successfully connect to a new instance, the instance's password must match the administrator password. 

You have mentioned you are entering same password from original instance and still getting incorrect password prompt, which is not expected. You can follow below steps/articles to troubleshoot this issue :

• Please check if the original instance has EC2Launch, EC2Config or EC2Launchv2 installed. You can follow one of the articles mentioned below (depending upon the agent installed on the instance) to Reset the Windows administrator password :
	○ https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Launch.html
	○ https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Launchv2.html
	○ https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Config.html

• Check if the instance is managed via SSM. You can go to Systems Manager>Fleet Manager console to see if your EC2 is showing online. If yes, then follow below article to reset access to the EC2 :
	○ https://docs.aws.amazon.com/systems-manager/latest/userguide/managed-instances-password-reset.html
	○ https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-ec2reset.html

• Why can't I connect to my Amazon EC2 Windows instance that was launched from a custom AMI?
	○ https://repost.aws/knowledge-center/ec2-windows-password-not-available-error

• Troubleshoot connecting to your Windows instance - https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/troubleshoot-connect-windows-instance.html

I hope that the above provided information is useful to you, in case you need detailed technical guidance I would suggest opening a Support Case with our Team using:

[+] Creating support cases and case management - Creating a support case - https://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-case

Thank you and Have a great day ahead!

AWS
SUPPORT ENGINEER
answered 4 months ago
profile picture
EXPERT
reviewed 17 days ago
0
profile picture
EXPERT
answered 4 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