Enable and disable Screen Sharing in macOS

These commands are useful if Screen Sharing gets turned off on a remote machine but SSH is still accessible, or in the event that Screen Sharing becomes unresponsive.

OS X 10.6 through 10.9

Disable:

sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool true

Enable:

sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false

Launch:

sudo launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist

OS X 10.10 through macOS 10.12

Disable:

sudo launchctl disable system/com.apple.screensharing

Enable:

sudo launchctl enable system/com.apple.screensharing

Launch:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist

Leave a Reply

Your email address will not be published. Required fields are marked *