Skip to content

Instantly share code, notes, and snippets.

@mrwacky42
Created October 27, 2014 23:36
Show Gist options
  • Save mrwacky42/f49316f4b7211a59b798 to your computer and use it in GitHub Desktop.
Save mrwacky42/f49316f4b7211a59b798 to your computer and use it in GitHub Desktop.
## Modified solution of: http://superuser.com/a/180149
## If it is not pointing at an active socket, make the link.
if test "$SSH_AUTH_SOCK" ; then
real_sock=$(readlink ~/.ssh/ssh_auth_sock)
if [ -z "$real_sock" -o ! -S "$real_sock" ]; then
ln -sf $SSH_AUTH_SOCK ~/.ssh/ssh_auth_sock
fi
fi
@mrwacky42
Copy link
Author

And in ~/.screenrc

## Save me from having to twiddle with the auth sock every time I reattach to a screen
setenv SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock

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