Handle Xauth in ssh/rc.

This commit is contained in:
David Tomaschik
2021-01-21 22:37:36 -08:00
parent 6e6b63cb28
commit e6e66b0d05

View File

@@ -13,3 +13,15 @@ fi
if test \! -S "${REMOTE_LINK}" -a -S "${SSH_AUTH_SOCK}" ; then
ln -sf "${SSH_AUTH_SOCK}" "${REMOTE_LINK}"
fi
# Handle X forwarding, per sshd(8)
if read proto cookie && [ -n "$DISPLAY" ]; then
if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
# X11UseLocalhost=yes
echo add unix:`echo $DISPLAY |
cut -c11-` $proto $cookie
else
# X11UseLocalhost=no
echo add $DISPLAY $proto $cookie
fi | xauth -q -
fi