ssh: connect to host heroku.com port 22: Connection timed out
Solution 1
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 [email protected]
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
Solution 2
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.
Solution 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.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on June 15, 2022Comments
-
Admin about 2 years
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/Lh0rM5Creating radiant-wind-7413... done, stack is cedar
http://radiant-wind-7413.herokuapp.com/ | [email protected]:radiant-wind-7413.git
Git remote heroku addedAll 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 -
AzizSM almost 11 yearsFor some company it is very difficult to deal with company's Administrator / policy any alternative to this ?
-
user7740901 almost 11 yearsNot that I'm aware of.
-
james over 2 years@JamesWard but if I"m just doing this from home who exactly is the network administrator? I'm very confused as to how this literally worked 5 hours ago and suddenly stopped. Nothing about my setup has changed.