17
11
I have a private key set up for my github account, the passphrase to which is, I believe, stored in OS X's keychain. I certainly don't have to type it in when I open a terminal window and enter ssh git@github.com
.
However, when I'm running bash over an ssh session, or locally inside a tmux session, I have to type in the passphrase every single time I attempt to ssh to github.
This question suggests that a similar problem exists with screen, but I don't really understand the issue well enough to fix it in tmux. There's also this page which includes a fairly complicated solution, but for zsh.
EDIT:
In response to @Mikel's answer, from a local terminal I get the following output:
[~]
$ echo $SSH_AUTH_SOCK
/tmp/launch-S4HBD6/Listeners
[~]
$ ssh-add -l
2048 [my key fingerprint] /Users/richie/.ssh/id_rsa (RSA)
[~]
$ typeset -p SSH_AUTH_SOCK
declare -x SSH_AUTH_SOCK="/tmp/launch-S4HBD6/Listeners"
Whereas over ssh or in tmux I get:
[~]
$ echo $SSH_AUTH_SOCK
[~]
$ ssh-add -l
Could not open a connection to your authentication agent.
[~]
$ typeset -p SSH_AUTH_SOCK
bash: typeset: SSH_AUTH_SOCK: not found
echo $SSH_AGENT_PID
returns nothing whatever shell I run it from.
What about
typeset -p SSH_AUTH_SOCK
? – Mikel – 2011-01-27T11:18:21.243@Mikel
bash: typeset: SSH_AUTH_SOCK: not found
from within ssh/tmux. I'll try it locally tonight, if necessary. – Rich – 2011-01-27T12:53:48.440@Mikel I've added that command's output to the question. – Rich – 2011-01-27T20:33:37.563
AFAIK, question and answers are not OS X-specific. That's relevant to avoid some non-OS X-specific dups, namely http://superuser.com/q/334975/46794 and http://superuser.com/q/479796/46794.
– Blaisorblade – 2013-09-19T08:33:01.800@Blaisorblade I was under the impression my passphrase was stored in the OS X keychain (Although I can't remember now why I believed that to be the case). Is that incorrect? – Rich – 2013-09-19T08:52:59.337
@Rich: true, but that's orthogonal. Everything applies also to Linux and OS X system where the password is not stored in the keychain, with only one exception. The exception is that usually, you'd have to call ssh-add to type the passphrase and load it into the ssh-agent daemon, and it'd last until reboot, while your setup avoids that (see https://help.github.com/articles/working-with-ssh-key-passphrases for details). I didn't know about that possibility!
– Blaisorblade – 2013-09-21T18:27:38.297