Skip to content

Instantly share code, notes, and snippets.

@simonplend
Created March 29, 2013 12:06
Show Gist options
  • Save simonplend/5270448 to your computer and use it in GitHub Desktop.
Save simonplend/5270448 to your computer and use it in GitHub Desktop.
Solution taken from http://superuser.com/a/180149 - IMPORTANT: chmod 755 ~/.ssh/rc
#!/bin/bash
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment