The X Window system was developed to allow a network transparent graphical windowing system for UNIX workstations. Your local display uses a miniature network within your workstation to accomplish this (UNIX Domain Sockets).
#yum install lynx xhost
Suppose I want to forward my workstation, remotehost, to the workstation somehost. The first step is to allow X Window connections from remotehost to this machine. This is accomplished using the xhost command. The syntax for xhost is as follows:
#xhost +/- <IP address or hostname>
Add or subtract a host that can display X11 apps on this workstation
Disables all security, any host can display X11 apps on this workstation
Enables all security, no host can display X11 apps on this workstation
Allowing remotehost to connect to somehost you must execute the following command:
[firstname.lastname@example.org]$ xhost + http://www.bhuvana.com
The next step is to login to the remote machine, remotehost in this case, and tell it where to display the X11 applications. There are two components you need to know, the first is the IP address or hostname of the local workstation (the one you are sitting at) and the X11 display number (typically 0). To locate the display number, use xdpyinfo:
[email@example.com]$ xdpyinfo | more
name of display: :0.0
version number: 11.0
The :0.0 is your local display number.
Then, using the IP address or hostname and X11 display number you set the remote machine to display to the local machine.
[firstname.lastname@example.org]$ export DISPLAY=”www.sathish.com:0.0″
Using tcsh or csh:
[email@example.com]$ setenv DISPLAY http://www.sathish.com:0.0
#Secure Forwarding: ssh
#service sshd restart
The best way to forward X applications to your local machine is by using your ssh server. This requires a small amount of setup with the ssh server. You must make sure the line: X11Forwarding yes is present in your sshd_config file.
Once your ssh server has been configured, forwarding X applications is as simple as sshing in to the machine. The ssh server and client take care of all the forwarding details such as your environment varible and display number. There is a small catch: you must use the -X parameter to notify the client and server that you want X applications forwarded:
[firstname.lastname@example.org]$ ssh -X email@example.com