今天提交代码,push到GitHub上,突然出现这个问题。
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see github.blog/2020-12-15-… for more information.
fatal: unable to access 'github.com/zhoulujun/a…': The requested URL returned error: 403
官方的解释:github.blog/changelog/2…
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 替代。
这个去年年底就说了,github.blog/2020-12-15-…
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的源,也没有这个问题)。
github配置SSH免密登录
这里讲的是Mac OS 操作。windows可以借鉴
查看ssh目录
ls -al ~/.ssh
Mac OS目录~/.ssh,windows目录是: Users/uestc/.ssh/id_rsa
-如果有配过,会列出:
- id_rsa (私钥)——这个不能泄露
- id_rsa.pub(公钥)
-如果没有配过,那么就进入第二步
新建一个新的SSH KEY
ssh-keygen -t rsa -b 4096 -C "uestchan@sina.com"
接着会提示这个公钥私钥的保存路径-建议直接回车就好(默认目录里)
接着提示输入私钥密码passphrase - 如果不想使用私钥登录的话,私钥密码为空,直接回车
生成成功后,把 id_rsa.pub 拷贝到 github 新建的 SSH keys 中
配置好好,记住,你项目得使用 SSH clone
如果本地是https 源,那么就修改git 仓库地址