Typecho Wiki
每一个作品都值得被记录

macOS 系统升级后 git push 出现 no matching host key type found

Typecho维基君站长快讯 • 377次浏览 • 发布 2023-03-23 • 更新 2023-03-23
极致加速的V2Ray 助您畅享全球网络 & 搬瓦工VPS最新优惠码

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 文件,系统未升级前是可以正常推送代码的。

解决办法

  1. 创建配置文件,如果已经存在则跳过此步骤

    touch ~/.ssh/config

  2. 追加配置内容

    cat >> ~/.ssh/config<<EOF
    Host *
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedKeyTypes +ssh-rsa
    EOF

以上就是解决系统升级后提示no matching host key type found的问题。

改方法来自:https://www.childsay.com/325.html

广告声明:文内含有的对外跳转链接(包括不限于超链接、二维码、口令等形式),用于传递更多信息,节省甄选时间,结果仅供参考,Typecho.Wiki所有文章均包含本声明。
本文检索关键词:站长快讯
厂商投放
添加新评论 »