Enable or Disable OS X Screen Sharing from the Terminal

Standard

If you have a need to enable or disable Screen Sharing from a terminal in OS X the commands are very simple. I’ve used these commands in 10.6 (Snow Leopard).

Enable
sudo touch /etc/ScreenSharing.launchd

Disable
sudo rm /etc/ScreenSharing.launchd

Source: rentzsch.tumblr.com | Starting VNC remotely via kickstart

Updated 06/07/2012: It seems that the process for doing this has changed in OS X Lion based on a post in Ryan’s Tech Notes. I used these commands and they worked as described.

Enable
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

Disable
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

 

One thought on “Enable or Disable OS X Screen Sharing from the Terminal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s