gitlab clone项目时报错:ECDSA主机密钥已更改。主机密钥验证失败。

问题描述

git clone克隆项目时报错:

Please contact your system administrator.
Add correct host key in /c/Users/duanting/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /c/Users/duanting/.ssh/known_hosts:1
ECDSA host key for domain.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.

解决方法

参考链接:https://www.imooc.com/wenda/detail/589935
1、先删除gitlab中计算机的主机密钥。(开始是直接进行的第二步,但是没有作用,然后就试试先删除再重新生成密钥)
2、命令行生成密钥

  1. mkdir -p ~/.ssh
  2. ssh-keyscan -t rsa domain.com >> ~/.ssh/known_hosts
  3. ssh-keygen -t rsa -C "user.email"
  4. cat ~/.ssh/id_rsa.pub打开密钥复制并添加到gitlab的setting-SSH Key中。


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部