Laptop(osx-home network)——>Host1(linux-pc-college network)—->Host2(linux-pc-using vncserver on port 5901, can only be accessed from host1)
I can access host2 through ssh using:
- [user@laptop ~]$ ssh user1@host1
- [user1@host1 ~]$ ssh user2@host2
I need to access host2 vncserver using a ssh tunnel from "laptop". Any recommendation, also, which vnclient is suitable for this task?
Best Answer
Several options are available. First you need to setup a TCP tunnel.
If the port forwarding to the local network is not disabled in the sshd_conf at host 1, then this would be enough:
Otherwise you need to build a chain of port forwardings:
if the password authentication is used to connect to host2 then add a
-t
option to the firstssh
:Then use
vncviewer
of your choice to connect to the displaylocalhost:1
. I prefer to use TigerVNC.