解决mac更新后无法连接git问题

问题描述

在Mac电脑上使用git克隆命令时出现报错:

bash 复制代码
no matching host key type found. Their offer: ssh-rsa

问题原因

苹果更新了ssh默认不再支持ssh-rsa导致。

问题解决

修改ssh默认config配置文件,再重新生成rsa密钥

bash 复制代码
sudo nano ~/.ssh/config

写入文本:

bash 复制代码
Host *
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa

重新生成密钥:

bash 复制代码
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
相关推荐
梅孔立1 小时前
Ansible 100 台服务器一键管控实战 进阶版
服务器·git·ansible
harmful_sheep1 小时前
mac生效的终端查看
macos
qq_4260039612 小时前
git切换当前分支到远程分支
git
ON10N16 小时前
100% 纯 Vibe Coding,我是怎么用 AI 撸出一个 VS Code 插件的
git·ai编程·visual studio code
iOS门童19 小时前
macOS 应用"已损坏"无法打开?一文搞懂 Gatekeeper 与解决方案
macos
NPE~21 小时前
[工具分享]Maccy —— 优雅的 macOS 剪贴板历史管理工具
macos·教程·工具·实用工具
差不多程序员1 天前
Mac安装OpenClaw-cn保姆级教程
macos
dzl843941 天前
mac 安装python
开发语言·python·macos
Lunar*1 天前
告别臃肿!使用 git-filter-repo 优雅清理 Git 历史记录
git
Bruce_Liuxiaowei1 天前
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程
macos·docker·容器·openclaw