From 56b5273149826dcedb62998357ec756abf74712f Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 15 May 2020 23:42:23 +1200 Subject: [PATCH 1/1] sshrc needs to handle xauth --- .ssh/rc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.ssh/rc b/.ssh/rc index a70d65c..a755dca 100644 --- a/.ssh/rc +++ b/.ssh/rc @@ -3,3 +3,14 @@ PERSISTENT_AUTH_SOCK=$VARDIR/ssh/persistent-ssh-auth.sock if [ ! -S "$PERSISTENT_AUTH_SOCK" ] && [ -S "$SSH_AUTH_SOCK" ]; then ln -sf "$SSH_AUTH_SOCK" "$PERSISTENT_AUTH_SOCK" fi + +if [ -n "${DISPLAY:-}" ]; then + read proto cookie + if [ "${DISPLAY%%:*}" = 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 -- 2.39.5