macOS 系统升级后推送代码 git push 出现错误。
报错信息如下:
Unable to negotiate with 11.23.23.23 port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
查看 ~/.ssh
目录下存在 id_rsa 和 id_rsa.pub 文件,系统未升级前是可以正常推送代码的。
解决办法
创建配置文件,如果已经存在则跳过此步骤
touch ~/.ssh/config
追加配置内容
cat >> ~/.ssh/config<<EOF
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
EOF
以上就是解决系统升级后提示no matching host key type found
的问题。
改方法来自:https://www.childsay.com/325.html