Chris Mirchandani
16 years ago
Is there a way to have the DISPLAY variable set the way that sshd sets it w=
hen a clientconnects with either -X or -Y option=2C but after the shell loa=
ds? It would be best of thiscould only be done if the shell was started by =
an ssh session that used the -X or -Y option.
The specific ssh version in question is listed below=2C but I would like to=
have solutions fornewer versions of ssh as well.
OpenSSH_4.6p1 Debian-5ubuntu0.6=2C OpenSSL 0.9.8e 23 Feb 2007
This is the situation. I am running a coLinux based distro named andLinux=
=2C which basicallyis Ubuntu 7.04 running parallel with Windows. It has thi=
s "hack" that allows X forwardingover a virtual network interface that prov=
ides inter OS network between Windows and Linux.The X forwarding is used to=
load Linux X apps=2C Xfce based in this case=2C in Windows usingXming. To =
make this work=2C the following line is in /etc/profile.=20
export DISPLAY=3D192.168.11.1:0.0
Early on=2C I found that this prevented X forwarding to work when I sshed t=
o andLinux via theopen network interface=2C the interface used to access ot=
her computers on my network andthe internet through my firewall. I got arou=
nd this by adding the following to ~/.profile
export DISPLAY=3Dlocalhost:10.0
This has 2 issues. The first is that I have to add this for each user. In t=
his case that is nobiggie=2C but it would be great if I could override this=
for all users always. The second is oneI found today and that is because I=
have statically set this variable all ssh sessions use 10and that means th=
at no-matter which ssh session I try to X forward in=2C the X app is sent =
tothe computer that crated the first ssh session that successfully had X fo=
rwarding set. Therub is that since andLinux "needs" the specific $DISPLAY s=
etting set in /etc/profile=2C it isinherited by all shell sessions and it g=
ets set after sshd sets this variable. This is a problemfor me as I may be =
connected from several places with x forwarding enabled. I know I canmanual=
ly set this=2C but that has 2 issues.
1) I have to set it every time.
2) The bigger issue is=2C I learn nothing by doing that.
So if I were to break down the parts of the $DISPLAY variable in to the fol=
lowing.
DISPLAY=3Dx:y.z
and
DISPLAY=3Dlocalhost:10.0
then
x =3D localhosty =3D 10z =3D 0
So I want to be able to set it so that $DISPLAY is set with a different y f=
or each session thatsuccessfully creates an X forwarding session.
Any ideas or hints?
In case it helps.
uname -aLinux andLinux 2.6.22.18-co-0.7.3 #1 PREEMPT Wed Apr 16 18:50:10 UT=
C 2008 i686 GNU/Linux
# cat /etc/debian_version lenny/sid
# cat /etc/issue Ubuntu 7.10 \n \l
I have a new version of this andLinux=2C details below.
Thanks=2C
Chris
_________________________________________________________________
Hotmail=AE has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=3DTXT_TAGLM_WL_HM_Tut=
orial_WhatsNew1_052009=
hen a clientconnects with either -X or -Y option=2C but after the shell loa=
ds? It would be best of thiscould only be done if the shell was started by =
an ssh session that used the -X or -Y option.
The specific ssh version in question is listed below=2C but I would like to=
have solutions fornewer versions of ssh as well.
OpenSSH_4.6p1 Debian-5ubuntu0.6=2C OpenSSL 0.9.8e 23 Feb 2007
This is the situation. I am running a coLinux based distro named andLinux=
=2C which basicallyis Ubuntu 7.04 running parallel with Windows. It has thi=
s "hack" that allows X forwardingover a virtual network interface that prov=
ides inter OS network between Windows and Linux.The X forwarding is used to=
load Linux X apps=2C Xfce based in this case=2C in Windows usingXming. To =
make this work=2C the following line is in /etc/profile.=20
export DISPLAY=3D192.168.11.1:0.0
Early on=2C I found that this prevented X forwarding to work when I sshed t=
o andLinux via theopen network interface=2C the interface used to access ot=
her computers on my network andthe internet through my firewall. I got arou=
nd this by adding the following to ~/.profile
export DISPLAY=3Dlocalhost:10.0
This has 2 issues. The first is that I have to add this for each user. In t=
his case that is nobiggie=2C but it would be great if I could override this=
for all users always. The second is oneI found today and that is because I=
have statically set this variable all ssh sessions use 10and that means th=
at no-matter which ssh session I try to X forward in=2C the X app is sent =
tothe computer that crated the first ssh session that successfully had X fo=
rwarding set. Therub is that since andLinux "needs" the specific $DISPLAY s=
etting set in /etc/profile=2C it isinherited by all shell sessions and it g=
ets set after sshd sets this variable. This is a problemfor me as I may be =
connected from several places with x forwarding enabled. I know I canmanual=
ly set this=2C but that has 2 issues.
1) I have to set it every time.
2) The bigger issue is=2C I learn nothing by doing that.
So if I were to break down the parts of the $DISPLAY variable in to the fol=
lowing.
DISPLAY=3Dx:y.z
and
DISPLAY=3Dlocalhost:10.0
then
x =3D localhosty =3D 10z =3D 0
So I want to be able to set it so that $DISPLAY is set with a different y f=
or each session thatsuccessfully creates an X forwarding session.
Any ideas or hints?
In case it helps.
uname -aLinux andLinux 2.6.22.18-co-0.7.3 #1 PREEMPT Wed Apr 16 18:50:10 UT=
C 2008 i686 GNU/Linux
# cat /etc/debian_version lenny/sid
# cat /etc/issue Ubuntu 7.10 \n \l
I have a new version of this andLinux=2C details below.
Thanks=2C
Chris
_________________________________________________________________
Hotmail=AE has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=3DTXT_TAGLM_WL_HM_Tut=
orial_WhatsNew1_052009=