解决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
相关推荐
元Y亨H3 天前
MacBook Air 开发神器:IDEA 与 PyCharm 极简安装及环境配置
macos
yuanyxh4 天前
macOS 应用 - 纯对话生成
前端·macos·ai编程
深海鱼在掘金5 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
AI创界者5 天前
PilotTTS 一键整合包(Win/Mac):8G 显存畅跑,实测解锁情绪与副语言的精准控制
人工智能·macos·aigc·音视频
noravinsc6 天前
关于Git Flow
git
蜜獾云6 天前
在Git中配置用户名和密码
git
AirDroid_cn6 天前
系统终端与iTerm2字体看起来不一样?macOS Sequoia统一渲染指南
macos
scx_link6 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
南大白6 天前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
码农小旋风6 天前
Claude Code 基础用法大全:对话、分析、修改、测试、Git 和工作流
人工智能·git·chatgpt·claude