Is there any way to change it from the default
5900 to some other port?
You actually can switch the default port for Apple's VNC server on Mac OS 10.7 Lion and 10.8 Mountain Lion. To change the port, you need to edit the server's plist file
Editing the file requires root (sudo) privileges. In the terminal, if you are familiar with vi or vim, you can type:
or if you're not, you'd better use nano:
Now, all you have to do is change line 34 (the one that reads
To change the default port to 54321, you would edit the plist file to look like this:
After saving the file, to make the change take effect, turn Screen Sharing off and then on again in the Sharing preference pane, or alternatively unload and re-load the service using these commands:
The longer answers suggest ways around it -- three possibilities:
I can confirm after finding this thread via Google that editing /ect/services for the "rfb" ports will redirect the included VNC server's listening ports.
I edited the file and rebooted (usually I'd try restarting services or unloading the launchdeamon but I was having some other issues as well and didn't bother). iTeleport on my iPad then failed to connect on 5900 and succeeded on the high unprivileged port I chose.