git ssh-add报错:Could not open a connection to your authentication agent

今天配置ssh到ssh-add这步一直报错:Could not open a connection to your authentication agent.

百度了很多方法,最终在stackexchange上终于找到了解决方案。
我亲测有用的是用这个命令:

eval "$(ssh-agent)"

然后再 ssh-add 。
如果已经有ssh的进程,运行这个:

ps aux | grep ssh

然后再kill掉ssh的所有进程,再运行eval "$(ssh-agent)",再运行ssh-add。
更多方法贴下链接,可能需要翻q。
https://unix.stackexchange.com/questions/48863/ssh-add-complains-could-not-open-a-connection-to-your-authentication-agent/48868#48868

你可能感兴趣的:(git ssh-add报错:Could not open a connection to your authentication agent)