今天在使用Git操作远程服务的时候提示远程主机识别修改
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 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 ECDSA key sent by the remote host isSHA256:----------------------------------.Please contact your system administrator.Add correct host key in /Users/dyz/.ssh/known_hosts to get rid of this message.Offending ECDSA key in /Users/dyz/.ssh/known_hosts:1ECDSA host key for gitlab.baidu.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 rightsand the repository exists.
原因是昨天重装了阿里云主机的系统,导致本机里存储的远程主机信息发生了变化,按照上面的提示信息进入/Users/dyz/.ssh,编辑打开 known_hosts 文件,我这里只连接过一个远程主机,所以删除了里面所有内容,保存后重新Git操作链接到远程,
Are you sure you want to continue connecting (yes/no)?
输入yes即可