Skip to content

Instantly share code, notes, and snippets.

@joshenders
Created March 13, 2015 12:47
Show Gist options
  • Save joshenders/2b00068dbade6d684c45 to your computer and use it in GitHub Desktop.
Save joshenders/2b00068dbade6d684c45 to your computer and use it in GitHub Desktop.
/etc/ssh/sshrc to fix X11 Forwarding on Debian
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
@joshenders
Copy link
Author

Warning: untrusted X11 forwarding setup failed: xauth key data not generated
X11 connection rejected because of wrong authentication.
Error: Can't open display: localhost:10.0

@andrey-malets
Copy link

@joshenders , thanks for this!

@joshenders
Copy link
Author

@andrey-malets glad it was helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment