ssh: connect to host heroku.com port 22: Connection timed out

左心房为你撑大大i 提交于 2019-12-12 12:16:16

问题


I am working on Ubuntu 11.10 Local branch of my git-repo is up to date

I then wrote following command in terminal: heroku create --stack cedar and it said:
Notice: on Wed, 20 June, our default stack will change to Cedar. http://bit.ly/Lh0rM5

Creating radiant-wind-7413... done, stack is cedar
http://radiant-wind-7413.herokuapp.com/ | git@heroku.com:radiant-wind-7413.git
Git remote heroku added

All fine till now, then I typed following in terminal:

git push heroku master

and the following error occured: ssh: connect to host heroku.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly


回答1:


I had the similar problem with keys. Ok this is what I did.

Check the status of your keys with

heroku keys

It shows you list of keys that are added to heroku. You can always generate new keys and add them to heroku.

ssh-keygen -t rsa

Generates new key.

heroku keys:add

adds the keys to heroku. Before adding it lists the available keys that you can add. Enter the option and you key is added to heroku.

This article can be helpful. If that doesn't work then there should be some problem with ssh. Try doing an ssh localhost and see if ssh is working.




回答2:


Most probably some sort of firewall issue or your network admin has blocked outgoing port 22 in your network.

You may use simple scrip to see your connection to Heroku by :

$ ssh -vvv git@heroku.com

If you seeing connect timed out then you may need to request your admin to unblock port 22. Alternatively may access Heroku via tunneling as per my answer in Connecting to heroku using port 443




回答3:


Today Heroku uses git over ssh. The default port for ssh is 22 and it looks like your network doesn't allow outbound connections to port 22. Perhaps this is something your network administrator can change.




回答4:


Do following steps.

ssh-keygen -t rsa
heroku keys:add
heroku keys  # lists keys


来源:https://stackoverflow.com/questions/10968591/ssh-connect-to-host-heroku-com-port-22-connection-timed-out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!