我遇到了这个错误:
$ 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.
ssh-agent吗? 您可能需要在运行ssh-add命令之前启动ssh-agent :
eval `ssh-agent -s`
ssh-add请注意,这将在 Windows 上启动msysgit Bash的代理。如果您使用的是其他 shell 或操作系统,则可能需要使用该命令的变体,例如其他答案中列出的变体。
请参阅以下答案:
要自动启动 ssh-agent 并允许单个实例在多个控制台窗口中工作,请参阅登录时启动 ssh-agent 。
eval而不仅仅是ssh-agent ? 要找出原因,请参阅Robin Green 的回答 。
此外,每当我使用ssh-add ,我总是添加私钥。文件~/.ssh/id_rsa.pub看起来像一个公钥,我不确定这是否有用。你有~/.ssh/id_rsa文件吗?如果你在文本编辑器中打开它,它是否说它是私钥?
我尝试了其他解决方案无济于事。我做了更多研究,发现以下命令有效。我使用的是 Windows 7 和Git Bash 。
eval $(ssh-agent)更多信息请访问: https : //coderwall.com/p/rdi_wq
以下命令对我有用。我正在使用 CentOS。
exec ssh-agent bash