Skip to content

Instantly share code, notes, and snippets.

@redrick
Created August 9, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redrick/3b0113ecc7e636c77da7d6bd5cbf6db3 to your computer and use it in GitHub Desktop.
Save redrick/3b0113ecc7e636c77da7d6bd5cbf6db3 to your computer and use it in GitHub Desktop.
.ssh/rc config file macOS for screen
# Fix SSH auth socket location so agent forwarding works with screen.
if test "$SSH_AUTH_SOCK" ; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi
# Taken from the sshd(8) manpage.
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