Created
August 16, 2012 08:24
-
-
Save artyom/3368367 to your computer and use it in GitHub Desktop.
Persistent SSH_AUTH_SOCK for using with screen/tmux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this to your $HOME/.bashrc | |
# so you can safely use screen or tmux while preserving ssh-agent forwarding features | |
# of your ssh sessions | |
test "${SSH_AUTH_SOCK:-}" && test $SSH_AUTH_SOCK != $HOME/.ssh_auth_sock && { | |
test -L $HOME/.ssh_auth_sock && \ | |
test "$(readlink $HOME/.ssh_auth_sock)" = $SSH_AUTH_SOCK || \ | |
ln -sf $SSH_AUTH_SOCK $HOME/.ssh_auth_sock | |
export SSH_AUTH_SOCK=$HOME/.ssh_auth_sock | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment