Set the VNC Password for Mac’s Remote Desktop in Terminal

I was stuck in trying to access one of our xserve machines that just got moved from the QA network to the Build network. I could connect via ssh, and Justin could ping it but attempting to connect with VNC wasn’t working. It wouldn’t accept the usual passwords. Justin seemed to think that it was possible to change the VNC password through the command line, so I google it and read a post from 2 years ago.

Something I’ve learned from reading “how-to” blogs is that you should always read the comments first. That’s where the most up to date information will be, if there is any. The person who wrote the post used strange template structure that made his idea hard to read and understand. Anyone who didn’t read the comments wouldn’t know that kickstart now takes plain text passwords.

The long and short? If you want to change the VNC passoword do this:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw [newpassword]

Apparently you can enable VNC access and set the VNC password via the kickstart command. It isn’t terribly well documented, but since it now accepts plain text passwords, I think that’s a step in the right direction.

3 thoughts on “Set the VNC Password for Mac’s Remote Desktop in Terminal

  1. Eep! If I hadn’t been on vacation, I could have pointed you at the credential updating script we have that does precisely this for VNC on Mac.

  2. daniel e – I am talking about being able to control the VNC settings when I can’t access the desktop at all. With this machine in a distant location, and only ssh access, I needed a command line solution.

Leave a Reply

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

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