有很多堆栈文章引用了我得到的相同错误信息。
我在另一台电脑上完整地阅读了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 login
命令。 - arbalesgit push -v heroku master
的输出吗?还有git config -l
的输出? - mgarciaisaia