解决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
相关推荐
于慨13 小时前
firecrawl
macos
武超杰13 小时前
Git 从入门到精通教程
git
程序员夏末14 小时前
【开源经历 | 第一篇】参与开源需要掌握的Git和Github指令
git·开源
vooy pktc15 小时前
macOS安装Redis
数据库·redis·macos
A懿轩A15 小时前
Ghostty:告别 Mac 毛坯终端,打造 2026 最丝滑的 Ghostty AI 开发驾驶舱——Claude Code 团队也在用
python·macos·策略模式
SNOWPIAOP16 小时前
git status 出现中文乱码的解决方案等
git·乱码·postgres
空中海16 小时前
01. iOS 逆向基础、环境搭建与授权
macos·ios·cocoa
空中海16 小时前
iOS LLDB 调试、Mach-O、Runtime 与二进制分析
macos·ios·cocoa
空中海16 小时前
iOS 防护、加固复测与综合交付
macos·ios·cocoa
qq_435287921 天前
第9章 夸父逐日与后羿射日:死循环与进程终止?十个太阳同时值班的并行冲突
java·开发语言·git·死循环·进程终止·并行冲突·夸父逐日