Mac GeekeryGet your geek on. |
|
blog advertising is good for you
recent popular content
User login
|
A complaint I’ve frequently encountered on some Mac OS X Server related forums and mailing lists is that there is no documentation on how to enable VNC access in the Terminal. A good number of former Windows-only businesses have purchased an Xserve G5 without a video card because they needed to use both PCI slots for other components or they naturally assumed that a computer would come with a video card. Some people familar with Mac OS X Server might read this and say, “Hey, just run the server administration tools on your Mac desktop or laptop. Er, you don’t have another Mac?” So, what’s a diligent Windows or Linux administrator supposed to do? A little basic research would show that Apple claims you can control Mac OS X from VNC, but would find nearly zero documentation on how to enable VNC from the command line. I say “nearly zero” because there is one knowledge base article on how to copy the VNC preferences from another Mac. It turns out, that you can enable VNC access and set the VNC password via the kickstart command. That’s the good news. The bad news is that the kickstart command does not accept a plain text password, but instead it must be encoded before giving it to kickstart. When done correctly, encoding sensitive information like passwords is a good practice. However, when used for encoding XOR is extremely weak because it is trivially decoded. Its use for simple “encryption” came from the 70’s and 80’s when computing power was quite limited and XOR was usually implemented in a CPU’s instruction set. If you wish to learn more about XOR encoding and its limitations, I suggest doing a search for the phrases “xor encoding” or “xor encryption” on Google or Yahoo. This script also useful if you wish to purchase a Mac mini and want to put in some place where you cannot easily place a display. Since I often use a number of different operating systems, VNC is how I choose to administer my headless Mac mini acting as a personal file, music, and web server at home. Instead of running the kickstart command with the necessary parameters, the script prints the command and parameters to the terminal window. This allows the script to be run on another operating system type and the administrator to simply copy and paste the output into a SSH session to the Mac.
Just save the above script to vncpasswd.pl. Running the script on a UNIX-like platform should look like the following:
Finally, a suggestion to the Mac OS X Development Team: use a service account for storing the VNC password. This would provide much stronger security for the VNC password and have a well documented method of setting passwords via the command line.
About unixgeek
|
This is a handy bit of information… if only I could get it to work. After working through this, when checking the Access Privileges… for Remote Desktop on the target machine, I see that the vnc password has been set, presumably to the password I specified. But alas, attempting to connect using a VNC client with the specified password does not work. The connection is simply refused.
Am I missing something?
This used to work. I tried it again tonight and it seems that even though the /Library/Prferences/com.apple.VNCServer.plist is getting set correctly, there is something else preventing this from working.
I’ll try to work on it some more, but it may be a few days…
—
unxgeek@gmail.com
“Smile,” they said, “it could be worse.”
So I did, and it was.
It looks like you have to activate ARD first, with something like:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all
Found here: http://docs.info.apple.com/article.html?artnum=108030
Nice tip, but the stylesheet is a nightmare — thousands of extra lines, and it has smart quotes!
oh, and it should be $ARGV0 not what is shown above.
ARGH jesus christ $ A R G V [ 0 ] without the spaces
OK, another bust-up. If you want to see how this should actually look without being mangled by dim-sighted templating, see this page:
http://macoy.wordpress.com/2006/09/07/macs-tip-vnc-over-ard/
THANK you.. (phew!)
Me again: Kickstart now takes passwords in plain text, not Xor!