Last Updated: February 25, 2016
· fsproru

Lost connection to ssh-agent in tmux


git clone git:// ~/.ssh-find-agent

# add to your .bashrc or .zshrc
source ~/.ssh-find-agent/ssh-find-agent.bash
if ! test $SSH_AUTH_SOCK; then

Long Version

- Mac OS X
- tmux
- ssh key with passphrase

When I open a new tmux window or pane, I need to enter my passphrase every time I use ssh or pull from github. The reason is the connection to ssh-agent is lost in new tmux window.

Find and use the existing ssh socket inside a new tmux window.

1 Response
Add your response

I find tmux useful only on server as on Mac OS iTerm2 is more than enough (if you're pair programming, it's probably better to connect on server anyway). I had a LOT of problems similar to this when using locally (clipboard, scrolling, encoding etc.)

over 1 year ago ·