Screen Sharing

Updated

Screen Sharing shows the Mac’s desktop on your computer. Only SSH reaches the Mac from the internet, so the connection runs through an SSH tunnel. Port 5900 stays closed from outside, and no port is forwarded. See Open Ports and Port Forwarding. Add an SSH key first.

Open Macs in the sidebar and click the Mac. In Connect, choose the Screen Sharing tab. Its steps have the Mac’s address and username filled in.

The Connect section on the Screen Sharing tab, with the tunnel command and Open Screen Sharing

1. Open the Tunnel

Copy the tunnel command and run it in Terminal. For a Mac with a public IP it looks like this:

ssh -N -L 5901:localhost:5900 -o ExitOnForwardFailure=yes <username>@<address>

Type yes if it asks. Leave the window open, even though nothing seems to happen. The command opens no shell. It only holds the tunnel open, and closing the window ends Screen Sharing.

The tunnel uses port 5901 on your computer. Port 5900 may already belong to your own Mac’s Screen Sharing.

On a Mac reached through Cloudflare, the tab starts with Install cloudflared. The tunnel command carries a ProxyCommand. Connect Over SSH covers installing cloudflared.

2. Open Screen Sharing

On a Mac, press Open Screen Sharing. Or choose Connection > New in the Screen Sharing app and type this address:

localhost:5901

On Windows or Linux, point a VNC viewer at the same address. Press Copy Address to copy it.

3. Sign In

Sign in with the username from Mac Sign-In and the starting password you saved. See Connect for the First Time.

Set New Password stops working for the account after it signs in on the Mac’s screen. For a password of your own, set it before this first sign-in.

While Connected

To copy and paste between the two Macs, turn on Edit > Use Shared Clipboard. See Shared Clipboard. For a screenshot of the hosted Mac, choose Connection > Save Screen Capture.

Need help? Email support@macmetro.com.