Issue
I am new to AWS and I have created a new Windows EC2 instance. I see ways to SSH to different instances like Amazon Linux, Ubuntu using PuTTY. But not for Windows instance. Can we not connect to Windows instance using PuTTY? Any help would be appreciated. Thanks.
Solution
You can SSH to Linux and Mac instance on AWS. You can use Remote Desktop (RDP) to access Windows Instances.
Suppose you wanted to SSH into a Windows instance, then you would have to install OpenSSH. Which would still require access to the Windows instance.
AWS offers a few ways to access your Windows instance, one of them is AWS Systems Manager Session Manager (SSM). You would need to enable RDP through SSM. You can find out how to do this via this workshop. Alternatively configure SSM to run powershell commands against the instance Note the instance must have a role that has IAM access to SSM. If the instance is in a private VPC it would require access to SSM via endpoints.
If your instances is in a public subnet, and has a public IP address then you can easily connect to your Windows instance using RDP. Note just like your EC2 Instances running Linux, the security group must allow access. In this case it must be to RDP (3389) and not SSH (Port 22). You can read more about the prerequisites here.
When you created your Windows EC2 instance, you were asked to create a key. You can use this key to get the Windows password, assuming you used an AWS AMI.
Access your password
Follow these steps (From the documentation here):
Open the Amazon EC2 console, and then choose Instances.
Select the check box for the instance, and then expand the Actions dropdown list. If you're using the old console, then choose Get Windows Password. If you're using the new console, choose Security, and then choose Get Windows Password. Note: It can take a few minutes for this option to be available after you first launch a new instance.
Choose Browse, select your key pair file, and then choose Open.
-or-
Paste the contents of your key pair into the text box. Choose Decrypt Password.
Connect to the Instance
On the password screen, Choose Download remote desktop file. Your browser prompts you to either open or save the RDP shortcut file. Select the option to save the file. When you have finished downloading the file, choose Cancel to return to the Instances page.
Navigate to your downloads directory and open the RDP shortcut file.
You might get a warning that the publisher of the remote connection is unknown. Choose Connect to continue to connect to your instance.
The administrator account is chosen by default. Copy and paste the password that you saved previously.
You can also use EC2 Serial Console to access an EC2 instance running Windows, this is great to debug boot issues.
Due to the nature of self-signed certificates, you might get a warning that the security certificate could not be authenticated. Use the following steps to verify the identity of the remote computer, or simply choose Yes (Windows) or Continue (Mac OS X) if you trust the certificate.
For more details on how to connect, visit this site.
Answered By - Jason