Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

在 git clone 项目时,提示没有权限,不能clone,有以下几种情况

1、可能是 之前电脑使用过git ,现在和之前不是同一个账号,要重置。

git config --system --unset credential.helper

输入上面命令后,再次git clone时,会让我们重新输入 username 和 password.

    注:设置 修改 本地 git 账号和密码:

$ git config --global user.name "yourname"

$ git config --global user.password "youremail"

2、设置后 重新 git clone 发现还是不行。

git clone项目 权限 问题

 有可能是公钥出现问题,重新设置用户名和密码,生成公钥(这里要记得删除之前的公钥)

$ git config --global user.name "yourname"

$ git config --global user.password "youremail"

 删除 .ssh 文件夹

路径:

git clone项目 权限 问题

 

 git 输入命令

$ ssh-keygen -t rsa -C "youremail"(设置的邮箱地址)

git clone项目 权限 问题

 

 

 

 然后会生成 .ssh文件夹。

打开 .ssh文件下的id_rsa.pub 全部复制,进入git ->setting ->ssh key 新增 ssh key即可。 

相关文章:

  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2021-07-01
  • 2021-04-06
  • 2022-12-23
  • 2021-09-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-09-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案