Why does GitHub recommend HTTPS over SSH?

后端 未结 7 2088
星月不相逢
星月不相逢 2020-12-02 03:44

On the GitHub site there is a link...

https://help.github.com/articles/generating-ssh-keys

... and it states...

If you have decided no

7条回答
  •  佛祖请我去吃肉
    2020-12-02 04:22

    Enabling SSH connections over HTTPS if it is blocked by firewall

    Test if SSH over the HTTPS port is possible, run this SSH command:

    $ ssh -T -p 443 git@ssh.github.com
    Hi username! You've successfully authenticated, but GitHub does not
    provide shell access.
    

    If that worked, great! If not, you may need to follow our troubleshooting guide.

    If you are able to SSH into git@ssh.github.com over port 443, you can override your SSH settings to force any connection to GitHub to run though that server and port.

    To set this in your ssh config, edit the file at ~/.ssh/config, and add this section:

    Host github.com
      Hostname ssh.github.com
      Port 443
    

    You can test that this works by connecting once more to GitHub:

    $ ssh -T git@github.com
    Hi username! You've successfully authenticated, but GitHub does not
    provide shell access.
    

    From Authenticating to GitHub / Using SSH over the HTTPS port

提交回复
热议问题