Rice University logo
 
Top blue bar image Kiran Thyagaraja
Brain Dump
 

VNC port forwarding over SSH

1. Start vncserver on the remote machine:
vncserver

Check which display the server is running on:
[user@login1 ~]$ vncserver -list

TigerVNC server sessions:

X DISPLAY # PROCESS ID
:2 9416

In this case, its running on display “:2”

Also check which port the VNC server is running on:
netstat -tulpn

2. In a terminal on your desktop, start SSH forwarding:
ssh -L 5902:localhost:5902 -N @remoteserver

Keep this session open until you want your VNC port active.

3. Connect vnc client to the SSH forwarded port:
vncviewer localhost:2

Comments are closed.