问题描述
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、命令行生成密钥
mkdir -p ~/.ssh
ssh-keyscan -t rsa domain.com >> ~/.ssh/known_hosts
ssh-keygen -t rsa -C "user.email"
cat ~/.ssh/id_rsa.pub
打开密钥复制并添加到gitlab的setting-SSH Key中。