2012-07-11 67 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 

,它的工作很好。