解决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
相关推荐
17715574314 分钟前
Mac 上 Ruby、gem、rvm、CocoaPods 四者关系通俗讲清楚
macos·ruby·cocoapods
Shell运维手记22 分钟前
交换机(二层交换机)完整工作原理
运维·网络·网络协议·macos·交换机
寒水馨1 小时前
macOS下载、安装 Tailwind CSS-v4.3.3(附安装包tailwindcss-macos-arm64)
前端·css·macos·tailwind css·utility-first·css 框架·实用优先
寒水馨2 小时前
macOS下载、安装neovim-v0.12.4(附安装包nvim-macos-arm64.tar.gz)
macos·vim·lua·文本编辑器·终端·lsp·neovim
库奇噜啦呼14 小时前
【iOS】NSOperation与NSOperationQueue
macos·ios·cocoa
2301_8098152519 小时前
Git和Gitee基本使用教程
git·gitee
雨翼轻尘20 小时前
01_Git概述及基本操作
git·概述·基本操作
a44931536220 小时前
MacBook 转轴屏线断裂故障分析——eDP 排线更换与转轴维护
macos·电脑
程序员果子1 天前
CrewAI :当 Agent 学会团队协作
人工智能·git·python·多智能体·agent框架
‎ദ്ദിᵔ.˛.ᵔ₎1 天前
Git GDB/CGDB调试器
git·gdb