解决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 小时前
shell的if多条件
git·ssh
zh_xuan2 小时前
Visual Studio 上传工程到github
ide·git·github·visual studio
小小码农@3 小时前
Vmware安装MacOS
macos
AntoineGriezmann4 小时前
Git 学习笔记
git
无限进步_4 小时前
【C++】只出现一次的数字 II:位运算的三种解法深度解析
数据结构·c++·ide·windows·git·算法·leetcode
无限进步_6 小时前
【C++】多重继承中的虚表布局分析:D类对象为何有两个虚表?
开发语言·c++·ide·windows·git·算法·visual studio
回家路上绕了弯7 小时前
Git worktree 终极指南:告别分支切换烦恼,实现多分支并行开发
git·后端
日更嵌入式的打工仔8 小时前
Git & TortoiseGit
git
会的越多不会的也就越多9 小时前
Win11 右键菜单优化指南:如何把 Git 功能“提”到一级菜单?
git
一个人旅程~10 小时前
macOS装进移动硬盘成为双系统的操作方法
linux·经验分享·macos·电脑