2

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....

  • 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 '16 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 '16 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. – Sam Brightman Nov 3 '16 at 17:28
2

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.

  • 1
    yes, of course that works. the question is why this was not necessary before. – sds Oct 14 '16 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: – Misterparker Feb 2 '17 at 22:26

You must log in to answer this question.

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