6

GitHub 不再支持密码验证解决方案: SSH 免密与 Token 登录配置

 2 years ago
source link: https://www.v2ex.com/t/795911
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

GitHub 不再支持密码验证解决方案: SSH 免密与 Token 登录配置

  wsgzao · wsgzao · 53 分钟前 · 240 次点击

今天提交代码,push 到 GitHub 上,突然出现这个问题。

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

fatal: unable to access 'https://github.com/wsgzao/wsgzao.github.io.git/': The requested URL returned error: 403

官方的解释:https://github.blog/changelog/2021-08-12-git-password-authentication-is-shutting-down/

As previously announced, starting on August 13, 2021, at 09:00 PST, we will no longer accept account passwords when authenticating Git operations on GitHub.com. Instead, token-based authentication (for example, personal access, OAuth, SSH Key, or GitHub App installation token) will be required for all authenticated Git operations.

Please refer to this blog post for instructions on what you need to do to continue using git operations securely.

Removal

  • August 13, 2021, at 09:00 PST

大致意思是,密码验证于 2021 年 8 月 13 日不再支持,也就是今天 intellij 不能再用密码方式去提交代码。请用使用 personal access token 替代。

这个去年年底就说了,https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

In July 2020, we announced our intent to require the use of token-based authentication (for example, a personal access, OAuth, or GitHub App installation token) for all authenticated Git operations. Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com.

自己鼓捣了一遍 Token,烦人的很。还是觉得直接 ssh 的方式操作 git 就好(之前是 ssh 的源,也没有这个问题)。

以下两种解决方案推荐使用 SSH 免密登录

  1. GitHub 配置 SSH 免密登录
  2. GitHub token
# 登录 github 添加 SSH and GPG keys 公钥

# 修改 git config
vim wsgzao.github.io/.git/config

[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
[remote "origin"]
        url = https://github.com/wsgzao/wsgzao.github.io.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

# 替换 url = 

[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
[remote "origin"]
        url = [email protected]:wsgzao/wsgzao.github.io.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

Google 搜索到以下文章具体步骤非常详细,我就直接贴链接不再重复了

https://www.cnblogs.com/zhoulujun/p/15141608.html


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK