我无法将代码推送到 Heroku。我有一个帐户,但我忘记了密码。我创建了一个新帐户并尝试使用它进行推送,但现在它向我显示此错误:
Your account someoneelse@gmail.com does not have access to
! SSH Key Fingerprint:
如何使用新帐户登录?我想用新帐户删除此错误消息。我已将最新的 ssh key 上传到 heroku。我已尽一切努力在 heroku 上推送代码(基本设置),但我无法克服此错误。
您帐户中的任何应用程序都有两个 ssh key ,您应该删除一个不在“~/.ssh/”文件夹中的 key ,或者按照以下步骤操作。
解决方法如下:
转到 www.heroku.com并使用引发错误的帐户登录。
转到应用程序设置。 (例如,对于名为“rails-demo”的应用程序,转到 rails-demo 设置并检查是否有两个 ssh key )
删除系统中不再存在的 key
或者您可以删除它们,然后使用这些命令生成新的。
-> ssh-keygen -t rsa
-> heroku keys:add
上传新的然后在你的控制台输入
-> heroku登录
使用您的帐户登录,然后将其推送到您的应用。
现在已经解决了。
最佳答案
你需要:
- 清除 Heroku 应用程序中您本地没有的任何额外 ssh key (请参阅 SSR 的 edit)
注册您的新帐户(如“Managing Multiple Heroku Accounts”中所述):
(2013 年,heroku accounts:add myNewAccount
ddollar/heroku-accounts
已弃用)
使用heroku/heroku-accounts
使用heroku plugins:install heroku-accounts
heroku accounts:add myNewAccount
后跟 Heroku 凭据(电子邮件、密码)
确保your ~/.ssh/config
file has an 'myNewAccount
' entry
Host heroku.myNewAccount
HostName heroku.com
IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa
IdentitiesOnly yes
然后更改远程“来源”url:
git remote set-url origin git@heroku.myNewAccount:<appname>.git
或者,作为 Ian Vaughan comments below
origin
is normallyheroku
when using the 'heroku-toolbelt':
git remote set-url heroku git@heroku.myNewAccount:<appname>.git
最后一步将确保 git push
将使用您的新帐户,而不是旧帐户。
在“Multiple heroku accounts”中查看更多信息。
如果在配置文件中添加“User git”,则可以删除凭据用户名“git
”:
Host heroku.myNewAccount
User git
HostName heroku.com
IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa
IdentitiesOnly yes
这意味着您可以使用:
git remote set-url origin heroku.myNewAccount:<appname>.git
# or
git remote set-url heroku heroku.myNewAccount:<appname>.git
关于git - Heroku:您的帐户 example@email.com 无权访问 <app-name>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20586992/