I am trying to enable VNC (Screen Sharing) on my Mac running OS X Yosemite
I have been able to run this command sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist (source) to turn VNC on.

The only issue running this command is, it sets a password automatically, in which I do not know what it is, I have to fix it by logging in physically to the computer.

Is there a way how I can enable VNC via SSH and setting the password as the users password?

  • Hmm - I never use the VNC password at all. What client are you using to connect to OS X? Perhaps changing that alone would suffice?
    – bmike
    Aug 16, 2015 at 12:29

1 Answer 1


If you need to set a VNC password - you might need to also kickstart the ARDAgent, you can use this command instead of just loading the plist:

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

The analogous command for using user/password of existing users would be:

sudo  /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -configure -allowAccessFor -allUsers -configure -restart -agent -privs -all

More detail and discussion at:

How to enable OS X screen sharing (VNC) through SSH?

  • That doesn't work for me. I am either such at connecting or authentication. The VNC client I am using is 'RealVNC' iOS app. That command enables Remote Management for all users.
    – iProgram
    Aug 16, 2015 at 13:27
  • @iProgram Cool - If you want to try out Screens app - it works with the above. I'm hoping someone else has a different solution for you.
    – bmike
    Aug 16, 2015 at 13:31
  • 1
    @iProgram I agree - knowing what a tool is worth is important. For me, using remote sessions across dozens of OS and a handful of devices - that app paid for itself in a week of work. As long as you can trade time for learning - DIY is always fun.
    – bmike
    Aug 16, 2015 at 14:12
  • 2
    I still get "TightVNC Viewer: Authentication reason: Authentication or authorization failure" even after running these commands. Is this supposed to be changing the VNC password to my login password?
    – Michael
    Mar 29, 2017 at 23:49
  • 2
    Meh, Warning: macos 10.14 and later only allows control if Screen Sharing is enabled through System Preferences. Oct 25, 2018 at 19:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .