-
拉取代码时报错:
sh# Mac 报错 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ED25519 key sent by the remote host is SHA256:88E6751+dflNKvWOxzg2/98Vfg+P4ZWErIR7iTckhBM. Please contact your system administrator. # 注意这里:/Users/xxx/.ssh/known_hosts known_hosts的路径 Add correct host key in /Users/xxx/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /Users/xxx/.ssh/known_hosts:2 Host key for gitlab.hapi123.net has changed and you have requested strict checking. Host key verification failed. 致命错误:无法读取远程仓库。 请确认您有正确的访问权限并且仓库存在。sh# windows 报错 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ED25519 key sent by the remote host is SHA256:KuBLGFm/xkm0bpWVSGzQaT1Qqekl74Ui8TWnmtrEwpU. Please contact your system administrator. # 注意这里:/c/Users/xxx/.ssh/known_hosts known_hosts的路径 Add correct host key in /c/Users/xxx/.ssh/known_hosts to get rid of this message. Offending ED25519 key in /c/Users/xxx/.ssh/known_hosts:3 Host key for gitlab.hapi123.net 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 -
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!翻译过来就是:警告:远程主机标识已更改!此报错是由于远程的主机的公钥发生了变化导致的。
ssh服务是通过公钥和私钥来进行连接的,它会把每个曾经访问过计算机或服务器的公钥(public key),记录在~/.ssh/known_hosts中,当下次访问曾经访问过的计算机或服务器时,ssh就会核对公钥,如果和上次记录的不同,OpenSSH会发出警告。当两个设备第一次进行链接时,会在
~/.ssh/konwn_hosts中将被连接设备的公钥信息进行保存,后续再次链接时OpenSSH会核对公钥来进行一个简单的验证
-
【解决方法】找到报错中
known_hosts的路径,进入该目录,删除掉known_hosts、known_hosts.old文件,然后重新执行之前报错的命令,应该会提示是否确定授权,输入yes就行了。另外需要注意线上对应的公钥确实是你本机的
rsa公钥。sh# 进入目录(这个路径在上面的报错中有体现,有注释标记) $ cd /Users/xxx/.ssh # 移除文件 $ sudo rm -rf known_hosts known_hosts.old # 然后再次执行报错的命令
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
卡尔特斯2023-09-04 8:41
相关推荐
F***E23912 小时前
如何安装配置Goland并使用固定公网地址SSH远程连接本地服务器宾有为2 天前
【Linux】Linux 常用指令爱喝矿泉水的猛男2 天前
ssh远程访问另一台windows(可扩展到docker环境)❀͜͡傀儡师2 天前
Docker一键部署Nexus Terminal,高颜值SSH新体验HIT_Weston2 天前
43、【Ubuntu】【Gitlab】拉出内网 Web 服务:静态&动态服务qinyia2 天前
WisdomSSH解决因未使用Docker资源导致的磁盘空间不足问题qinyia3 天前
WisdomSSH如何高效检查服务器状态并生成运维报告小安同学iter3 天前
三台服务器,一套流水线:如何实现无缝自动化部署?西部森林牧歌3 天前
Arbess从基础到高阶(14) - 使用Arbess+GitLab+SonarQube实现代码扫描完成后自动化部署4***V2024 天前
GitLab Pages配置