gitssh

How to fix "ssh: connect to host github.com port 22: Connection timed out" for git push/pull/... commands?


I am under a proxy and I am pushing in to git successfully for quite a while.
Now I am not able to push into git all of a sudden.
I have set the RSA key and the proxy and double checked them, with no avail and git is throwing me the error shown in the title of the page.


Solution

  • The reason could be the firewall modification since you are on a network, in which case they may deliberately block some ports.

    To double check if this is the reason, run:

    ssh -T git@github.com
    

    This should timeout. If that's the case, then use the http protocol instead of ssh. Change your url in the config file to http:

    git config --local -e
    

    and change:

     url = git@github.com:username/repo.git
    

    to

    url = https://github.com/username/repo.git