Stuck on Screen Locked after screen sharing

I closed my MacBook without first exiting the remote screen sharing session, and it caused the remote computer to get stuck on the Screen Locked screen. But I could still access it over SSH.

What I tried

1. Killing the process. top showed “screensharing” at 100% CPU, so I tried:

sudo kill -9 {pid}

But it didn’t effect the screen.

2. Restarting screen sharing

sudo launchctl unload -w /System/Library/LaunchDaemons/
sudo launchctl load -w /System/Library/LaunchDaemons/


3. Restarting or stopping ARDAgent

sudo /System/Library/CoreServices/RemoteManagement/ -restart -agent
sudo /System/Library/CoreServices/RemoteManagement/ -deactivate -stop

Source 1, Source 2

4. Giving up

None of these had any success, so I resorted to a forced reboot.

sudo reboot

Leave a Reply