为什么GitHub推荐通过SSH使用HTTPS? [英] Why does GitHub recommend HTTPS over SSH?

查看:423
本文介绍了为什么GitHub推荐通过SSH使用HTTPS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



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



...并说明... 如果您决定不使用建议的HTTPS方法,我们可以使用SSH密钥在您的计算机之间建立安全连接



b $ b和GitHub。以下步骤将引导您生成SSH
密钥,然后将公钥添加到您的GitHub帐户。


为什么是HTTPS的推荐方法? SSH方法中存在某种安全漏洞还是比较慢?我创建了一个SSH密钥,这样可以缓解任何安全隐患?

解决方案

GitHub已经多次改变了他们的建议( example )。



看起来他们目前推荐使用HTTPS,因为它是在最广泛的网络和平台以及所有这些新手的用户中建立的最简单方式。



SSH没有固有的缺陷(如果他们禁用了它) - 在下面的链接中,您会看到他们仍然提供有关SSH连接的详细信息:


  1. HTTPS不太可能被防火墙阻挡。

    https://help.github.com/articles/which-remote-url -hould-i-use /


    https://克隆网址为公共和私人的所有存储库均可用。这些URL可以在任何地方使用 - 即使您位于防火墙或代理之后。


  2. HTTPS连接允许 credential.helper 来缓存您的密码。



    https://help.github.com/articles/set-up-git


    相关提示:凭证帮助程序仅在克隆HTTPS
    仓库URL时才有效。如果您使用SSH repo URL,SSH密钥将用于
    身份验证。虽然我们不建议这样做,但如果您希望使用此
    方法,请参阅本指南,以获取有关生成和使用SSH密钥的帮助。




On the GitHub site there is a link...

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

... and it states...

If you have decided not to use the recommended HTTPS method, we can use SSH keys to establish a secure connection between your computer and GitHub. The steps below will walk you through generating an SSH key and then adding the public key to your GitHub account.

Why is HTTPS the recommended method? Is there some sort of security flaw in the SSH method or is it slower? I created an SSH key, so would that mitigate any security concerns?

解决方案

GitHub have changed their recommendation several times (example).

It appears that they currently recommend HTTPS because it is the easiest to set up on the widest range of networks and platforms, and by users who are new to all this.

There is no inherent flaw in SSH (if there was they disable it) -- in the links below, you will see that they still provide details about SSH connections too:

  1. HTTPS is less likely to be blocked by a firewall.

    https://help.github.com/articles/which-remote-url-should-i-use/

    The https:// clone URLs are available on all repositories, public and private. These URLs work everywhere--even if you are behind a firewall or proxy.

  2. An HTTPS connection allows credential.helper to cache your password.

    https://help.github.com/articles/set-up-git

    Good to know: The credential helper only works when you clone an HTTPS repo URL. If you use the SSH repo URL instead, SSH keys are used for authentication. While we do not recommend it, if you wish to use this method, check out this guide for help generating and using an SSH key.

这篇关于为什么GitHub推荐通过SSH使用HTTPS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆