I was trying to configure my Mac’s built in Remote Desktop sharing last night through the command line. The RDC client, which is built into every Tiger Mac, was prompting me for a password when I attempted to connect using an open source VNC (screen sharing) client from my PC. So I did some research and found some very interesting information about configuring Mac OS X’s Remote Desktop (ARD) client from the command line. The
kickstart command line tool referenced in the Apple KB article is included in the Remote Desktop Client and is therefore in every 10.4 Mac as well as some earlier systems.
The cool thing about it is that kickstart enables you to remotely activate and deactivate ARD connections. So as long as you leave SSH enabled and you have administrative privileges, you can tunnel into an SSH command line session on your Mac, sudo kickstart with the appropriate settings, and turn ARD on, then get the screen of your Mac and do your thing. As the discussion thread points out, this works even for Macs that have no physical screen attached, like a PowerBook with a broken LCD or a headless Mac Mini.
You can do even more with two more command line utilities included in ARD, networksetup and systemsetup, which allow you to do things like configuring the network settings and other “control panel” level settings.
I like this so much that, in combination with a dynamic DNS solution, I might throw out the rapidly aging Timbuktu client we bought to help my mother in law troubleshoot her system.