github:当你想要使用VSCODE开心提交代码时,出现Git:[email protected]:Permission denied(publickey)解决方案

当你想要使用VSCODE开心提交代码时,出现Git:[email protected]:Permission denied(publickey)弹框

图片:

 原因:电脑公钥(publickey)未添加至github,所以无法识别。 因而需要获取本地电脑公钥,然后登录github账号,添加公钥至github就OK了。

解决方案:

查看本地是否有 SSH密钥:cd ~/.ssh

如果没有密钥则不会有此文件夹:

没有的话--

生存密钥:

ssh-keygen -t rsa -C “youremail”

按3个回车,密码为空。

Your identification has been saved in /home/tekkub/.ssh/id_rsa.Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.The key fingerprint is:

进入 id_rsa.pub  复制密钥

使用vscode打开id_rsa.pub

 

然后 登录github后,进入个人设置settings--->ssh and gpg keys-->new ssh key 添加即可。title自行命名

然后github 就识别你的机器了  就可以拉取和提交代码了。

猜你喜欢

转载自www.cnblogs.com/DZzzz/p/10890404.html