[CLUE-Tech] ssh and xwindows

Jeff Cann j.cann at isuma.org
Fri Dec 26 02:26:42 MST 2003


Here's a cool, automatic trick that may not be well-known.

If I have my DISPLAY enviromental variable set and my x windows server set to 
accept connections from remote servers (e.g., $ xhost +) when I ssh into 
another server, SSH automatically sets DISPLAY back to the originating host.  
The net result is that I can launch a graphical application on the remote 
machine, but it will show up on my originating server's display.

Here's a simple example.  Note that in an insecure environment, you probably 
want to pass arguments to xhost.  See the man page for xhost.

$ echo $DISPLAY
:0.0

$ xhost +
access control disabled, clients can connect from any host

$ ssh zanobi
jccann at zanobi's password:

$ echo $DISPLAY
localhost:12.0

$ xclock

Network latency affects performance, so this may not be too useful outside a 
LAN or fast WAN.

Jeff
-- 
http://isuma.org/



More information about the clue-tech mailing list