4

Normally I give my passphrase for the private key on the first ssh invocation and then I am not asked for the passphrase (in this and all other bash sessions).

However, under tmux, I am asked for the passphrase over and over even in the same bash (same tmux pane).

I think the problem originated with the Sierra.

How do I avoid having to enter my passphrase repeatedly under tmux?

PS. ssh-add -l prints The agent has no identities. both with and without tmux.

PPS. $SSH_AUTH_SOCK names an existing socket under /private/tmp....

3
  • Do you see the key in the ssh-add -l output? If not, the key is not in keyring or the tmux does not see the keyring (for some reason).
    – Jakuje
    Oct 13, 2016 at 17:11
  • @Jakuje: ssh-add -l prints The agent has no identities. both with and without tmux. but without tmux I am not asked for password!
    – sds
    Oct 13, 2016 at 17:27
  • I have the same issue. I also notice that enabling agent forwarding will set $SSH_AUTH_SOCK on the first remote machine but will not forward credentials properly. Nov 3, 2016 at 17:28

1 Answer 1

3

Open a new terminal window and run the following commands:

$ tmux new -s temp
$ ssh-agent
$ ssh-add

That seems to have fixed the issue for me; new tmux sessions now no longer ask me for my ssh key passphrase.

3
  • 1
    yes, of course that works. the question is why this was not necessary before.
    – sds
    Oct 14, 2016 at 18:59
  • 1
    @sds it looks like your question was actually how to avoid it - soooo your question was answered. And helped me too. :thumbs_up: Feb 2, 2017 at 22:26
  • What do these commands do, and why does this work?
    – user56834
    Sep 29 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .