git push heroku master 报错 ssh: connect to host heroku.com port 22: Connection refused。

3

我正在尝试运行heroku-django教程(使用ubuntu 12.04),但由于某种原因,我无法推送到heroku。以下是发生的情况:

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

意外停止
同时,当我运行时
$telnet heroku.com 22

i get

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

有任何想法吗?


请将您的复制粘贴终端输出格式化为代码块。请参阅:http://stackoverflow.com/editing-help - Jeremy Blanchard
2个回答

3

根据这个问题这个问题,我建议您检查您是否运行了任何防火墙或端口屏蔽软件(如PeerGaurdian),并且您没有在系统的任何地方阻止Amazon / EC2。


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(防火长城)的困扰。按照你说的方法,我已经成功解决了连接超时的问题,通过设置ssh配置文件。但是我想知道你是如何得知107.21.95.3可用的,那个IP是代表什么,如果将来这个IP不可用了,我该如何找到其他可用的IP。 - Yang Wenhao
我会一直在这里,你可以跟着它走。 - Sebastian

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接