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

前端 未结 17 2462
陌清茗
陌清茗 2020-12-04 05:25

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 prox

17条回答
  •  孤城傲影
    2020-12-04 05:35

    The main reason was the change from the proxy installed by the company recently, which has blocked other ssh connections other than those to the company domain.

    I was able to connect successfully by following these steps:

    1. Double checked that the issue is what I am assuming by ssh -T git@github.com

    It should end up in a timeout.

    1. Edited the local remote URL by

    ssh config --local -e

    and from

    url=git@github.com:asheeshjanghu/Journal.git

    to

    url=https://github.com/asheeshjanghu/Journal.git

    The important point is that in the url you have to change at 2 places.

    from git@ to https:// and from github:username to github/username

    In the end verify by doing a git fetch

提交回复
热议问题