SSH agent forwarding and tmux done right (2023)
Summary
The post analyzes SSH agent forwarding in the context of tmux sessions, explains how SSH_AUTH_SOCK paths can become stale when sessions are long-lived or tmux persists, and surveys common hacks to refresh agent sockets. It also presents a practical alternative in the ssh-agent-switcher project (written in Go) that aims to provide a more robust solution, discusses safety considerations, and reinforces the message that user authentication via forwarded agents can be fragile and requires careful handling.