How to Remotely Connect to Your Amazon AWS EC2 Mac Desktop with ProRDP
Install ProRDP on an Amazon EC2 Mac instance and connect to its desktop from any RDP client, through an SSH tunnel, Session Manager, or Tailscale, without exposing it to the internet.
An Amazon EC2 Mac instance is a real Mac mini (or Mac Studio) in an AWS data center. Out of the box,
the only way in is SSH as ec2-user. This guide installs ProRDP on the instance so you can use its
full desktop from Remote Desktop Connection, Windows App, or any other RDP client, and reach it
without opening it to the internet.
Before you start
You’ll need:
- An EC2 Mac instance running macOS 15 Sequoia or later. ProRDP doesn’t support earlier versions. Every EC2 Mac instance type can run a Sequoia AMI, and Apple silicon instances can also run newer releases.
- The key pair you launched the instance with, and SSH access to it (TCP port 22) from your computer. In the instance’s security group, set the SSH rule’s source to My IP, not Anywhere.
- An RDP client on the computer you’ll connect from, such as Remote Desktop Connection (
mstsc) or Windows App on Windows, Windows App on a Mac, or FreeRDP on Linux. - An SSH client. macOS and Linux include one, and Windows 10 and 11 include OpenSSH, so the same
sshcommands work in PowerShell.
EC2 Mac instances run on a Dedicated Host, which AWS bills for a minimum of 24 hours.1 If you’re using the instance for work, such as a build machine or a team’s test Mac, you need a commercial license for it. ProRDP works the same either way.
In the commands below, replace my-key.pem with your key pair file and
your-instance-public-dns with your instance’s Public DNS (or public IP
address), both shown in the EC2 console.
Step 1: Set a password for ec2-user
The ec2-user account has no password by default, and you need one to sign in to the desktop.
Connect to the instance over SSH:
ssh -i my-key.pem ec2-user@your-instance-public-dnsSet a password, and enter a long, unique one when prompted:
sudo passwd ec2-user
Step 2: Open the desktop once over Screen Sharing
You need to see the desktop once, using built-in Screen Sharing (VNC). AWS uses the same approach in its own guide.2 You’ll turn it off again in step 5.
In the same SSH session, turn on Screen Sharing:
sudo launchctl enable system/com.apple.screensharing sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plistType
exitto close the SSH session, then reconnect with a tunnel for Screen Sharing’s port, 5900. Leave this window open while you work:ssh -i my-key.pem -L 5900:localhost:5900 ec2-user@your-instance-public-dnsConnect a VNC client to
localhost:5900:- On a Mac, open Finder, choose Go › Connect to Server, and enter
vnc://localhost:5900. - On Windows or Linux, use a VNC client such as TigerVNC.
- On a Mac, open Finder, choose Go › Connect to Server, and enter
Sign in as
ec2-userwith the password from step 1.
The connection goes through SSH, so port 5900 never needs to be open in the security group.
Step 3: Install ProRDP
In the Screen Sharing window, on the instance’s desktop:
- Open Safari and download the latest release.
- Open the downloaded DMG file and drag ProRDP to the Applications folder.
- Launch ProRDP, read the Terms of Use, and click Agree.
- Grant the two permissions ProRDP asks for: Screen Recording and Accessibility, in System Settings › Privacy & Security.
- Quit and reopen ProRDP, so macOS applies the permissions.
Step 4: Set up ProRDP to run unattended
Nobody will be sitting at this Mac, so set it up to come back by itself after a restart.
- Choose an account. In the Account pane, keep ProRDP account
and set a username and password your RDP client will sign in with. It’s a separate credential
just for remote sessions, so it can’t be used to sign in to the instance over SSH or unlock the
Mac. If you’d rather sign in as
ec2-user, choose macOS account instead. - Start at login. In the General pane, turn on Launch ProRDP at login and Start the server when ProRDP launches.
- Stay awake. Leave Keep this Mac awake set to Always.
- Log in automatically. ProRDP runs inside a logged-in user’s session, so if the instance
reboots, someone has to be signed in for it to start. In System Settings › Users & Groups,
set Automatically log in as to
ec2-user. EC2 Mac instances don’t use FileVault, so macOS offers this option. - Start the server. Click Start in the General pane. It shows Listening on with the port, 3389 by default.
Step 5: Turn off Screen Sharing
Disconnect the VNC client and close the tunnel window. ProRDP replaces Screen Sharing from here on, so turn it back off. SSH in again and run:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
sudo launchctl disable system/com.apple.screensharing
If you ever need it again, for example to fix a problem with ProRDP, rerun the commands from step 2.
Step 6: Open an SSH tunnel
An SSH tunnel carries your RDP session inside the SSH connection you already use, so port 3389 stays closed in the security group and only someone with your key pair can reach it.
On the computer you’ll connect from, run:
ssh -i my-key.pem -N -L 13389:localhost:3389 ec2-user@your-instance-public-dns
-L 13389:localhost:3389forwards port 13389 on your computer to ProRDP on the instance. It uses 13389 rather than 3389 locally, because a Windows PC with Remote Desktop turned on already uses 3389 itself.-Nopens the tunnel without a shell. The command doesn’t print anything; leave it running for as long as you’re connected, and press Control-C to close it.
Step 7: Connect from your RDP client
- In your RDP client, add a new PC with the address
localhost:13389. - Sign in with the account from step 4.
- The first time, accept the certificate prompt. ProRDP uses a self-signed certificate by default. See Settings › Security to use your own.
You’re now on the instance’s desktop. With the default Control display mode, the session matches your client window and resizes with it, so you don’t need to change the instance’s screen resolution.
Tip: an SSH tunnel carries TCP only, so leave Enable UDP off. If the session feels slow from far away, lower Max frame rate and Max bitrate in the Experience pane.
Other ways to reach the instance
The SSH tunnel is the simplest option if you’re already using SSH. These alternatives replace step 6. In each case, you still connect your RDP client and sign in the same way as in step 7.
| SSH tunnel | Session Manager | Tailscale | Security group, your IP only | |
|---|---|---|---|---|
| Inbound ports | 22, from your IP | None | None | 3389, from your IP |
| What you install | Nothing | AWS CLI and its Session Manager plugin | Tailscale, on both ends | Nothing |
| Access control | Your key pair | IAM | Your Tailscale account | Your IP address and password |
| Best for | Most people | Teams already managing AWS access with IAM | Reaching it like any other machine you own | A quick test only |
AWS Systems Manager Session Manager
Session Manager is AWS’s own way to reach an instance without any open inbound ports. The instance’s SSM Agent connects out to AWS, and AWS checks every session against your IAM permissions. The macOS AMIs that AWS provides include SSM Agent.3
Give the instance access to Systems Manager. Attach an IAM instance profile with the
AmazonSSMManagedInstanceCoremanaged policy. After a few minutes, the instance appears as a managed node under Systems Manager › Fleet Manager.Install the tools on your computer: the AWS CLI, signed in to your account, and the Session Manager plugin for the AWS CLI.
Start a port forwarding session, using your instance ID:
aws ssm start-session --target i-0123456789abcdef0 --document-name AWS-StartPortForwardingSession --parameters "portNumber=3389,localPortNumber=13389"Connect your RDP client to
localhost:13389, as in step 7.
Once this works, you can remove the SSH rule from the security group too, leaving no inbound ports open at all.4
Tailscale
Tailscale gives the instance a private address that only your own devices can reach. It connects out from the instance, so it needs no inbound security group rules either.
- Install Tailscale on the instance and sign in. You can do this in the Screen Sharing session in step 2, or download it from tailscale.com/download.
- Turn off key expiry for the instance in the Tailscale admin console, so it doesn’t drop off your network after a few months.
- Install Tailscale on your computer and sign in to the same account.
- Connect your RDP client to the instance’s Tailscale name or its
100.x.y.zaddress. No tunnel command or port number is needed.
Connecting remotely covers Tailscale in more detail.
Allow only your IP address
If you can’t use a tunnel, add an inbound rule to the instance’s security group for TCP port
3389 with the source set to My IP. The console fills in your current public address as a
/32, so no one else can even attempt to connect. Then connect your RDP client to the instance’s
public DNS name.
This is the weakest option. Your home or office IP address can change, and when it does, you’ll have
to update the rule. Anyone else behind the same address, such as on a shared office or hotel
network, can reach the port too. Use a strong password, keep
Require Network Level Authentication
on, and never widen the source to 0.0.0.0/0.
Set up a fleet from one image
Permissions can only be granted on the desktop, so for more than a few Macs, do it once and copy the result. An AMI includes the instance’s root volume, so it carries ProRDP, its permissions, its settings, and the automatic login with it. AWS suggests the same approach for other macOS prompts that can only be approved on the desktop.3
- Set up one instance. Follow steps 1 to 5 on it, then connect over RDP once to confirm everything works.
- Create an AMI from it. In the EC2 console, select the instance and choose Actions › Image and templates › Create image. By default, AWS reboots the instance to take a consistent image.
- Launch your other instances from the AMI. Choose it under My AMIs when you launch, with each instance on its own Mac Dedicated Host, as usual.
- Connect to each new instance with an SSH tunnel or one of the other options. ProRDP starts at login with its permissions already granted, so there’s no VNC step.
Every instance launched from the image starts with the same ProRDP username and password. After you first connect to each one, set a password of its own in the Account pane.
The permissions are tied to ProRDP’s code signature, so they carry on through ProRDP updates. Check that the image works by launching a single instance from it before you roll it out across a fleet.
Next steps
- Settings covers every option in the ProRDP settings window.
- Troubleshooting helps if a client can’t connect.
Amazon Web Services, “Amazon EC2 Mac instances.” https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-mac-instances.html ↩︎
Amazon Web Services, “Connect to your Mac instance using SSH or a GUI.” https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-mac-instance.html ↩︎
Amazon Web Services, “Amazon EC2 macOS AMIs.” https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/macos-ami-overview.html ↩︎ ↩︎
Amazon Web Services, “Start a session.” https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html ↩︎