On 10.6.8, if you have both Screen Sharing and Firewall turned on, port 5900 is automatically opened in the firewall. This is bad, because I want to access that port via ssh port forwarding and not allow it open to the world.
When I go into Sharing, Computer Settings there's nothing, and in the Advanced... Firewall settings I can't disallow incoming connections for "Screen Sharing".
I can also connect directly to the machine with VNC and port 5900.
Anyone know how to fix this problem?
Solution is:
ipfw -f flush
ipfw add 10000 allow ip from any to any via lo0
ipfw add 20000 deny ip from any to any dst-port 5900 in
After the above, I can access port 5900 via port forwarding, but not directly from outside the machine.