弃用基本密码身份验证会影响 GitHub 部署密钥吗?
Does deprecation of basic password authentication affect GitHub deploy keys?
我收到一封来自 GitHub 的电子邮件,内容是:
You recently used a password to access the repository at username/repo with git using git/2.24.3 (Apple Git-128).
Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.
所以我需要使用 作为标准命令行,以便将 git 提交推送到 GitHub,这应该不是问题。
但我想知道这是否会影响 deploy keys?例如,在已经 运行 数月或数年的自动化流程中 - 我们应该为更改做好准备吗?
我已经检查了 blog post,请注意还有很多时间(弃用发生在 2021 年 8 月 13 日),但重要的是要了解对部署密钥的任何影响以便做好准备。
不,部署密钥不受影响。唯一受影响的是使用密码通过 HTTPS 向 Git 或 Git LFS 进行身份验证。如果您通过 HTTPS 使用个人访问令牌或 OAuth 令牌,或者您完全使用 SSH(无论是使用个人密钥还是部署密钥),这些都不受影响。
进行此更改的原因是,知道帐户密码后,您就可以登录该帐户、更改密码并配置几乎所有设置。另一方面,令牌不允许您通过 Web 界面登录,并且通常仅限于一组有限的范围,并且它是伪随机生成的。同样,SSH密钥也有访问限制,不易被猜到。
因此,意外暴露您的身份验证凭据的后果较低,并且您替换它的凭据集不太可能从旧的暴露中被猜到。
您可以将 https://
远程网址更改为 git@
网址(例如 ssh)
git remote -v # check that your remote (e.g. origin) is using https://
git remote rm origin
git remote add origin git@github.com:ORGANIZATION_OR_USER/REPO_NAME.git
git fetch --all
git branch -u origin/master master
然后就可以测试了:
git pull
git commit --allow-empty -m "nothing"
git push
我收到一封来自 GitHub 的电子邮件,内容是:
You recently used a password to access the repository at username/repo with git using git/2.24.3 (Apple Git-128). Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.
所以我需要使用
但我想知道这是否会影响 deploy keys?例如,在已经 运行 数月或数年的自动化流程中 - 我们应该为更改做好准备吗?
我已经检查了 blog post,请注意还有很多时间(弃用发生在 2021 年 8 月 13 日),但重要的是要了解对部署密钥的任何影响以便做好准备。
不,部署密钥不受影响。唯一受影响的是使用密码通过 HTTPS 向 Git 或 Git LFS 进行身份验证。如果您通过 HTTPS 使用个人访问令牌或 OAuth 令牌,或者您完全使用 SSH(无论是使用个人密钥还是部署密钥),这些都不受影响。
进行此更改的原因是,知道帐户密码后,您就可以登录该帐户、更改密码并配置几乎所有设置。另一方面,令牌不允许您通过 Web 界面登录,并且通常仅限于一组有限的范围,并且它是伪随机生成的。同样,SSH密钥也有访问限制,不易被猜到。
因此,意外暴露您的身份验证凭据的后果较低,并且您替换它的凭据集不太可能从旧的暴露中被猜到。
您可以将 https://
远程网址更改为 git@
网址(例如 ssh)
git remote -v # check that your remote (e.g. origin) is using https://
git remote rm origin
git remote add origin git@github.com:ORGANIZATION_OR_USER/REPO_NAME.git
git fetch --all
git branch -u origin/master master
然后就可以测试了:
git pull
git commit --allow-empty -m "nothing"
git push