解决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 小时前
智叟云集系统:便携部署、MAC 授权与交付排障
macos
Joy T7 小时前
voice-dump-to-todo:把混乱的语音整理成可执行待办,一个实用的 Agent Skill
ide·macos·语音识别·xcode·任务管理·自研skill
LannyChung11 小时前
PowerShell 下 git log 中文乱码的完整排查与解决
windows·git
import_random12 小时前
[git]本地main,origin/main,远程main(关系2)
git
golang学习记12 小时前
Zed Git重大更新:目录级对比支持分栏Diff
git·vscode·zed
JPower_mr.g14 小时前
SmartCall v1.0.9 发布:智能体知识库上线,让 AI 客服先查资料再回答
java·ide·人工智能·macos·架构·开源·xcode
轻口味16 小时前
启元无真机二开实战:先在Mac上养一台Q1——官方URDF到MuJoCo数字孪生的完整链
macos·具身智能·mujoco·启元机器人
阿俊-全栈开发17 小时前
LikeShop 单商户高级版二开项目的 Git 分支管理与版本发布规范
git·likeshop·likeshop开源商城·likeshop多商户
努力弹琴的大风天17 小时前
TortoiseGit 仓库不显示绿色对号解决方案
git·tortoisegit·图标显示
我不会插花弄玉20 小时前
GitHub实操【由浅入深-Git】
git·github