-
-
Save alexandregz/0092cde2da3ccc0602044ed82016d6e1 to your computer and use it in GitHub Desktop.
Sane SSH_AUTH_SOCK handling for Screen and Tmux, so that new SSH agents created by subsequent logons are still usable.
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
_ssh_auth_save() { | |
ln -sf "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh-auth-sock.$HOSTNAME" | |
} | |
alias screen='_ssh_auth_save ; export HOSTNAME=$(hostname) ; screen' | |
alias tmux='_ssh_auth_save ; export HOSTNAME=$(hostname) ; 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
unsetenv SSH_AUTH_SOCK | |
setenv SSH_AUTH_SOCK $HOME/.ssh/ssh-auth-sock.$HOSTNAME |
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
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY" | |
set-environment -g SSH_AUTH_SOCK $HOME/.ssh/ssh-auth-sock.$HOSTNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment