【问题标题】:Heroku key not acceptedHeroku 密钥不被接受
【发布时间】:2012-07-11 13:04:51
【问题描述】:

我正在尝试推送到 heroku,但出现权限被拒绝错误。我关注了这些位置的文章:

https://devcenter.heroku.com/articles/keys

Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly

但这些都行不通。

这是 shell 的输出,显示我正在尝试做的事情:

[root]# heroku keys
  You have no keys.
[root]# heroku login
  Enter your Heroku credentials.
  Email: myemail@domain.com
  Password (typing will be hidden): 
  Found the following SSH public keys:
  1) github.pub
  2) heroku.pub
  Which would you like to use with your Heroku account? 2
  Uploading SSH public key /root/.ssh/heroku.pub... done
  Authentication successful.
[root]# git init
  Reinitialized existing Git repository in /.git/
[root]# git push heroku master
  Permission denied (publickey).
  fatal: The remote end hung up unexpectedly

编辑:这是针对 CentOS 服务器的。

【问题讨论】:

  • 您使用的是 Mac 吗?您是否使用像 ssh-agent 这样的密钥管理器?
  • 我在 Mac 上,但这是在 CentOS 服务器上。
  • 即便如此,ssh-agent 还在使用吗?

标签: git heroku ssh


【解决方案1】:

我想通了.. 我猜你实际上需要使用 id_rsa 而不是自定义的.. 当我运行ssh-keygen -t rsa -f id_rsa 时它就起作用了。去图吧。

【讨论】:

    【解决方案2】:

    对于未来的访问者,我添加了另一个答案(在上面的@redhotvengeance 评论之后),它不需要您使用 id_rsa 作为您的 heroku 密钥。 以下一系列命令启动 ssh-agent 并添加您的 heroku 密钥,以便推送成功:

    ssh-agent
    ssh-add ~/.ssh/my_heroku_key
    # now it should work
    git push heroku master
    

    而且效果很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-28
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多