解决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
相关推荐
weixin_462446236 小时前
Git 本地忽略 application-dev.yml 的最佳实践:不提交 .gitignore,不影响团队协作!
git
goodmao10 小时前
【macOS】【mouse】设置鼠标大小
macos·计算机外设·鼠标·mouse
Magnum Lehar11 小时前
macos信息采集器appledataharvester-3
macos·网络安全·系统安全
川川菜鸟13 小时前
Claude Code 安装与配置完整指南(Mac)
macos
无限进步_13 小时前
面试题 02.02. 返回倒数第 k 个节点 - 题解与详细分析
c语言·开发语言·数据结构·git·链表·github·visual studio
2401_8590490813 小时前
git submodule update --init --recursive无法拉取解决
前端·chrome·git
WarmSword14 小时前
mac上用cursor/vscode调试root权限进程
c++·ide·vscode·macos·mac
Magnum Lehar15 小时前
macos的信息采集器appledataHarvester-2
macos·网络安全·系统安全
echo-niuben16 小时前
macOS 端已如何正常安装并配置XcodeBuildMCP ?
macos
刘某某.16 小时前
Mac上缺失宋体字体,只有宋体-简
macos