[opensuse] envvar DISPLAY not set on bash invocation fr/sshd
I noticed, recently, that when I log into a 10.3 based system, my DISPLAY variable isn't being set to "[localhost:10.0]" (or anything). I've upgraded more packages since I last knew it was working, but don't remoteX from this machine regularly, so I don't know exactly when it broke. I thought I'd not configured something 'obvious' but I compared it with another machine running 10.3 which is working and I can't figure out what the difference is between the two. I've tried two separate environments logging into both machines (SecureCRT && Cygwin). Behavior is the same (fails on newer upgraded machine, but not the older one). REMOTEHOST is being set on both machines, as expected. I've been trying to figure out 'when' during the ssh-login process it might be failing. known failure is when bash's /etc/profile is called -- top of the file I temporarily tossed in an edit on both machines and DISPLAY wasn't making it to at that point. The /etc/sshd_config files on both machines are identical except for names of local network interfaces to listen on. The user's .ssh/ssh_config files is the same on both. The '/etc/security/pam_env.conf files are the same. pam_env is configured for use on both machines /etc/pam.d/common-auth, seemingly correctly. I'm guessing there must be some other place along the login chain that somehow is different -- isn't it ->(sshd)->pam->login->bash? Anyone know of other places that might try to block 'ssh' envvars being passed in? Thanks much.. -Linda -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Linda Walsh wrote:
I noticed, recently, that when I log into a 10.3 based system, my DISPLAY variable isn't being set to "[localhost:10.0]" (or anything). I've upgraded more packages since I last knew it was working, but don't remoteX from this machine regularly, so I don't know exactly when it broke.
That's normally set at login, by login scripts. Remember, when you SSH to another machine, the remote machine picks up the environment variables from the ssh that you initiated....which inherits them from your login shell. So make sure that DISPLAY is properly set *BEFORE* you ssh. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Sam Clemens wrote:
Linda Walsh wrote: ... DISPLAY variable isn't being set ( to "[localhost:10.0]" (or anything). )
That's normally set at login, by login scripts.
On the target system, I (where bash is my shell), I am 'echo'ing 'DISPLAY' at the beginning of "/etc/profile". Isn't that the first startup script called by bash on an interactive login? It is 'null' on the failing machines at that point.
Remember, when you SSH to another machine, the remote machine picks up the environment variables from the ssh that you initiated....which inherits them from your login shell.
I normally use DISPLAY "=:0" or "=0.0" on the local machine to talk to its X server, But use "X-Forwarding" on remote machines, so doesn't the remote 'sshd' have to set DISPLAY to correspond to the forwarded port?
So make sure that DISPLAY is properly set *BEFORE* you ssh.
Unfortunately, it isn't so easy (sigh). Value of DISPLAY is set to ":0", and exported (verified by using "printenv DISPLAY") in the 'ssh' case. Same behavior in a 2nd client prog (GUI based), where it appears to set DISPLAY in the forwarded environment to the hosts. I verified that the GUI must be setting DISPLAY, or it wouldn't be working. I.e. -- unsetting DISPLAY in the shell and then running 'ssh' results in the remote DISPLAY var being "null" when bash starts. LOCAL: lw> printenv DISPLAY :0 WORKING: lw> ssh working working:lw> echo "DISPLAY=$DISPLAY" DISPLAY=localhost:14.0 NOT WORKING: lw> ssh fail fail:lw> echo "DISPLAY=$DISPLAY" DISPLAY= I don't see how it could be on the client machine (it 'works' to another 'remote' machine as well). It's not in /etc/ssh/sshd_config as it is the same except for the "ListenAddress". the /etc/rc.d/sshd scripts are the same as are the /etc/sysconfig/ssh files on the two systems. /etc/{profile,bash.bashrc} also the same on the two systems. Maybe some login config...I wouldn't think the PAM_LIB would filter. Anyway, that's where the problem stands. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Linda Walsh wrote:
Sam Clemens wrote:
Linda Walsh wrote: ... DISPLAY variable isn't being set ( to "[localhost:10.0]" (or anything). )
That's normally set at login, by login scripts.
On the target system, I (where bash is my shell), I am 'echo'ing 'DISPLAY' at the beginning of "/etc/profile". Isn't that the first startup script called by bash on an interactive login?
It is 'null' on the failing machines at that point.
Remember, when you SSH to another machine, the remote machine picks up the environment variables from the ssh that you initiated....which inherits them from your login shell.
I normally use DISPLAY "=:0" or "=0.0" on the local machine to talk to its X server, But use "X-Forwarding" on remote machines, so doesn't the remote 'sshd' have to set DISPLAY to correspond to the forwarded port?
set it to the IP address of the machine you're sitting at before doing ssh -X Use something like this: #if DISPLAY is not set, set to 0.0 on current host DISPLAY=${DISPLAY:-`hostname -i`:0.0}
So make sure that DISPLAY is properly set *BEFORE* you ssh.
Unfortunately, it isn't so easy (sigh). Value of DISPLAY is set to ":0", and exported (verified by using "printenv DISPLAY") in the 'ssh' case. Same behavior in a 2nd client prog (GUI based), where it appears to set DISPLAY in the forwarded environment to the hosts.
I verified that the GUI must be setting DISPLAY, or it wouldn't be working. I.e. -- unsetting DISPLAY in the shell and then running 'ssh' results in the remote DISPLAY var being "null" when bash starts.
LOCAL: lw> printenv DISPLAY :0 WORKING: lw> ssh working working:lw> echo "DISPLAY=$DISPLAY" DISPLAY=localhost:14.0 NOT WORKING: lw> ssh fail fail:lw> echo "DISPLAY=$DISPLAY" DISPLAY=
I don't see how it could be on the client machine (it 'works' to another 'remote' machine as well). It's not in /etc/ssh/sshd_config as it is the same except for the "ListenAddress". the /etc/rc.d/sshd scripts are the same as are the /etc/sysconfig/ssh files on the two systems. /etc/{profile,bash.bashrc} also the same on the two systems.
Maybe some login config...I wouldn't think the PAM_LIB would filter. Anyway, that's where the problem stands.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 2008-03-31 04:49, Linda Walsh wrote:
I noticed, recently, that when I log into a 10.3 based system, my DISPLAY variable isn't being set to "[localhost:10.0]" (or anything). I've upgraded more packages since I last knew it was working, but don't remoteX from this machine regularly, so I don't know exactly when it broke.
Most commonly, it's something as simple as: 1. ssh -X 2. make sure you have the 'xauth' binary installed on the target system (provided by xorg-x11.rpm) but I have also run across stupid sshd configs (god knows why the manpage says something that does not match reality) - in any case, if you have X11UseLocalhsot no you will experience problems. (By default, this is set to yes or is commented out and defaults to yes) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Jan Engelhardt
-
Linda Walsh
-
Sam Clemens