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

 

2 responses to “Enable or Disable OS X Screen Sharing from the Terminal”

  1. […] while back I posted another tip about enabling and disabling Screen Sharing from a terminal, which can be used to change the status of Screen Sharing remotely via an SSH connection. Like […]

  2. Dylan Avatar
    Dylan

    I have this problem actually but I am on Ventura. Regardless I tried the above commands and they did not work. I have a hacker though, who got into my Wi-Fi network and from there I think got ahold of my Wi-Fi network traffic and then got my passwords. Not sure. Either way I really need this plz, it shows it’s sharing but doesn’t. I know it is. He is also using a local network he set up on my computer on the Ethernet bridge. So yeah. It gets better and better tho but that’s where I’m at. Plz help

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

I’m Mike

Welcome to my blog, which I have maintained for several years, off and on, to share things that I’ve learned from numerous projects and various problem solving escapades. This is my way of giving something back to the online communities that have helped me learn more about a wide variety of topics.