Github (SSH) via public WIFI, port 22 blocked

前端 未结 6 1261
忘了有多久
忘了有多久 2020-12-04 05:11

I\'m currently on a public WIFI spot and I\'m unable to use SSH (they probably blocked that port). However, I need that connection to do a git push.

<         


        
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 05:43

    In addition to configuring it with the ~/.ssh/config file, you can also simply include the port number in the remote URL you use. You just have to

    1. use a proper URL like ssh://user@host:port/path instead of the user@host:path shorthand; and

    2. prepend the ssh. subdomain to github.com.

    For instance, instead of

    git@github.com:cdbennett/python-gitlab.git
    

    use

    ssh://git@ssh.github.com:443/cdbennett/python-gitlab.git
    

提交回复
热议问题