解决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
相关推荐
木兰不吃草2 小时前
完美解决在最新系统 MacOS 26 无法使用 playCover 键盘映射的问题(下载安装教程,完美适配)
macos·键盘映射·playcover·mac26
摇滚侠3 小时前
VScode 提交代码 Git
git
YuforiaCode5 小时前
移除原有 Git 仓库关联,在IDEA中重新初始化 Git 并推送到新仓库(详细图解、包含相关问题的解决办法)
git
UIUV5 小时前
Git程序员入门笔记:从零开始掌握分布式版本控制
git
星光不问赶路人5 小时前
彻底清理 Git 分支:从查看到批量删除无效分支的全流程指南
git·github
乾坤瞬间8 小时前
【Deepseek OCR】重磅测试,mac环境下的体验【本人已经本地实验成功】
macos·ocr
开发者驿站9 小时前
2025年保姆级C++环境配置教程(Windows/macOS双平台)
c++·windows·macos
猫头虎10 小时前
解决升级IDEA2025.2后,每次打开Maven项目爆红的问题:Windows和Mac解决方案
java·ide·macos·maven·intellij-idea·idea·intellij idea
如果是君10 小时前
【git使用】ubuntu下利用git工具提交一个工程
linux·git·ubuntu
白玉cfc10 小时前
【iOS】KVC 与 KVO 的基本了解与使用
macos·ios·objective-c·cocoa