github拉取和推送远端报错

报错内容

the RSA host key for github.com has changed, and the key for the corresponding IP address 20.205.243.166 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.

原因:本地计算机 known_hosts 中记录的 git 服务器的公钥和实际返回的公钥不匹配。
解决:

  1. 更新一下本地的 .ssh/known_host文件
    ● 打开 known_hosts 文件,找到 gitlab.xxx.com 对应的记录,删掉
    ● 然后运行 git pull ,会提示你要不要将新的服务器地址加到 known_hosts 中,如果不像每次都提示一遍的话就加一下
  2. 删除本地known_hosts里面的缓存信息,执行:ssh-keygen -R 域名(或IP) 亲测有效
    github拉取和推送远端报错_第1张图片

你可能感兴趣的:(开发报错,github,git)