Because this vulnerability could allow unauthenticated access, we recommend a full wipe and reinstall of your Mac. First, back up your files via SCP:
You can SSH in yourself, update macOS to a patched version, and reconfigure Screen Sharing on an alternate port using the instructions below. We don’t recommend this path, since your Mac may have already been compromised before the port was blocked. Only choose this option if your Mac was already set to auto-update to a patched version, or if you’re confident it was not accessed by an unauthorized party. The whole process takes about 20 minutes, most of which is the OS update. Before you start, you’ll need:
- Your Mac’s IP address or hostname
- Your administrator username and password (available in the MacStadium Portal under your service credentials if you haven’t changed them)
- An SSH client (built into macOS, Linux, and Windows 10+)
From a terminal on your local machine:
First, check your current version:
List available updates:
macOS Tahoe 26.6.1-25G76), then install it. On Apple silicon Macs, installing an OS update over SSH requires you to authenticate as a volume owner, so include your admin username:
Once the machine is back up, reconnect over SSH and confirm the update landed:
With your Mac patched, you can safely run Screen Sharing again. Since port 5900 remains blocked at the network edge, you’ll configure it to listen on an alternate port. We’ll use 45900 in this guide, but any unused port works. As a bonus, moving off the default port takes your Mac out of the crosshairs of automated scanners that constantly probe 5900 across the internet.
First, make sure Screen Sharing is enabled:
screensha in the output. The custom configuration lives in /Library/LaunchDaemons, so it persists across reboots.
Step 4: Connect on the new portFrom macOS, open Finder, press Cmd+K (Connect to Server), and enter:
That’s it. You’re patched and your Screen Sharing access is restored. Two things to know going forward: 1) Manage Screen Sharing from the command line. Because the service now runs from the custom configuration, the Screen Sharing toggle in System Settings no longer controls it. To stop it, run
sudo launchctl bootout system/com.apple.screensharing.custom; to start it again, re-run the bootstrap command from Step 3.
2) Re-check after future macOS updates. Major OS updates can occasionally reset launch service state. After any future update, run the lsof check from Step 3 to confirm the service is still listening on your custom port, and re-run the bootout/bootstrap commands if it isn’t.
Prefer not to expose Screen Sharing at all?
For the strongest posture, you can skip the custom port entirely and tunnel Screen Sharing through SSH. This keeps the service unreachable from the internet while remaining fully usable:
vnc://localhost:45900. All Screen Sharing traffic traverses inside the encrypted SSH connection. Customers behind a MacStadium firewall or VPN can also simply continue using Screen Sharing privately, where it was never exposed in the first place.
