我本地的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