我遇到了以下错误:

$ 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/config文件。

附加以下内容-

Host github.com
 IdentityFile ~/.ssh/github_rsa

给我提示的页面为Git设置SSH说单空格缩进很重要。。。尽管我在Heroku有一个配置,它没有足够的空间,工作正常。

其他回答

尝试以下操作:

ssh-agent sh -c 'ssh-add && git push heroku master'

对于Windows用户,我发现cmd eval“ssh agent-s”不起作用,但使用Git Bash效果不错:

eval `ssh-agent -s`; ssh-add KEY_LOCATION

并确保Windows服务“OpenSSH密钥管理”未被禁用。

Run

ssh-agent bash
ssh-add

要获取更多详细信息,您可以搜索

ssh-agent

或运行

man ssh-agent

在Windows 8.1 E上使用Git Bash,我的解决方案如下:

eval $(ssh-agent) > /dev/null
ssh-add ~/.ssh/id_rsa

在~/.ssh中创建配置文件并设置PERMANENTLY,主机可以是ip/domain它没有在windows10中测试

Host 20.16.4.5
IdentityFile ~/.ssh/id_rsa_ec2

如果你想过去,就去酒吧。在aws中使用1将PEM中的私钥复制到.ssh文件夹

$ cp /path/to/my-aws-ec2-instance.pem ~/.ssh/id_rsa_ec2

2生成并保存公钥

 ssh-keygen -y -f /path/to/my-aws-ec2-instance.pem > ~/.ssh/id_rsa_ec2.pub

AND SET(手动将密钥永久添加到代理),然后使用ec2而不使用pemssh软件ec2-user@ec2-ip.compute-x.amazonaws.com