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
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 $HOME/. Xauthority- $HOSTNAME
export XAUTHORITY=
fi
Unfortunately, ssh calls xauth before setting the user environment so I use the following ~/.ssh/rc file:
if [ -n "$DISPLAY" ] ; then Xauthority- $HOSTNAME add unix:$(echo $DISPLAY | cut -c11-) $proto $cookie ;; Xauthority- $HOSTNAME add $DISPLAY $proto $cookie ;;
if read proto cookie ; then
case $DISPLAY in
localhost:*) xauth -f $HOME/.
*) xauth -f $HOME/.
esac
fi
fi