像许多其他人一样,尝试让我的应用程序推送到 Heroku,但不断出现此错误
$ heroku login
Enter your Heroku credentials.
Email: my@email.com
Password (typing will be hidden):
Found existing public key: /Users/scotty/.ssh/id_rsa.pub
Uploading SSH public key /Users/scotty/.ssh/id_rsa.pub... done
Authentication successful.
$ git push heroku master
! Your key with fingerprint xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx is not authorized to access todolist.
fatal: The remote end hung up unexpectedly
我完成了 Heroku page 上的所有步骤我已经尝试了这些类似问题中的大部分建议修复:
Why is my key w/ fingerprint not authorized when I try to push latest changes to Heroku?
Cannot push to Heroku because key fingerprint
我已经为 heroku 添加了一个新 key ,尝试了 ssh-add -D 命令删除所有 key ,从 Heroku 中删除了所有 key ,无论我尝试什么,我仍然会遇到同样的错误。
我只有一个 Heroku 帐户,所以多帐户问题不是问题所在。我现在只有一个 ssh key 用于我的 macbook 上的 github。
上面链接的答案中没有提到任何建议吗?
提前致谢。
最佳答案
生成一个新 key :
ssh-keygen -t rsa -f ~/.ssh/id_rsa_heroku
将其添加到您的本地 ssh 代理:
ssh-add ~/.ssh/id_rsa_heroku
确保新 key 显示在 ssh-agent 中:
ssh-add -l
使用 -d 标志删除不必要的键。 (这不会删除 key ,只会将其从 ssh-agent 中删除。)
ssh-add -d /Users/Niko/.ssh/id_rsa_hellonico
将 ssh key 添加到您的帐户:
https://dashboard.heroku.com/account
准备推送到heroku
git push heroku master
关于git - 带有指纹的 key 在 Heroku 中未经授权,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14161621/