Skip to content

Instantly share code, notes, and snippets.

@var-bin
Last active March 9, 2017 19:42
Show Gist options
  • Save var-bin/a1b7b506572084e9b98e549745683fb5 to your computer and use it in GitHub Desktop.
Save var-bin/a1b7b506572084e9b98e549745683fb5 to your computer and use it in GitHub Desktop.
Making SSH_AUTH_SOCK work between detaches in tmux/screen. Repository https://github.com/var-bin/terminalForCoder__WSD
# Making SSH_AUTH_SOCK work between detaches in tmux/screen
if [[ ! -z "$SSH_AUTH_SOCK" -a "$SSH_AUTH_SOCK" != "$HOME/agent_sock" ]]
then
unlink "$HOME/agent_sock" 2>/dev/null
ln -s "$SSH_AUTH_SOCK" "$HOME/agent_sock"
export SSH_AUTH_SOCK="$HOME/agent_sock"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment