I realize that there's a lot of info out there about port forwarding, but here's my specific situation.
I need to use Remote in (via VNC) to my Mac. By default, the Mac Remote Sharing server listens on port 5900. That would be all well and good except my company is blocking port 5900 incoming connections!
However, it is allowing port 3389. So what I'm trying to do is set it up so that I can listen for connections on port 3389 and forward them to 5900.
Here's what I tried:
ssh 127.0.0.1 -L3389:127.0.0.1:5900
This doesn't quite do what I want because then only connections from 127.0.0.1 will be accepted on port 3389.
netstat -an | egrep 'Proto|LISTEN'
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp6 0 0 *.5900 *.* LISTEN
tcp4 0 0 *.5900 *.* LISTEN
tcp4 0 0 127.0.0.1.3389 *.* LISTEN
I need to listen from the world, * on port 3389. How can I accomplish this?