Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
659 views
in Technique[技术] by (71.8m points)

git Permission denied (publickey)

使用git命令克隆项目

git clone [email protected]:litongjava_admin/spring-boot-2.0.7-hello-jenkins.git

出现下面的错误

正克隆到 'spring-boot-2.0.7-hello-jenkins'...
The authenticity of host 'gitee.com (212.64.62.174)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitee.com,212.64.62.174' (ECDSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。
root@litong-Inspiron-3458:~/dev_workspace/java/spring-boot# git ls-remote [email protected]:litongjava_admin/spring-boot-2.0.7-hello-jenkins.git
[email protected]: Permission denied (publickey).
fatal: 无法读取远程仓库。

请确认您有正确的访问权限并且仓库存在。

项目的git地址是
git协议地址

[email protected]:litongjava_admin/spring-boot-2.0.7-hello-jenkins.git

https协议地址

https://gitee.com/litongjava_admin/spring-boot-2.0.7-hello-jenkins.git

使用https克隆成功

git clone https://gitee.com/litongjava_admin/spring-boot-2.0.7-hello-jenkins.git

为什么使用https协议clone成功,使用git协议确实失败呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

git协议是基于ssh协议,如果使用git协议必须通过验证,如果想要通过验证必须将public key添加的git sever中


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...