less than 1 minute read

  • How to forward ssh public keys through Tmux windows?
cat<<~/.bashrc>>EOF
# forward ssh-agent
[[ -z $(pgrep ssh-agent) ]] && eval `ssh-agent` &>/dev/null
if [[ -S "$SSH_AUTH_SOCK" && ! -h "$SSH_AUTH_SOCK" ]]; then
    ln -sf "$SSH_AUTH_SOCK_LOCAL" ~/.ssh/ssh_auth_sock;
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock; # already in ~/.ssh/config
EOF
cat<<~/.ssh/config>>EOF
ForwardAgent yes
IdentityAgent ~/.ssh/ssh_auth_sock
EOF

SOURCES

Updated: