Warning:the ECDSA host key for 'gitlab.tides.cn' differs from the key for the IP address

栏目: git 发布时间:2021-12-24

gitlab 迁移服务器后,ip 地址发生了变化。此时从 gitlab 拉代码时会报下述错误:

$ git fetch --all
Fetching origin
Warning: the ECDSA host key for 'gitlab.tides.cn' differs from the key for the IP address '192.168.0.1'
Offending key for IP in /Users/teng/.ssh/known_hosts:9
Matching host key in /Users/teng/.ssh/known_hosts:10
Are you sure you want to continue connecting (yes/no)? 

解决方法:

ssh-keygen -R 报错信息提到的ip

示例

ssh-keygen -R 192.168.0.1

本文地址:https://www.tides.cn/p_git-warning-the-wcdsa-host-key-for-gitlab.tides.cn-differs-from-the-key-for-the-ip-address

标签: gitlab ssh-keygen