Skip to content

Setting up VNC with ssh port forwarding

I tried to set up tightvnc with ssh port forwarding

Steps

1. Remote machine : Run VNC Server , Note down the display number
For eg - server name remoteserv, display :20

2. local machine :

ssh -N -T -L 5901:localhost:5920 remoteserv

Here, -T : No tty (Optional)
-N : No Shell  (Optional)
-L : <local port>:<local machine>:<remote port>
-C : compression (Optional)

3. local machine :

vncviewer localhost:1 (Display 1 -> 5901 in step 2)