Git エラー: 警告: 「github.com」の ecdsa ホスト キーが IP アドレス「20.205.243.166」のキーと異なります

質問内容

Warning: the ECDSA host key for 'github.com' differs from the key for the IP address '20.205.243.166'
Offending key for IP in /Users/admin/.ssh/known_hosts:11
Matching host key in /Users/admin/.ssh/known_hosts:32
Are you sure you want to continue connecting (yes/no)?

理由:

  • SSHの有効期限が切れました
  • ssh が設定されていないか、設定が有効になりません

解決:

  1. まずホスト キーを見つけて削除します (設定されていない場合はこの手順を無視してください)
# 先到家目录
cd  ~  
# 级联删除旧的.ssh
rm -r .ssh 
  1. 新しいキーを作成します
# 新建一个 ssh
mkdir -p ~/.ssh  
# 生成 ssh
ssh-keyscan -t rsa domain.com >> ~/.ssh/known_hosts
ssh-keygen -t rsa -C "你仓库绑定的邮箱"
# 回车直到生成成功
# 查看公钥并复制到 github 的 SSH Key
cat ~/.ssh/id_rsa.pub

おすすめ

転載: blog.csdn.net/qq_41536505/article/details/130271516