git 拉取克隆(clone)github远程仓库到本地错误 The authenticity

Git / 1401人浏览 / 0人评论

一天我在本地安装完git之后想在github上克隆(clone)一个开源项目,或者你是在github上面创建了仓库,在本地的git拉取远程仓库到本地报错信息:Administrator@PC-202005152046 MINGW64 /e/workspace $ git clone git@github.com:ElemeFE/element.git

一天我在本地安装完git之后想在github上克隆(clone)一个开源项目,或者你是在github上面创建了仓库,在本地的git拉取远程仓库到本地报错信息:
当你在github上面创建了仓库,或者克隆github上仓库,通过本地的git拉取远程仓库到本地报错信息如下:
Administrator@PC-202005152046 MINGW64 /e/workspace
$ git clone git@github.com:ElemeFE/element.git
Cloning into 'element'...
The authenticity of host 'github.com (52.74.223.119)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,52.74.223.119' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git clone
因为git使用ssh连接,而ssh第一次连接需要验证github服务器用户配置的Key。确认gitgub上的Key的指纹信息是否真的来自github的服务器。只要把本地生成的key放到github或者gitee上即可。
具体的解决办法就是在本地生成key配置到github服务器。这样子接收过来就gitHub服务器了。
首先我们查看下是否存在本地或者服务器上已经存在key(id_rsa.pub)。
使用下面的命令:
$ ls -al ~/.ssh

git clone

如果不存在我们使用下面的命令创建

使用下面的命令创建(记得三次回车即可)

ssh-keygen -t rsa -C "",这里的号使用一个字符串即可(邮箱号)

git clone

如果你在本地或者服务器上已经配置过,请使用下面命令直接查看,复制使用即可。

$ cat ~/.ssh/id_rsa.pub

git clone

登陆github,找到github用户头像 setting 下找到/SSH and GPG keys/New SSH key,复制新生成的SSH配置到服务器,配置好之后再拉取或者克隆(clone)。

git clone

转载注明:

0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我