git 您的帐户 [email protected] 无权访问 <app-name>

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20586992/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:28:29  来源:igfitidea点击:

Your account [email protected] does not have access to <app-name>

githerokuruby-on-rails-4

提问by SSR

I am having trouble pushing code to heroku. I have an account but I've forgotten password. I created a new account and tried to push with it but now it shows me this error:

我无法将代码推送到 heroku。我有一个帐户,但我忘记了密码。我创建了一个新帐户并尝试使用它进行推送,但现在它显示了这个错误:

Your account [email protected] does not have access to
! SSH Key Fingerprint: 

How can I log in with the new account? I'd like to remove this error message with a fresh account. I have uploaded my latest ssh key to heroku. I have tried everything to push code on heroku (basic setup), but I can't get past this error.

如何使用新帐户登录?我想使用新帐户删除此错误消息。我已将我最新的 ssh 密钥上传到 heroku。我已经尝试了一切在 heroku 上推送代码(基本设置),但我无法克服这个错误。



Any application in your account has two ssh key and you should remove one which is not in your "~/.ssh/" folder or follow these steps.

您帐户中的任何应用程序都有两个 ssh 密钥,您应该删除不在“~/.ssh/”文件夹中的一个,或按照以下步骤操作。

Here's the solution:

这是解决方案:

  1. Go to www.heroku.com and login with the account that raises the error.
  2. Go to the applications settings. (e.g. for an application named "rails-demo", go to rails-demo settings and check whether there are two ssh keys)

  3. Remove the key which is no longer in your system

  4. Or you can remove them both and then generate new one with these commands.

    -> ssh-keygen -t rsa

    -> heroku keys:add

  5. Upload the new one and then in your console type

    -> heroku log-in

  6. Log in with your account and then push it to you app.
  7. It's solved now.
  1. 转到 www.heroku.com 并使用引发错误的帐户登录。
  2. 转到应用程序设置。(例如,对于名为“rails-demo”的应用程序,请转到 rails-demo 设置并检查是否有两个 ssh 密钥)

  3. 删除不再在您的系统中的密钥

  4. 或者您可以将它们都删除,然后使用这些命令生成新的。

    -> ssh-keygen -t rsa

    -> heroku keys:add

  5. 上传新的,然后在您的控制台类型中

    -> heroku log-in

  6. 使用您的帐户登录,然后将其推送到您的应用程序。
  7. 现在已经解决了。

采纳答案by VonC

You need to:

你需要:

  • 清除本地没有的 Heroku 应用程序中的任何额外 ssh 密钥(请参阅SSR编辑
  • 注册您的新帐户(如“管理多个 Heroku 帐户”中所述):

    heroku accounts:add myNewAccount(2013,ddollar/heroku-accounts不建议使用)
    使用heroku/heroku-accountsheroku plugins:install heroku-accounts
    heroku accounts:add myNewAccount随后Heroku的凭据(电子邮件,密码)

Make sure your ~/.ssh/configfile has an 'myNewAccount' entry

确保您的~/.ssh/config文件有一个“ myNewAccount”条目

Host heroku.myNewAccount
  HostName heroku.com
  IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa
  IdentitiesOnly yes

And then change the remote 'origin' url:

然后更改远程“来源”网址

git remote set-url origin [email protected]:<appname>.git

Or, as Ian Vaughancomments below

或者,正如伊恩·沃恩( Ian Vaughan)在下面评论的那样

originis normally herokuwhen using the 'heroku-toolbelt':

origin通常heroku在使用“heroku-toolbelt”时:

git remote set-url heroku [email protected]:<appname>.git

That last step will make sure the git pushwill use your new account, and not the old one.

最后一步将确保git push将使用您的新帐户,而不是旧帐户。

See more at "Multiple heroku accounts".

在“多个 heroku 帐户”中查看更多信息。



If you add "User git" in your config file, you can remove the credential user name 'git':

如果在配置文件中添加“User git”,则可以删除凭据用户名“ git”:

Host heroku.myNewAccount
  User git
  HostName heroku.com
  IdentityFile ~/.ssh/id_heroku_myNewAccount_rsa
  IdentitiesOnly yes

That means you can use:

这意味着您可以使用:

git remote set-url origin heroku.myNewAccount:<appname>.git
# or
git remote set-url heroku heroku.myNewAccount:<appname>.git

回答by funroll

This worked for me:

这对我有用:

$ heroku auth:logout

Then

然后

$ heroku auth:login

回答by Divyang Hirpara

I hope this work for you. By using this gem you can manage multiple account https://github.com/ddollar/heroku-accounts

我希望这对你有用。通过使用这个 gem 你可以管理多个帐户 https://github.com/ddollar/heroku-accounts

回答by Swati

Remove ssh key from your "homedir/.ssh" and check whether from that ssh key would not be available there.

从您的“homedir/.ssh”中删除 ssh 密钥并检查该 ssh 密钥是否在那里不可用。

I solved using your question after update.

我在更新后使用你的问题解决了。

回答by Saqib R.

If you have multiple accounts then login with the new or required one

如果您有多个帐户,请使用新帐户或所需帐户登录

$ heroku login
Enter your Heroku credentials.
Email: [email protected]
Password: 

$ heroku keys:add

generate keys if you have old one already in use for another heroku account.

如果您的旧密钥已用于另一个 heroku 帐户,请生成密钥。