2012-07-11 175 views
0

我想推送到heroku,但我得到一个权限被拒绝的错误。我已经按照从这些位置的文章:Heroku密钥不被接受

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

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

但那些不工作了。

这里是从外壳输出显示我想要做的事:

[root]# heroku keys 
    You have no keys. 
[root]# heroku login 
    Enter your Heroku credentials. 
    Email: [email protected] 
    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的服务器。

+0

你在Mac上吗?你是否在使用像'ssh-agent'这样的密钥管理器? – redhotvengeance 2012-07-11 20:28:09

+0

我在Mac上,但这是在CentOS服务器上。 – Peter 2012-07-11 20:32:27

+0

即使还在使用'ssh-agent'吗? – redhotvengeance 2012-07-11 21:14:57

回答

1

我想通了..我想你实际上需要使用id_rsa而不是自定义的..尽快我跑ssh-keygen -t rsa -f id_rsa它的工作。去搞清楚。

0

对于未来的访问者,我添加了另一个答案(在上面的@redhotvengeance注释之后),它不要求您为您的heroku密钥使用id_rsa。 以下一系列命令启动ssh-agent和使推成为成功的将您的Heroku键:

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

,它的工作很好。

相关问题