【问题标题】:Your key with fingerprint (..) is not authorized (collaboration)您的带指纹 (..) 的密钥未经授权(协作)
【发布时间】:2012-06-01 06:01:33
【问题描述】:

虽然有很多关于此错误的问题,但所有这些问题都与收到错误的人创建的应用有关,并没有帮助解决我的问题。我已被添加为 heroku 应用程序的合作者。当我尝试通过

克隆 heroku 存储库时
git clone git@heroku.com:myapp.git -o heroku

或者如果我从 github 克隆它所基于的代码并运行

git push heroku master(在做了 git add 和 git commit 之后)

它给了我错误“您的带指纹 (...) 的密钥无权访问 myapp。”我尝试了各种heroku 键的组合:add、heroku 键:clear 和 ssh-keygen。

此应用程序的其他合作者在推送到 heroku 时没有遇到任何问题。

【问题讨论】:

标签: git heroku github key fingerprint


【解决方案1】:

我收到此错误是因为我使用了多个 Heroku 帐户:

我想这样做,以便我可以使用自己的 Heroku 帐户独立“玩”,同时与团队/项目帐户上的其他人协作。

这与 Heroku 中多人协作团队帐户的概念是分开的:我希望团队帐户成为协作的应用所有者,这样我的个人帐户就可以像其他帐户一样充当特权较低的协作者的团队。只有所有者才能:添加/删除付费插件、删除/重命名应用程序以及查看发票。

对于多帐户支持(例如,您自己的个人 heroku 帐户),您需要添加这个文档不太完善的插件:

$ heroku 插件:安装 git://github.com/ddollar/heroku-accounts.git

见:https://github.com/ddollar/heroku-accounts

这就是你的 git SSH 设置最终的样子:

(venv)MacPro:your_project username$ more .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = ssh://your_username@git.your_org.com/your_project.git
[branch "master"]
        remote = origin
        merge = refs/heads/master
[remote "heroku_kb"]
        url = git@heroku.individual:your_individual_app.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
[remote "heroku_ocp"]
        url = git@heroku.your_project:your_team_app.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
[heroku]
        account = individual

上面的最后三个部分定义了两个独立的 heroku 遥控器并指定哪个是活动的。

heroku-accounts 插件通过添加 ~/.ssh/config 条目使所有这些工作:

Host heroku.individual
  HostName heroku.com
  IdentityFile "/Users/username/.ssh/identity.heroku.individual"
  IdentitiesOnly yes

Host heroku.your_project
  HostName heroku.com
  IdentityFile "/Users/username/.ssh/identity.heroku.your_project"
  IdentitiesOnly yes

如果你不这样分开账户,一个 SSH 密钥会干扰另一个,你最终会像我一样陷入 SSH 困境,在谷歌/论坛中寻找一个看起来像这样的错误:

MacPro:your_project username$ git push heroku master

 !  Your key with fingerprint cf:5b:6b:91:d5:71:e8:8b:73:dc:cf:86:56:fd:7a:49 is not authorized to access [insert appname here].

fatal: The remote end hung up unexpectedly

【讨论】:

    【解决方案2】:

    您可能拥有多个 ssh 密钥,并且默认使用了错误的密钥。要解决此问题,您需要配置 SSH 以将正确的密钥发送到 heroku.com。详情请见this answer on Super User

    【讨论】:

      【解决方案3】:

      这听起来像是某种配置问题。您确实应该仔细检查您对应用程序具有适当的权限,并且您的 SSH 密钥已在 heroku 中注册。

      确保您使用的是您认为自己正在使用的密钥。从本质上讲,cat ~/.ssh/id_rsa.pub(或您使用的任何键)应该显示在 heroku keys --long 中。

      阅读https://devcenter.heroku.com/articles/keys了解更多信息。

      【讨论】:

      • 如何检查密钥是否已注册以及正在使用哪些密钥?我已经多次查看该网站,但仍然没有帮助。
      猜你喜欢
      • 2012-12-19
      • 2012-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-22
      • 2013-05-16
      • 1970-01-01
      • 2019-12-03
      相关资源
      最近更新 更多