我本地的git配置的多账号,切换的时候需要使用ssh-add ~/.ssh/id_rsa_name这个命令,今天运行的时候出现Could not open a connection to your authentication agent.
这时可以使用:ssh-agent bash 命令,然后再次使用ssh-add ~/.ssh/id_rsa_name这个命令就没问题了。
如下:
[root@localhost wakavS]# ssh-add ~/.ssh/id_rsa_Leen
Could not open a connection to your authentication agent.
[root@localhost wakavS]# ssh-agent bash
[root@localhost wakavS]# ssh-add ~/.ssh/id_rsa_Leen
Enter passphrase for /root/.ssh/id_rsa_Leen:
Identity added: /root/.ssh/id_rsa_lidong (/root/.ssh/id_rsa_Leen)
二、还有一种方式:
eval ssh-agent
这个我没有试!
Author:leedaning
本文地址:http://blog.csdn.net/leedaning/article/details/49888335
本文介绍了当遇到本地Git配置多账号时,如何解决SSH连接认证代理失败的问题。提供了两种解决方案:一是通过ssh-agent命令重新加载密钥;二是eval ssh-agent命令的方式。这两种方法都能有效解决连接失败的问题。
1283

被折叠的 条评论
为什么被折叠?



