700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas

解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas

时间:2019-07-18 22:58:59

相关推荐

解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas

今天用idea提交代码到github上,push后报错

git@: Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

一:原因分析

Permission denied (publickey) 没有权限的publickey ,出现这错误一般是以下两种原因

客户端与服务端未生成 ssh key客户端与服务端的ssh key不匹配

找到问题的原因了,解决办法也就有了,重新生成一次ssh key ,服务端也重新配置一次即可。

二:客户端生成ssh key

在cmd里面输入

ssh-keygen -t rsa -C "xxxxxxxx@"

ssh-keygen -t rsa -C "youremail@"

xxxxxx@改为自己的邮箱即可,途中会让你输入密码啥的,不需要管,一路回车即可,会生成你的ssh key。(如果重新生成的话会覆盖之前的ssh key。)

三:输入箭头处路径

四:打开id_rsa.pub文件,并且复制内容

配置服务端

五:在github上打开箭头处,点击Setting

六:点击SSH and GPG keys

七:打开你刚刚生成的id_rsa.pub,将里面的内容复制,进入你的github账号,在settings下,SSH and GPG keys下new SSH key,然后将id_rsa.pub里的内容复制到Key中,完成后Add SSH Key。

八:然后添加后入下图所示

九:用idea再次提交文件到 github上,显示提交成功

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。