Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 444
Rep:
Multi-hop VNC tunnel over SSH
Is it possible to chain together multiple SSH tunnel hops in a single `ssh -L` command on the client side? I have two gateways I need to get through in order to access a remote host. For a normal SSH client connection, it's simple enough chain this all together by simply appending the additional SSH connection commands to the first one:
Code:
ssh gateway.1 ssh gateway.2 ssh remote.host
And for a normal (non-hopping) VNC session to a non-gateway host, create a tunnel:
But is it possible to chain together multiple gateway hops in order to reach the remote host, given SSH authentication is done via key on each host, and privileged ports are not accessible on the gateway machines? I've gotten close with the following, but tripped up by man-in-the-middle attack warnings:
If you have public key authentication it will work in a script without passwords and there is no hassle with tcp ports (only 22 needed).
I hope that is OK?
Yes, thanks, but ... really my question was more toward _understanding_ the "hassle" of using ports properly with a multi-hop tunnel, rather than working around them.
But you must be sure that you address the right hosts along your tunnel.
BTW I think you have to tell the 'some.vnc.viewer' on remote.host to use port 50022.
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 444
Original Poster
Rep:
Thanks sys64738. `StrictHostKeyChecking` was the key, though it should not be used on untrusted systems. Note that you don't need to specify the vnc port on the remote host, but you do need to specify a display port:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.