ssh-add倒入报错 Could not open a connection to your authentication agent

in mini.topia5 years ago

ssh-add倒入报错 Could not open a connection to your authentication agent

从github上 clone项目后,想提交修改,需要具有提交权限。

所以在自己的fork项目上,添加ssh认证。

提交 rsa 的公钥到github后,在本地执行 ssh-add 添加 RSA 私钥到系统中时出现错误

$ ssh-add ~/.ssh/userxxx.rsa 
Could not open a connection to your authentication agent.

需要先执行如下命令

$ ssh-agent bash
$ ssh-add ~/.ssh/userxxx.rsa 
Identity added: /home/userxxx/.ssh/userxxx.rsa (userxxx@mail.com)

添加完成。