git bash 关联给GitHub如何使用公钥登录问题

版权声明:转载请申明出处,谢谢 https://blog.csdn.net/qq_35495763/article/details/85450914

 
问题:
          使用git bash 关联gitHub上的库产生问题(使用ssh 公钥 登录原理来实现)文末有原理讲解。 
          关键字:ssh授权登录方式
补充:这个问题解释了,对于初学者为什么Git登录GitHub不需要密码,
                                        答案:使用ssh 进行身份验证登录的方式(不是将公钥发给了GitHub了,从三体上将两者已经产生了关联,笑,皮一下)

问题描述
              在使用命令:git push -u origin master  (上传同步分支到GitHub上)出现如下问题

The authenticity of host 'github.com (13.229.188.59)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,13.229.188.59' (RSA) to the list of known hosts.
Permission denied (publickey).  //公钥授权否认
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

问题描述:没有授权公钥的使用

解决方式: 

授权登录:生成秘钥对,添加公钥到GitHub服务器中,再次登录即可

步骤一:  ssh  -T [email protected]  去测试一下是否连接成功


测试是否连接成功
步骤二:使用 ssh-keygen  -t rsa -C "邮箱@qq.com" (邮箱写自己GitHub注册邮箱)

步骤三:公钥,查看将其添加到GitHub上

查看完后,粘贴复制到GitHub上,具体位置-setting/ssh and GPG keys 


 

后补:

应用的原理:ssh 为什么可以这样用呢?
这里添加示意图:

ssh 使用公钥登录

猜你喜欢

转载自blog.csdn.net/qq_35495763/article/details/85450914