- Newest
- Most votes
- Most comments
If you change the administrator password then the retrieval will never work again as thats a one off
If your EC2 has a public IP and you stop and start it, the IP will change
You can reset the Admin password using Systems Manager
Based on your description, there are several potential reasons why you're unable to connect to your EC2 Windows instance via RDP:
-
Security Group Configuration: While you mentioned that you've set up inbound rules for port 3389 (RDP) to allow traffic from 0.0.0.0/0 or your specific IP, it's worth double-checking that these rules are correctly applied to the instance.
-
Network Configuration: Ensure that your EC2 instance is in a public subnet with an internet gateway attached. The route table for the subnet should have a route for 0.0.0.0/0 pointing to the Internet Gateway.
-
Windows Firewall: The Windows Firewall on the instance might be blocking RDP connections. Unfortunately, you can't verify this until you can connect to the instance.
-
Remote Desktop Service: The Remote Desktop Service (TermService) might not be running or properly configured on the instance.
-
Password Issues: Even though you're decrypting the .pem file to get the password, there might be an issue with the password retrieval process or the Administrator account might be configured differently.
Here are some troubleshooting steps:
-
Try using AWS Systems Manager to troubleshoot RDP issues. AWS provides an automation document called AWSSupport-TroubleshootRDP that can check or modify common settings affecting RDP connections.
-
If your instance has the SSM agent installed and is registered with Systems Manager, you could try connecting via Session Manager as an alternative method.
-
Consider stopping and starting the instance (not just rebooting). This can sometimes resolve connectivity issues.
-
Verify that the instance status checks are passing. If one of the status checks is failing, it might indicate an issue with the OS that's preventing RDP connections.
-
If you're using a G instance type specifically for GPU capabilities, ensure that you're using an AMI that has the appropriate GPU drivers installed.
If none of these solutions work, you might need to consider creating a new instance from a fresh AMI and ensuring all configurations are properly set up from the beginning.
Sources
Impossible to connect to ec2 windows instance | AWS re:Post
Troubleshoot issues connecting to your Amazon EC2 Windows instance - Amazon Elastic Compute Cloud
EC2 Instance Connect cannot connect to my instance ! | AWS re:Post
You mentioned it is failing to connect to the EC2 and that security group inbound rule is correct. Here are few things you can check.
- NACL inbound rule - make sure the subnet's NACL allow inbound 3389 from our IP or 0.0.0.0/0. (Better not to use 0.0.0.0/0)
- NACL outbound rule - make sure the subnet's NACL allow outbound on ephemeral port range 1024-63455. Note, NACL is rules are unidirectional, return traffic needs to be specified.
- Since you are coming over the internet, what IP address are you using? Does it have a public IP? If not, you cannot connect to it. If it only has a private IP, you will need to access it from within your environment.
Instead of opening security groups rules, it's better just to use SSM Session manager. Note, you will need IAM role that allows SSM policy - arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
Relevant content
- asked 2 years ago
Huh, I don't recall changing the administrator password, other than setting it to the .pem file... also I have an elastic ip attatched to it, so ip shouldn't change. My bad i forgot to state that.