[OpenAFS] significant delay for afs user to login as root via su

David S. Goldberg dsg@mitre.org
Thu, 18 Mar 2010 13:01:01 -0400


> - Assuming you're using ssh (I am guessing that you are), convince sshd
>   to write your Xauthority information somewhere else, like a file
>   in /tmp (and make sure your XAUTHORITY environment variable is correct).
>   I would guess this is possible, but I don't know if there's an easy
>   way to do it.

I do this with the following code in ~/.ssh/rc:

if [ "$DISPLAY" = "" ]; then exit 0 ; fi
if [ ! -d /tmp/.${USER} ]; then # I actually don't reference $USER -
                              # just put your own ID there.
    /bin/sh -c "umask 77 ; mkdir /tmp/.${USER}" ; 
    XAUTHORITY=/tmp/.${USER}/.Xauthority;
    export XAUTHORITY;
fi;
xauth remove $DISPLAY
read xauthstuff
xauth add $DISPLAY $xauthstuff

The second if statement is also in my shell profile to ensure
XAUTHORITY is properly set on subsequent shells, but with some
additional checks to ensure I don't interfere with any XAUTHORITY
setting generated when doing a console login.

-- 
Dave Goldberg
Associate Department Head, G06A: Advanced Technical Computing Center
The MITRE Corporation \ MS K331 \ 202 Burlington Rd. \ Bedford, MA 01730
dsg@mitre.org \ 781-271-3887 (W) \ 781-439-7875 (M)