View Single Post
  #1 (permalink)  
Old 14-09-2005, 05:36 PM
rockdalinux's Avatar
rockdalinux rockdalinux is offline
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default Run remote X applications over network using ssh

This small howto guides you to run remote X applications over network using ssh.

Introduction
The X windows system created by X consortium www.X.org
  • * It is client/server architecture.
    * X is OS independent and it is a Protocol
    * X protocol works over TCP/IP

What is X server?
X-server -> Talks with your hardware (VGA card, mouse, monitor etc) => It provides the screen (or display) and manages the resources. For more info on X Window System and X client-server model and network transparency visit http://en.wikipedia.org/wiki/X_server

X-Client -> Uses the display/screen provided by X-Server to display GUI/Application. It does not care how mouse or vga card works.

For example you can run X application from another computer. All you need is to setup correct DISPLAY variable.

Our demo setup with two computers:
debian-server
IP: 192.168.1.1

Suse-Linux (Laptop)
IP: 192.168.1.11

Now you would like to redirect output of laptop to server. Please note that X works on almost all UNIX like operating systems like FreeBSD, HP/UX, Solaris, Linux etc. So the commands remains same for all variant of UNIX OS.

1) Login to Debian Linux server
Code:
xhosts 192.168.1.11
xhost is server access control program for X server. The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. In our example we are allowing host (192.168.1.11) to access server. All communication done using 6000 port.

2) Login to Suse-Laptop and run program on Debain Linux
Code:
export DISPLAY=192.168.1.1:0
xeyes &
The output of xeyes will be on debian server and not on the Suse. DISPLAY is variable which point out X server IP-address/hostname to redirect output.

Secure login over ssh i.e. forward X over ssh
SSH server has built in support to run X application remotely. Traffic between suse and debian system remains encrypted.

1) Make sure XForwarding option is on
Login to debian server, open /etc/ssh/sshd_config using text editor such as vi/vim:
Code:
vi /etc/ssh/sshd_config
2) Setup X11Forwarding to yes
Code:
X11Forwarding yes
3) Save file and restart ssh server
Code:
/etc/init.d/ssh restart
4) Allow laptop to run programs:
Code:
xhosts 192.168.1.11
5) Login from suse computer and start open office writer:
Code:
export DISPLAY=192.168.1.1:0 
ssh -X user@192.168.1.1 oowriter 
ssh -X user@192.168.1.1 xeyes
Replace user with actual user name.

This is my first small tutorial; please feel to comment back or to add your own stuff to it.
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote