【发布时间】:2012-11-11 06:12:53
【问题描述】:
有很多堆栈文章引用了与我得到的相同的错误消息。
我在另一台计算机上浏览了整个 heroku 设置文档,一切正常。不知道为什么这个不起作用,但我需要它。
当我跑步时:
> git push -v heroku master
Pushing to git@heroku.com:lit-tor-7969.git
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Stack 上的所有解决方案都涉及重置 ssh 密钥,我相信 ssh 密钥没问题。我在 Mac OSX 上运行:
heroku keys:clear
heroku keys:add
所以在我看来,git 使用的是 /Users/bishopz/.ssh 密钥,而不是我在存储库文件夹中手动生成的密钥。
除了下面的答案,这篇文章似乎提供了很多见解: Cannot push to Heroku because key fingerprint
我尝试完全删除 .ssh 目录。我跑了
heroku keys:clear
ssh-add -D #to remove all ssh identities
ssh-keygen -t rsa -C "email@gmail.com" -f ~/.ssh/id_rsa_heroku
ssh-add ~/.ssh/id_rsa_heroku
heroku keys:add ~/.ssh/id_rsa_heroku.pub
git push heroku master
现在得到:
! Your key with fingerprint 27:5f:64:4e:2e:f0:41:5b:62:a9:95:d2:02:df:27:85 is not authorized to access lit-tor-7969.
fatal: The remote end hung up unexpectedly
对
的回应ssh -vvv git@heroku.com
现在:
debug1: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in /Users/bishopz/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: Offering RSA public key: /Users/bishopz/.ssh/id_rsa_heroku
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to heroku.com ([50.19.85.132]:22).
感谢任何帮助,如果有人可以发布适合我的答案,我将开始新的赏金。
【问题讨论】:
-
您确定将密钥添加到正确的帐户吗?也许您登录了错误的 Heroku 帐户。也许试试
heroku login。 -
你对 ssh 目录(和父目录)和文件有正确的保护吗?例如,请参阅stackoverflow.com/questions/13425811/git-ssh-authentication/…。
-
@BishopZ:你能发布
git push -v heroku master的输出吗?git config -l?