SSH with port forwarding for VNC sessions
The problem:
(Of course this doesn't really have to be VNC - it could be any application such as web, mail etc.).
We'd like to access the VNC server by establishing a tunnel via the SSH server.
(Note, the way VNC handles display numbers is that it constructs ports as offsets from the base port number of 5901. Thus VNC display :6 is mapped to port 5906.)
Let 10.10.10.10 be the ip address of the VNC server.
Let 10.10.10.20 be the ip address of the SSH server.
When asked you supply the password to the SSH server.
2. Use the VNC client program to connect to the localport - in this case 9999. Do this from another xterm or console. Here the VNC password needs to be supplied, either interactively or by other means.
vncviewer localhost:9999
In the language of port fowarding we have "forwarded" port 5906 from the VNC server (10.10.10.20) to our local client machine's port 9999 where it can be accessed as localhost:9999.
|
Client ------|--- SSH server ----- VNC server
|
firewall
(Of course this doesn't really have to be VNC - it could be any application such as web, mail etc.).
We'd like to access the VNC server by establishing a tunnel via the SSH server.
(Note, the way VNC handles display numbers is that it constructs ports as offsets from the base port number of 5901. Thus VNC display :6 is mapped to port 5906.)
Let 10.10.10.10 be the ip address of the VNC server.
Let 10.10.10.20 be the ip address of the SSH server.
- Connect to the SSH server which in turn connects to the VNC server. Here we are making VNC server port 5906 (display :6 in VNC terms) available locally as port 9999.
When asked you supply the password to the SSH server.
2. Use the VNC client program to connect to the localport - in this case 9999. Do this from another xterm or console. Here the VNC password needs to be supplied, either interactively or by other means.
vncviewer localhost:9999
In the language of port fowarding we have "forwarded" port 5906 from the VNC server (10.10.10.20) to our local client machine's port 9999 where it can be accessed as localhost:9999.
Comments