解决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
相关推荐
小哈里10 小时前
【工具】Linux远程开发核心工具,Git命令缩写与SSH常用命令
linux·git·ssh·工具·远程开发
迈克桀森17 小时前
Git 日常操作全攻略:拉取 / 提交代码 + 高频命令速查
git·github
CCC:CarCrazeCurator19 小时前
详解文件与文件夹权限:谁能操作、能做什么
git
Delta-delta21 小时前
Git:warning: Clone succeeded, but checkout failed.
git
开发者导航1 天前
【开发者导航】多功能生成模型开发工具:Diffusers 详细介绍
人工智能·python·学习·macos·信息可视化
日光倾1 天前
【Vue.js 入门笔记】Git入门
笔记·git
dreams_dream1 天前
Git 的 Tag
git
码农阿豪1 天前
Jenkins Git 克隆失败深度解析:从 “Connection reset by peer“ 到彻底解决
运维·git·jenkins
独自破碎E1 天前
VS Code图形化界面操作Git
git