Everything was fine. Suddenly one day, an error was reported with git push
:
WARNING: POSSIBLE DNS SPOOFING DETECTED!
The above errors are generally caused by the migration of the company’s Git warehouse, resulting in ip changes. There is a known_hosts
file in the git directory that stores the connected domain name and the corresponding ip. Every time there is a remote operation, it will verify whether the information in it matches, and the warehouse is migrated. known_hosts
The domain name and ip in the latter file must not match, so the above error will occur. The easiest way is to delete known_hosts
the domain name and the information behind it or empty the file.
: > ~/.ssh/known_hosts
Don’t forget the previous :
number, and then re-verify the connection
ssh -T [email protected]
be accomplished!