3 Ways to Recover / Reset Windows EC2 AWS Password
Locked out of your Windows EC2 instance? Don’t have the SSH PEM from when you launched your instance? Or the password has been changed/lost?
Below are hree simple ways reset Windows Password, I assume that you have appropriate IAM user/role to the EC2 console and are logged in.
Session Manager:
You need port 443 open in your instance’s security group to either your System Manager VPC endpoint or 443 to the internet. This article below contains endpoints if you don’t want to open 443 to 0.0.0.0/0
https://docs.aws.amazon.com/general/latest/gr/ssm.html
Secondly you need to have a role associated with the instance that has the Systems Manager permissions, you can use the Session Manager connection option in the EC2 console to connect. Once connected, you can then use the cli to reset the password by running this command;
net user administrator password
This article below contains details on setting up Systems Manager if required.
Systems Manager:
Again, with a Systems Managed instance, you can run the automation document that is used to reset the password. The following guide explains how to do this from the Systems Manager console and once you click the Reset Password button, Systems Manager will do the rest for you.
https://docs.aws.amazon.com/systems-manager/latest/userguide/managed-instances-password-reset.html
EC2Rescue:
Finally, EC2Rescue can be used to reset the password. This process requires a Helper Instance to attach the root volume to and the EC2Rescue tool downloaded. Once set up it is a GUI driven wizard to reset the password. The following guide explains this process in greater detail.
https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2rw-gui.html
This blog was originally published on October 8, 2020, and has since been republished.