解决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
相关推荐
Cchaofan3 小时前
Git/GitLab日常使用的命令指南来了!
git·gitlab
SoraLuna4 小时前
「Mac畅玩AIGC与多模态40」开发篇35 - 用 Python 开发服务对接 SearxNG 与本地知识库
python·macos·aigc
可乐加.糖10 小时前
项目版本管理和Git分支管理方案
java·git·目标跟踪·gitlab·敏捷流程·源代码管理
wingaso10 小时前
[经验总结]删除gitlab仓库分支报错:错误:无法推送一些引用到“http:”
linux·数据仓库·git
WuYiCheng66610 小时前
TLS 1.3黑魔法:从协议破解到极致性能调优
macos
piaoxue82012 小时前
Mac上安装运行SynthTIGER
macos·语言模型
小山菌13 小时前
mac中加载C++动态库文件
开发语言·c++·macos
THMAIL15 小时前
mac M芯片运行docker-desktop异常问题
macos·docker·容器
ice___Cpu19 小时前
Git - 1( 14000 字详解 )
大数据·git·elasticsearch
laocooon52385788620 小时前
一台入网的电脑有6要素, 机器名,mac,ip,俺码,网关,dns,分别有什么作用
网络协议·tcp/ip·macos