VNC service start and stop with a script in Mac OS X

Create a file called, for example, startVNC and fill it with:

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

The password used to enter via VNC must be filled in PASSWORD.

Create a file called, for example, stopVNC and fill it with:

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

Don’t forget to give executable permissions to both:

chmod +x startVNC
chmod +x stopVNC

I use those scripts when I need to do something in the graphical interface but I’m far away from my computer. Just enter by SSH, start VNC service, do what I need and stop VNC again.

No related content found.

Leave a comment ?

0 Comments.

Leave a Comment