Heroku钥匙不被接受

时间:2012-07-11 20:11:53

标签: git heroku ssh

我正在尝试推送到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服务器的。

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

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

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

它运作良好。

相关问题