35
19

More than 5 years have passed since last update.

ssh-add で Could not open a connection to your authentication agent が出るときの対処法

Posted at

一発でうまくいかなかったので備忘録。

$eval 'ssh-agent' ではなく、 $eval '$(ssh-agent)'

ここを参考にして実行したらうまくいった。
http://tech.clickyourstyle.com/articles/105
windowsの Git Bash にて

  • 成功例
$ eval "$(ssh-agent)"
Agent pid 9236
$ ssh-add ~/.ssh/id_rsa
Enter passphrase for /c/Users/user/.ssh/id_rsa:
Identity added: /c/Users/user/.ssh/id_rsa (/c/Users/user/.ssh/id_rsa)
  • 失敗例
$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-ah8DHOFKYZ7I/agent.9328; export SSH_AUTH_SOCK;
SSH_AGENT_PID=10348; export SSH_AGENT_PID;
echo Agent pid 10348;
$ eval "ssh-agent"
SSH_AUTH_SOCK=/tmp/ssh-5cOTHuFsw33d/agent.8056; export SSH_AUTH_SOCK;
SSH_AGENT_PID=10544; export SSH_AGENT_PID;
echo Agent pid 10544;
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.

そのうち違いを調べる。

35
19
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
35
19