Comment 5 for bug 269954

Revision history for this message
stef70 (stephane-chauveau-central) wrote :

I found a workaround for the ssh problem: create a different Xauthority file on each host.

That can be done from the client side as follow:

First of all, add something like that in your bashrc file:

if [ -n "$SSH_CLIENT" ] ; then
  export XAUTHORITY=$HOME/.Xauthority-$HOSTNAME
fi

Unfortunately, ssh calls xauth before setting the user environment so I use the following ~/.ssh/rc file:

if [ -n "$DISPLAY" ] ; then
  if read proto cookie ; then
   case $DISPLAY in
     localhost:*) xauth -f $HOME/.Xauthority-$HOSTNAME add unix:$(echo $DISPLAY | cut -c11-) $proto $cookie ;;
     *) xauth -f $HOME/.Xauthority-$HOSTNAME add $DISPLAY $proto $cookie ;;
   esac
 fi
fi