Re: X11Forwarding, ssh -X, and /bin/su

From: Per Hedeland (
Date: 07/09/04

Date: Thu, 8 Jul 2004 23:59:17 +0000 (UTC)

In article <cckkkn$5k2$> (Bill Unruh) writes:
> (Per Hedeland) writes:
>]Btw, some Linux systems (perhaps others too) have PAM modules that do
>]something like this "under the cover" when you 'su' - e.g. pam_xauth on
>]RedHat. After su'ing on RH7.2, I get this (not done by my script):
>]# echo $XAUTHORITY
>]It caused some other weird problem that I've since forgotten, though...
>Ah. Yes, it does. I have had situations where when I then tried to su to a
>user it tried to read that file, and of course timed out after 40 sec .

Hm, that does sound vaguely familiar, but on a quick test now it seems
to do the right thing:

duva 1> echo $XAUTHORITY
XAUTHORITY: Undefined variable.
duva 2> su test
[test@duva per]$ echo $XAUTHORITY
[test@duva per]$ su
[root@duva per]# echo $XAUTHORITY
[root@duva per]# su test
[test@duva per]$ echo $XAUTHORITY
[test@duva per]$ xterm (works, SSH-tunneled)

--Per Hedeland