我最近更改了服务器,因此,我有了一个新的IP地址。当我尝试使用git fetch [remote repository]时,我得到了以下信息:
> C:\Users\[path]\app>git fetch [remote repository]
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> @ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> The RSA host key for example.net has changed, and the key for the
> corresponding IP address [IP address of new server] is unknown. 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.
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> 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:ep0A2t+sVMSaIEbS8wt8ptfmdHSr1kNocWsBNab0tsI. Please contact
> your system administrator. Add correct host key in
> /c/Users/[username]/.ssh/known_hosts to get rid of this message.
> Offending RSA key in /c/Users/[username]/.ssh/known_hosts:1 RSA host
> key for example.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
> and the repository exists. C:\Users\[path]\app>我只需从新服务器获得一个新的SSH密钥,并将其放在本地计算机中才能修复这个问题,对吗?谢谢。
发布于 2018-05-31 16:32:15
如果您实际上有一个新服务器,并且使用旧服务器的相同名称或相同的IP引用它,那么很可能ssh证书是不一样的,因此您将得到一个欺骗警告消息。在消息中,您可以看到ssh指向旧证书信息所在的行:/c/Users/username/.ssh/known_hosts:1.。长话短说:如果您更改了服务器,那么预期ssh证书是不一样的。只要从旧服务器的ssh known_hosts中删除该行(在本例中为您的文件的第一行),您就可以了。
发布于 2020-05-30 09:47:38
警告信息在这里给出了更好的解释。example.net的RSA主机密钥已发生变化,新服务器相应IP地址IP地址的密钥未知。
在更改example.net的IP (10.0.0.0)和更改example.net的IP (10.0.0.1)之前,让我们比较两种场景。
变化前: example.net - 10.0.0.0
10.0.0.2>> ssh user@example.net服务器的主机指纹10.0.0.0存储在服务器10.0.0.2的已知主机文件中。
变化后: example.net - 10.0.0.1
10.0.0.2>> ssh user@example.net现在example.net指向10.0.0.1,但是在已知的主机文件中,example.net的主机指纹仍然是10.0.0.0。因此,每当尝试ssh到example.net时都会收到警告,因为主机键已经更改,因为它是一个新服务器。根据ssh,它认为其他人可以访问您的DNS,并且可能将DNS端点更改为任何错误的服务器,这就是您面临DNS欺骗警告的原因。
要承认这一点,你需要说你是故意改变它的人。为此,只需从服务器10.0.0.2的known_host文件中删除旧的主机键条目,删除10.0.0.0的条目即可。
查找服务器的指纹:
-F example.net
删除服务器的指纹:
-R example.net
https://stackoverflow.com/questions/50628840
复制相似问题