RE: SSH X11 Setting the Display Variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, I found one hole in this script. If I ssh in as any user, the script does what it is supposedto do and the DISPLAY variable value is left as set by ssh. However, if I su -l to another userDISPLAY=192.168.11.1:0.0. If I su to the same user without -l the DISPLAY variable value is leftas set by ssh when the initial user was logged in. Any ideas and/or suggestions?

Thanks,
Chris

----------------------------------------
> Date: Thu, 21 May 2009 21:32:38 +0100
> Subject: Re: SSH X11 Setting the Display Variable
> From: daniel@xxxxxxxxxxxxxxx
> To: secureshell@xxxxxxxxxxxxxxxxx
>
> this didn't make it to the list:
>
> On Wed, May 20, 2009 at 1:08 AM, Chris Mirchandani  wrote:
>
>> ... To make this work, the following line is in /etc/profile.
>> export DISPLAY=192.168.11.1:0.0
>
>> ... I got around this by adding the following to ~/.profile
>> export DISPLAY=localhost:10.0
>
> how about in /etc/profile setting the following:?
>
> ----
> if [ -z "$DISPLAY" ]; then export DISPLAY=192.168.11.1:0.0; fi
> ----
>
> the above tests for emptyness of the $DISPLAY variable, and sets it to
> the predefined setting (192.168.11.1:0.0) if it hasn't already been
> set by sshd. (I hope)
>
> --
> Regards,
>    Daniel Llewellyn

_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009

[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux