[ale] Handy little script others may have a use for too...

Jason Day jasonday at worldnet.att.net
Mon Mar 24 17:27:36 EST 2003


On Mon, Mar 24, 2003 at 04:40:51PM -0500, da Black Baron wrote:
> 
> ## Add this to your .profile, and you'll not have to set your display
> ## for remote X-apps when you ssh into your box!
> 
> 
> display=$(env | grep SSH_CLIENT)
> 
> display1=${display##SSH_CLIENT=}
> 
> display2=${display1%%22}
> 
> display3=${display2%%??????}
> 
> DISPLAY=$display3':0' export DISPLAY
> 
> --------------<snip here>----------------------------

If you do this, then your X apps will *not* be forwarded over the
encrypted channel.  This may or may not be important to you, but if
you're running X apps over an unsecured network (or the internet) and
relying on ssh encryption, you *must not* set the DISPLAY variable.

Furthermore, it shouldn't be necessary.  The client will forward the X
auth info to the server, and the server will automatically setup a
"proxy" X server on the remote machine that forwards X connections over
the encrypted channel.  You should be able to ssh to a remote machine
and immediately run X apps on the remote, without having to adjust
anything.

This assumes, of course, that the server has enabled X11 forwarding.
Check your sshd_config file and make sure it has the following line:
  X11Forwarding yes

If X11 forwarding is enabled in the config file, but still doesn't work,
the most likely cause (in my experience) is that the server cannot find
the xauth executable.  Try running ssh in debug mode (ssh -v -v -v
host), you should see a message near the bottom that it's requesting x11
forwarding.  If it can't forward the X connection, it will print an
error message.

Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list