2011-02-27 47 views
7

我無法推動在github以及heroku使用git推,我已經嘗試過各種方法,如在question建議。請幫助解決這個問題..我看到下面的報告,而我試圖推動。無法推動大師heroku

D:\My\weblog>git push heroku master 
Permission denied (publickey). 
fatal: The remote end hung up unexpectedly 

D:\My\weblog>ssh -v [email protected] 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 
debug1: Connecting to heroku.com [50.16.232.130] port 22. 
debug1: Connection established. 
debug1: identity file /.ssh/identity type -1 
debug1: identity file /.ssh/id_rsa type -1 
debug1: identity file /.ssh/id_dsa type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia 
n-5pgsql1 
debug1: match: OpenSSH_5.1p1 Debian-5pgsql1 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_4.6 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-cbc hmac-md5 none 
debug1: kex: client->server aes128-cbc hmac-md5 none 
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug1: Host 'heroku.com' is known and matches the RSA host key. 
debug1: Found key in /.ssh/known_hosts:1 
debug1: ssh_rsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey 
debug1: Next authentication method: publickey 
debug1: Trying private key: /.ssh/identity 
debug1: Trying private key: /.ssh/id_rsa 
debug1: Trying private key: /.ssh/id_dsa 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

正在使用Windows 7。

+0

恩,你沒有權限? – Hamish 2011-02-27 23:15:46

+0

部署heroku代碼時可能發生[Permission denied(publickey))的重複。致命:遠程端意外掛斷](http://stackoverflow.com/questions/4269922/permission-denied-publickey-when-deploying-heroku-code-fatal-the-remote-end) – Nakilon 2012-01-15 00:54:16

回答

5

看起來好像heroku不接受你機器的公鑰。確保你已將你的公鑰寄給了heroku。 Heroku's guide on SSH keys應該有所幫助。

+0

它顯示相同的錯誤.. – sakthig 2011-02-27 23:26:24

+0

您是否能夠使用公共密鑰SSH連接到其他服務器? – 2011-02-28 00:05:29

+0

我是新手,現在無法訪問github和heroku ..我試圖在Ubuntu上工作,但它更糟糕.. heroku不會安裝在Ubuntu! – sakthig 2011-02-28 13:32:03

2

你可以嘗試在gem install heroku

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

+0

此鏈接幫助我解決了同樣的問題。我使用了heroku鍵來查看我有兩個鍵。然後我輸入heroku remove:keys [email protected]兩次刪除它們 - 然後使用heroku add:keys - 當我嘗試推送到heroku時,它工作。 – 2011-12-04 22:06:10

+0

謝謝..原來我在系統上有兩個鍵。 – baash05 2012-07-24 06:33:11

17

類型,然後上傳github上的RSA密鑰對Heroku的

$ heroku keys:add 
Uploading ssh public key /Users/adam/.ssh/id_rsa.pub 

一旦鑰匙配置了Heroku的和github上使用命令所有的代碼去github並從那裏到Heroku

git push heroku master 

很快你就會看到這些消息

-----> Heroku receiving push 
-----> Ruby/Rails app detected 
-----> Detected Rails is not set to serve static_assets 
+0

不知道'gem ...',但'heroku keys:add'絕對解決了我的問題(upvoted)。 – 2013-10-09 22:15:27

2

我跑進OSX上一個類似的問題與Heroku的-工具區/ 2.32.8。即使在追蹤heroku之後,我仍然沒有成功,直到我在默認路徑中使用了一個密鑰 - IE〜/ .ssh/id_rsa.pub。

+1

將密鑰放在id_rsa默認空間中是我可以做的*唯一*的事情,以使其工作。謝謝! – 2013-03-09 15:40:29

0

如果使用Windows和Cygwin,我必須先啓用Cygwin和管理員權限,然後才能讓我推送到Heroku。

0

我面臨同樣的問題。我用Git Bash修改了cmd命令來解決它。在Git上做所有事情。

1

我有同樣的問題 - 事實證明,我忘記了Windows 8沒有像Windows 7那樣默認啓用管理員權限的命令提示符。以管理員身份運行修復了我的問題。

1

在ubuntu上sudo su爲我解決了它。

當我使用ssh生成密鑰時,如果你閱讀「id_rsa.pub」的內容,那麼在文件末尾有一個用戶名。對我來說,它是「root @ pc-name」,但沒有sudo su,當前用戶名是「username @ pc-name」而不是「root @ pc-name」。 sudo su通過切換到「root @ pc-name」來解決這個問題。

+0

該解決方案適用於我。我懷疑更好的做法是用用戶角色生成密鑰,而不是使用root用戶。 – mpgarate 2013-09-07 00:34:40