Remote Connection using VNC
Server Setup
Linux Server (SLC)
First the ports used by VNC (5901 and following) have to be opened using iptables (see
documentation
):
sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901:5905 -j ACCEPT
Restart iptables to take over the modifications
service iptables restart
Now the VNC server can be started
vncserver -geometry 1920x1080 :1
The geometry option allows to set the screen sizes of the x-server. The last number determines the port used for this vncserver +5900, i.e. :1 refers to port 5901
Setting up the SSH Tunnel and connecting to the server
In order to secure the connection it is recommended to use an SSH tunnel, since otherwise the connection is not encrypted (see
link
)
For example
ssh -L 5901:machine.cern.ch:5901 username@lxplus.cern.ch
opens a tunnel to machine.cern.ch via lxplus (mandatory when connecting from outside CERN) and maps port 5901 of the server to the local port 5901. The connection to the VNC server can now be done by connecting your VNC client to localhost:5901.