解决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
相关推荐
Hey_Coder14 小时前
【Git 常用命令速查表(按功能分类)】
git·git基础命令·git命令速查表·git 常用命令
colman wang17 小时前
Git指令(Mac)
git·macos
cyforkk19 小时前
Git 合并分支提示 Already up to date 的真实原因
git
●VON20 小时前
HarmonyKit | 移动端开发者工具类应用的现状与趋势
git·华为·性能优化·harmonyos·鸿蒙
●VON21 小时前
HarmonyKit | 鸿蒙开发协作:如何为 HarmonyKit 贡献一个新的工具
git·华为·harmonyos·鸿蒙
枕星而眠21 小时前
Git仓库基础用法
大数据·git·后端·elasticsearch·全文检索
酷虎软件1 天前
分享链接+视频音频文案提取 API 接口文档
ide·macos·xcode
梦想三三1 天前
Git与GitHub基础入门:从零开始掌握版本控制与代码托管(完整图文教程)
人工智能·git·elasticsearch·github
Hyyy1 天前
为什么 macOS 应用一换 Bundle ID,之前授予的权限就全失效了?
macos·electron
p似笑非笑1 天前
实战验证——把 SDK 塞进一个 macOS 原生 Agent 应用
macos