Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Manage the VNC / screen sharing password remotely Network
I've just upgraded my son's Mac Mini to 10.5, and turned on the Screen Sharing and ssh server after the initial install. In 10.4, I had long ago configured the "hidden" ARD VNC server, though alas I now find I've forgotten the password I set at that time. My son's gone to bed, but I want to play on his Mac -- what to do?

It seems that the "new" screen sharing feature is basically the same as 10.4's, and the VNC password is in the same place: /Library » Preferences » com.apple.VNCSettings.txt. The password is obfuscated by XORing it with a fixed key, so you need a little perl magic to view / set it.

[robg adds: Read on for the how-to. Please note that this isn't a security concern, as it assumes you've got ssh access to the machine in question, as well as the ability to execute root privileges on that meachine -- and if you've got both of those things, well, you've pretty much got the machine anyway.]

To show the current password, do this: To set a new password (the obfuscated version is echoed back, in addition to being written to the VNCSettings file): Of course, hello is a very poor password, and is only an example here!

[robg adds: Any errors in the above are my fault; I *think* I got it all coded correctly in Geeklog-speak, but I may have made an error. I tested the decoding command, which works fine, but not the changing command.]
    •    
  • Currently 3.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[27,964 views]  

Manage the VNC / screen sharing password remotely | 7 comments | Create New Account
Click here to return to the 'Manage the VNC / screen sharing password remotely' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Manage the VNC / screen sharing password remotely
Authored by: Alrescha on Nov 16, '07 08:06:47AM

"It seems that the "new" screen sharing feature is basically the same as 10.4's, and the VNC password is in the same place"

It may be worth mentioning that the new screen sharing doesn't require or use this file unless you have also specifically enabled the VNC password for use with VNC clients.

A.



[ Reply to This | # ]
Manage the VNC / screen sharing password remotely
Authored by: skylarking418 on Nov 16, '07 08:56:17AM

Can this command be sent via "Send UNIX command" in ARD 3 Admin?
I tried , but received :

/bin/bash: line 1: $: command not found
/bin/bash: line 2: 7F513D02E4A8C5E2FF1C39567390ADCA: command not found
/bin/bash: line 3: $: command not found
/bin/bash: line 4: hello: command not found
/bin/bash: line 5: $: command not found

I cut and pasted the code from the Hint; perhaps that is the issue?



[ Reply to This | # ]
Manage the VNC / screen sharing password remotely
Authored by: taxi on Nov 16, '07 03:11:14PM

Yeah, it would appear the stuff you copy/pasted is the code and the (example) responses.



[ Reply to This | # ]
Manage the VNC / screen sharing password remotely
Authored by: taxi on Nov 16, '07 03:13:26PM

Oh, and only enter the code that is after a $, but not including the $.



[ Reply to This | # ]
Manage the VNC / screen sharing password remotely
Authored by: a¿ex on Nov 16, '07 10:41:55AM

the code to create a new password doesn't work, as it seems that something got lost on the way. perl doesn't have an input.
try:

echo "hello" | perl -we 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; $_ = <>; chomp; s/^(.{8}).*/$1/; @p = unpack "C*", $_; foreach (@k) { printf "%02X", $_ ^ (shift @p || 0) }; print "\n"' | sudo tee /Library/Preferences/com.apple.VNCSettings.txt



[ Reply to This | # ]
Manage the VNC / screen sharing password remotely
Authored by: af3556 on Nov 17, '07 01:50:23AM
I'm the hint's author, and can perhaps clarify slightly: the terminal logs are shown exactly as you'd see them in your terminal window. You need to type the commands after the "$" prompt, and in the case of the command to change the password, the perl script will wait for you to type the new password (in this case, "hello") before echoing to the terminal and updating the VNCSettings file. To exit, type either Ctrl-D or Ctrl-C once you've entered one password. a¿ex's version will also work (and is probably preferred, actually - it's a bit less error-prone).

[ Reply to This | # ]
Manage the VNC / screen sharing password remotely
Authored by: skylarking418 on Nov 21, '07 08:53:56AM

Thanks to the original author, taxi ( for the tip ), etc....
This does work great in ARD 3 using a template( via Send UNIX command ). I had set the VNC password on an image for a mass deployment of over 400 iBooks, and did so without knowing how reset the VNC password remotely should it be compromised ( short of physically touching them all, or reimaging )..

THANKS FOR THIS; I have a less then layman's knowledge of perl, and never would have figured this out.. now i have an easy way to change the password remotely should I have to...



[ Reply to This | # ]