常見問題之Golang——Host key verification failed
背景
日常我們開發(fā)時(shí),會(huì)遇到各種各樣的奇奇怪怪的問題(踩坑o(╯□╰)o),這個(gè)常見問題系列就是我日常遇到的一些問題的記錄文章系列,這里整理匯總后分享給大家,讓其還在深坑中的小伙伴有繩索能爬出來。
同時(shí)在這里也歡迎大家把自己遇到的問題留言或私信給我,我看看其能否給大家解決。
開發(fā)環(huán)境
- 系統(tǒng):windows10
- 語言:Golang
- golang版本:1.17
內(nèi)容
錯(cuò)誤
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、本地已有的密鑰存在問題,導(dǎo)致權(quán)限不足
2、正在拉取的庫沒有權(quán)限導(dǎo)致。
解決方案:
1、清除本地的~/.ssh目錄(windows和linux均是該目錄,其中windows可以使用命令行進(jìn)入,使用del刪除)
2、執(zhí)行ssh-keygen -t rsa -C "github中的名字",將生成的~/.ssh/.id_rsa.pub 下的內(nèi)容配置到github中的SSH and GPG kes選項(xiàng)中。
3、再次進(jìn)行嘗試?yán)〖纯沙晒Α?/p>
本文聲明:

知識(shí)共享許可協(xié)議
本作品由 cn華少 采用 知識(shí)共享署名-非商業(yè)性使用 4.0 國際許可協(xié)議 進(jìn)行許可。