我遇到了以下错误:

$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
!  Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter.

我尝试添加密钥,但出现以下错误:

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

当前回答

我尝试了其他解决方案,但都没有效果。我做了更多的研究,发现以下命令有效。我正在使用Windows 7和Git Bash。

eval $(ssh-agent)

更多信息:https://coderwall.com/p/rdi_wq(web存档版本)

其他回答

甚至在生成和添加SSH密钥时运行命令时,我也收到了“无法打开到您的身份验证代理的连接”:SSH-add~/.SSH/id_rsa。

我通过停止在我的计算机上运行的多个ssh代理实例来解决这个问题,然后从我的Windows计算机上的控制面板卸载Git,然后再次安装Git,现在一切都正常了。

我通过强制停止(终止)git进程(ssh代理),然后卸载git,然后再次安装git来解决这个错误。

这个解决方案很可能对你有用,再试一次

在我的例子中,它与DNS映射有关(bitbucket没有指向正确的IP)。我通过一个简单的技巧修复了它(在查找bitbucket.org时,我重写了IP地址)

在ubuntu中打开和编辑/etc/hosts(如果是任何其他操作系统,请查看如何做到这一点)

sudo vim /etc/hosts

并添加以下行(如果是GitHub或任何其他网站,请查找IP并相应地进行映射)

18.205.93.2 bitbucket.org

然后就能解决问题

以下命令对我有效。我使用的是CentOS。

exec ssh-agent bash

如果你遵循这些指示,你的问题就会解决。

如果您在Mac或Linux计算机上,请键入:

eval "$(ssh-agent -s)"

如果您在Windows计算机上,请键入:

ssh-agent -s