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

11,930

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.

Share:
11,930
Admin
Author by

Admin

Updated on June 15, 2022

Comments

  • Admin
    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/Lh0rM5

    Creating radiant-wind-7413... done, stack is cedar
    http://radiant-wind-7413.herokuapp.com/ | [email protected]: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

  • AzizSM
    AzizSM almost 11 years
    For some company it is very difficult to deal with company's Administrator / policy any alternative to this ?
  • user7740901
    user7740901 almost 11 years
    Not that I'm aware of.
  • james
    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.