天天看點

git sync fatal: Authentication failed for https://github.com/ did not exit cleanly (exit code 128)

  • 具體錯誤
D:\github\openjdk8-x86-amd64-arm64-aarch64>git push origin master
info: please complete authentication in your browser...
fatal: An error occurred while sending the request.
fatal: The request was aborted: Could not create SSL/TLS secure channel.
Username for 'https://github.com': quantum6
Password for 'https://[email protected]':
remote: Support for password authentication was removed on August 13, 2021. Plea
se use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requireme
nts-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/quantum6/openjdk8-x86-amd64
-arm64-aarch64/'      

原因是不支援密碼方式了,改用令牌token

  • 産生KEY

打開git-bash輸入指令:

ssh-keygen -t rsa -b 4096
 
cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDE3Xu+zoNiZFmASBRDK+vKSTYkuqFPH8VisOfS/VH0jEdPoIXK9wAmVQwjy1EYtzInCUFbVBpdKM5GshPQrKhkLTA9oAbnANfLVtTx1iA10q4G5KyfB9RLgp8fG5nJDrZEvNLFwp+9MCwyU55jcgdbcOQyJQXA3GWGKE4c+WNViAUmrPpeYGvVmz5WLh8lCpZFpPjlPZpvjSTJfw== quantum6@WIN7
       
  • GITHUB建立SSHKEY
https://github.com/settings/keys

SSH Keys

把cat内容複制到網頁。

  • 收到的郵件
The following SSH key was added to your account:
 
quantum6
SHA256:wfqWASnmKIG1jDntX9bxB2xTJKOwWp4Z8BbuONCGpbk
 
If you believe this key was added in error, you can remove the key and disable
access at the following location:
 
https://github.com/settings/keys      

建立令牌。直接打開

https://github.com/settings/tokens/new

修改Expiration為No expiration(或者其他),所有的都選上(以後搞清楚了再定制新的)。點選Generate token。複制token令牌,類似:

ghp_EGL3ejUIdtAUwMs1fe6mIeefc2Amn3f9SvB

修改配置,更新代碼

https://quantum6.blog.csdn.net/article/details/121057905