git远程github鉴权失败
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
原因:github取消了HTTPS授权。
解决方案1: 使用SSH授权。
-
1.修改本地仓库的config文件中的[remote “origin”]url为github仓库的SSH的Key
-
2.根据1中的Key,在本地使用以下指令创建一个SSH公钥
ssh-keygen -t rsa -Cxxx # xxx是1中SSH的Key 连续按回车键即可
-
3.将生成的.ssh文件夹中的id_rsa.pub中的内容复制
-
4.使用复制的内容在GitHub中添加SSH公钥
注:.ssh文件夹默认在用户文件夹下
解决方案2: 使用Token
在github的settings --> Developer Settings -->Personal access tockens -->Tokens(classic)中生成一个Token
具体可参考:
1.https://www.bilibili.com/video/BV1vY41157PA/?spm_id_from=333.788&vd_source=0e6b60c039c7af0ef8ba27b35e93081b
2.http://www.taodudu.cc/news/show-5487329.html?action=onClick
在进行远程交互式,使用HTTPS方式,username
还是github的用户名,password
使用生成的Token
。