Posts Tagged ‘tunnel ssh’

Linux – Tunnel X windows Securely over SSH

November 25, 2010 Leave a comment

The X windows system is a network protocol that provides a graphical user interface for networked computers. In order to use graphical user interface applications it is sometimes necessary to use vncserver on Linux environments as they are command line based.

Output without X windows

When using vncserver and needing to connect to another server through ssh it would be necessary to connect using the X windows protocol, otherwise the following error occurs:

dgoh-data-02:oracle@OASLIVE2> ssh node11
Last login: Thu Nov 14:15:44 2010 from data-dgoh-02
DISPLAY not set
set DISPLAY environment variable, then re-run

Output with X Windows

dgoh-data-02:oracle@OASLIVE2> ssh -X node11
Last login: Thu Nov 14:27:16 2010 from data-dgoh-02

This time when DBCA is run the graphical user interface appears

Check X Windows is running

A simple ps grep command will let you know if X windows is currently running on your Linux system.

dgoh-data-01:oracle@OASLIVE1 > ps -ef|grep X
oracle    6776   421  0 14:39 pts/2    00:00:00 grep X
root      7091  7088  0 Nov11 tty7     00:00:00 /usr/bin/Xorg
:0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7

Find which port X11 is running on

From the command line type the following where <server> is the server name, to discover which port x11 is running on:

# nmap <server>
21/tcp open ftp
22/tcp open ssh
23/tcp open telnet
6004/tcp open X11:4