Golang语言知识库

常见问题之Golang——Host key verificati

2021-12-19  本文已影响0人  cn華少

常见问题之Golang——Host key verification failed

背景

日常我们开发时,会遇到各种各样的奇奇怪怪的问题(踩坑o(╯□╰)o),这个常见问题系列就是我日常遇到的一些问题的记录文章系列,这里整理汇总后分享给大家,让其还在深坑中的小伙伴有绳索能爬出来。
同时在这里也欢迎大家把自己遇到的问题留言或私信给我,我看看其能否给大家解决。

开发环境

内容

错误

PS E:\goProjectModules\FullTextParticiple> go get github.com/blevesearch/bleve
go get: module github.com/blevesearch/bleve: git ls-remote -q origin in C:\Users\zhangyc\go\pkg\mod\cache\vcs\7d5e7b0e7599dfeeda1232602c6eed8bb73db97ac8497937c270d1d2ccca3498: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.

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

造成原因:

1、本地已有的密钥存在问题,导致权限不足
2、正在拉取的库没有权限导致。

解决方案:

1、清除本地的~/.ssh目录(windows和linux均是该目录,其中windows可以使用命令行进入,使用del删除)
2、执行ssh-keygen -t rsa -C "github中的名字",将生成的~/.ssh/.id_rsa.pub 下的内容配置到github中的SSH and GPG kes选项中。
3、再次进行尝试拉取即可成功。

本文声明:
88x31.png
知识共享许可协议
本作品由 cn華少 采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可。
上一篇下一篇

猜你喜欢

热点阅读