我需要添加多个ssh key ,所以我需要执行ssh-add
但是我收到错误消息Could not open a connection to your authentication agent
我读了很多帖子,比如 Could not open a connection to your authentication agent和 https://superuser.com/questions/901568/ssh-agent-could-not-open-connection
我已经通过
启动了 ssh-agenteval ($ssh-agent -s)
输出如下: 代理 pid 13524
但还是报错:
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.
我也设置了
git config --global url."https://".insteadOf git://
然后我回显了一些变量并得到了这个:
echo $SSH_AGENT_PID
12340
echo $SSH_AUTH_SOCK
/tmp/ssh-ZbRZr10908/agent.10908
PS:我用的是Windows 7,下属公司网络。
最佳答案
我在网上尝试了很多解决方案,但都没有用。我进行了更多研究,发现以下命令有效。
- sudo ssh-agent bash
- ssh-add /home/user/.ssh/id_rsa
关于git - "Could not open a connection to your authentication agent",即使在 ssh-agent 启动后 ssh-add 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33227125/