标签:gitlab changed RSA host hosts ssh key known xxx
问题
git pull 遇到如下问题
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for gitlab.xxx.com has changed,
and the key for the corresponding IP address 11.11.111.111
has a different value. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /c/Users/xxx/.ssh/known_hosts:2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:8vm2iWaWLwxxxxxxxxxxxxxxxxxxxxxxxxxxYJF6jvpo.
Please contact your system administrator.
Add correct host key in /c/Users/xxx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/xxx/.ssh/known_hosts:3
RSA host key for gitlab.xxx.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.
原因
本地计算机 known_hosts 中记录的 git 服务器的公钥和实际返回的公钥不匹配。
解决
1
最快的方法:更新一下 C:\Users\xxx\.ssh\known_hosts
中的记录
- 打开 known_hosts 文件,找到 gitlab.xxx.com 对应的记录,删掉
- 然后运行 git pull ,会提示你要不要将新的服务器地址加到 known_hosts 中,如果不像每次都提示一遍的话就加一下
2
当然,最保险的话,是重新生成一遍 ssh key pair,然后把服务器上的公钥也更新下
参考 -> https://www.jianshu.com/p/04a05cf6ff9f
标签:gitlab,changed,RSA,host,hosts,ssh,key,known,xxx 来源: https://www.cnblogs.com/maxstack/p/15985185.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。