解决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
相关推荐
OsDepK5 小时前
移动编程OSMDE随时命令行进行Git
ide·git
mxpan8 小时前
macOS 13+ 上使用 macFUSE + NTFS-3G 读写 NTFS 移动硬盘技术说明
macos·策略模式
秋雨梧桐叶落莳14 小时前
iOS——QQ音乐仿写项目总结
学习·macos·ui·ios·mvc·objective-c·xcode
小李不困还能学14 小时前
用git GUI往远程仓库中添加文件/文件夹
git
MXsoft61815 小时前
**用自动化脚本给MAC误阻断留条后路:可审计、可回滚的准入控制方案**
运维·macos·自动化
失途老马16 小时前
Git Patch 生成与应用完整操作手册
git
李白的天不白16 小时前
下载smartadmin框架
git·github
iUNPo16 小时前
WWDC26 技术解读:Apple Intelligence、Siri AI 与苹果生态的下一步
macos·ios·wwdc
可乐要加冰^-^16 小时前
云雀文档下载
windows·git·github·石墨文档
小米渣的逆袭16 小时前
macos上一个好用的PDF文字提取工具方案
macos·pdf