2012-06-23 92 views
3

我试图运行heroku-django教程(使用Ubuntu 12.04),似乎因为某种原因,我不能推入到heroku。这里是发生了什么:git push heroku master给出错误ssh:连接到主机heroku.com端口22:连接拒绝

[email protected]:~/hellodjango$ git init 
Reinitialized existing Git repository in /home/yeinhorn/hellodjango/.git/ 
[email protected]:~/hellodjango$ git add . 
[email protected]:~/hellodjango$ git commit -m "my first commit" 
# On branch master 
nothing to commit (working directory clean) 
[email protected]:~/hellodjango$ heroku create 
Creating high-dusk-6308... done, stack is cedar 
http://high-dusk-6308.herokuapp.com/ | [email protected]:high-dusk-6308.git 
! New default stack: Cedar. To use Bamboo, run `heroku create -s bamboo`. 
[email protected]:~/hellodjango$ git remote -v 
heroku [email protected]:blazing-dusk-8587.git (fetch) 
heroku [email protected]:blazing-dusk-8587.git (push) 
[email protected]:~/hellodjango$ git push heroku master 
ssh: connect to host heroku.com port 22: Connection refused 
fatal: The remote end hung up unexpectedly 
[email protected]:~/hellodjango$ git push -f heroku 
ssh: connect to host heroku.com port 22: Connection refused 
fatal: The remote end hung 

了意外

还当我运行

$telnet heroku.com 22 

我得到

Trying 50.19.85.132... 
Trying 50.19.85.154... 
Trying 50.19.85.156... 
telnet: Unable to connect to remote host: Connection refused 

什么想法?

+0

请格式化代码块的复制粘贴端子输出。请参阅:http://stackoverflow.com/editing-help –

回答

3

根据this questionthis question,我建议你检查一下,你没有运行任何防火墙或端口阻塞软件(比如PeerGaurdian),并且你没有在系统的任何地方阻塞Amazon/EC2。

+0

卸载PeerGuardian为我解决它 - 谢谢! – 3cheesewheel

1

请按照以下步骤操作:1。检查sshd服务:

$ ssh-keygen -t rsa # created ssh key 
$ heroku keys:add # upload ssh key 
$ heroku keys # lists keys 

2.找到一个正常的代理节点

$ ssh -vvv heroku.com # debug ssh connection 
$ vim ~/.ssh/config # setup usefull proxy node 
    Host heroku.com 
    Hostname 107.21.95.3  # trans by ip 
    PreferredAuthentications publickey 
    IdentityFile ~/.ssh/id_rsa 
    port 22 
+1

谢谢你的建议。我来自中国,很多程序员在这里遇到了GFW(Great防火墙)的这个问题。正如你所说,通过设置ssh配置文件解决了我的连接超时问题。但我想知道你是如何知道107.21.95.3可用的,你如何得到这个ip,那个ip代表什么,如果这个ip在将来不可用,我怎么能找到另一个ip。 –

+0

我会一直在这里,你可以关注它 – Sebastian

相关问题