Created
October 6, 2014 08:56
-
-
Save bergman/15ea3ff301c1f716b85b to your computer and use it in GitHub Desktop.
tmux ssh-agent forwarding
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
# this file goes in ~/.ssh/rc | |
if [ -S "$SSH_AUTH_SOCK" ]; then | |
# This gets executed by sshd on every client login, symlinking the forwarded | |
# agent socket into a predictable location to be picked up by tmux. | |
ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh_auth_sock" | |
fi |
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
# disable auto updating of things like SSH_AUTH_SOCK | |
set -g update-environment "" | |
if-shell '[ -h ~/.ssh/ssh_auth_sock ]' "set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment