git push heroku master给出错误ssh:连接到主机heroku.com端口22:连接被拒绝

时间:2012-06-23 09:14:15

标签: heroku

我正在尝试运行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

我得到了

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

任何想法?

2 个答案:

答案 0 :(得分:3)

基于this questionthis question,我建议你检查一下你没有运行任何防火墙或端口阻止软件(比如PeerGaurdian),并且你要阻止亚马逊/ EC2你系统上的任何地方。

答案 1 :(得分: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