On 10/10/06, Richard Fish <bigfish@asmallpond.org> wrote:
On 10/10/06, Mark Shields <laebshade@gmail.com> wrote:
> I have a gentoo box setup as a router with 3 servers behind it (all 4
> servers are running gentoo).  Right now I simply have port 5901 to forward
> from the router to my vnc server so I can access it remotely.  I've looked
> on the gentoo forums and online but haven't been able to find any solid
> information on how to tunnel 5901 through ssh through the router to the vnc
> server.  Basically, client -> router -> vnc server port 5901, but over ssh.
> Any ideas?

You want ssh port forwarding....you can read the ssh man page, but
basically you want:

# ssh -L localhost:5901:remotehost:5901 &
# vncviewer localhost:5901

HTH,
-Richard
--
gentoo-user@gentoo.org mailing list


Thank you Richard and Mauro, but this wasn't what I was looking for.  The vnc and the ssh server are not the same.  I am familiar with and have no problem using the particular setup you mention; however, it will not work for what I want to accomplish.  I want to tunnel vnc traffic over ssh to my router, then forward that vnc traffic to the actual vnc server.  I think the problem lies somewhere in my iptables rules.  I did have: /sbin/iptables -t nat -A PREROUTING -p TCP --dport 5901 -i ${WAN} -j DNAT --to 192.168.0.235:5901 , which will forward it correctly if I connect through 5901, but tunneling via SSH doesn't work.  Again, I want to tunnel the vnc connection to the router, which will then forward the port 5901 traffic to the vnc server.

Btw, I'm using Putty and Tightvnc on a WinXP machine (work PC) to connect to the vnc server.

--
- Mark Shields