Hi
The way tmux works is that when you start the server the environment
(including SSH_AUTH_SOCK) is copied into the global environment and that
is used for all new panes.
Then by default SSH_AUTH_SOCK is updated from the shell into the session
environment when you attach (unless you change the update-environment
option), which means its new value will be used for new panes in the
attached session. But not for existing panes, tmux has no way to change
those. If you have an existing pane with the wrong SSH_AUTH_SOCK, you
will need to fix it yourself.
You will have to work out how that matches to what you are doing
yourself because what you describe makes no sense to me.
Using a new ssh-agent every time you login but keeping a tmux server
running all the time doesn't work well because SSH_AUTH_SOCK in all
existing panes in tmux will become out of date every time you start a
new ssh-agent.
It is better to start an ssh-agent the first time you log in (before you
start tmux the first time) and then use the same one forever so
SSH_AUTH_SOCK is not constantly changing. The easiest way to do that is
to do it in your shell profile with something like:
if [ ! -f ~/.ssh.agent ]; then
ssh-agent -s >~/.ssh.agent
fi
eval `cat ~/.ssh.agent` >/dev/null
if ! kill -0 $SSH_AGENT_PID 2>/dev/null; then
ssh-agent -s >~/.ssh.agent
eval `cat ~/.ssh.agent` >/dev/null
fi
> --
> You received this message because you are subscribed to the Google Groups "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
tmux-users+...@googlegroups.com.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/tmux-users/ffa770a1-111f-53e4-3787-dbf631c24ce8%40uni-bielefeld.de.