I previously wrote an article on how to connect to a Linux EC2 instance using SSH through Terminal. In this article, we’ll talk about connecting to and remotely managing your Windows Server EC2 instance from your Mac.
The first thing you’ll need is a running Microsoft Remote Desktop installation. It should be easy because Microsoft Remote Desktop is listed in the App Store. Just enter “remote desktop” in the search box to display the application you’re looking for.
As of this writing, there are two versions displayed in the App Store. You need to install the latest version – version 10. This is the one marked with a round icon.
Once the installation is complete, you can access the Remote Desktop by opening Launchpad (F4 key) and selecting its icon. We use our RDP (Remote Desktop Protocol) client quite often, so we put it in the Dock for easier access. To place yours there, simply drag the icon into the Dock.
Tap the icon to launch the application. Here’s our working installation of Microsoft Desktop with several saved desktops.
To connect to an EC2 instance, you need three pieces of information:
- the public DNS hostname or public IP address,
- the admin username, and
- Administrator name, password
To get the public DNS hostname or IP address, go to your EC2 control panel, go to the Instances menu, and then select the EC2 instance whose hostname or IP address you want to get. You should see these pieces of information in the middle right side of the page.
The default administrative username is just Administrator. However, there are a few things you need to do to get the password that matches that username.
First, while you are starting an instance (ie, even before it is created and added to the list of instances shown above), select the key pair you want to associate with this instance. We’ve already outlined the steps to get a key pair in SSH to an EC2 Instance from a Mac, so I suggest you read this first.
Once the instance has started, you can continue with the password retrieval process. Select an instance, expand the Actions drop-down list and click Connect.
When the Connect to Your Instance dialog box appears, click the Get Password button.
After that, the password will be shown in encrypted form. To decrypt this, you need to specify the private key file associated with the key pair, which in turn is associated with that EC2 instance. In our example, this is myfirstkeypair.pem.
To point to the file in question, specify the path to the key pair by clicking the Select File button and then navigating to the location of that file on your local system.
After the file has been downloaded successfully, click the “Decrypt Password” button.
If the decryption was successful, you should see your password on the screen. Copy and paste this password somewhere safe.
Now that you have everything you need to connect to your EC2 instance, you can go back to the remote desktop application and connect from there.
Expand the [+] icon in the upper right corner and select Desktop.
When the Add Desktop dialog box appears, enter the public hostname or IP address of your EC2 instance in the PC Name field and click Save.
Then you should see your newly created desktop among the list of existing desktops. You can change this name to a more human-readable name by right-clicking it, choosing the Edit menu, and then changing the contents of the Friendly Name field.
To connect, simply double-click the added desktop and enter your credentials.
If all goes well, you should be able to log into your Windows EC2 instance in the cloud. Enjoy!