解决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
相关推荐
岱宗夫up2 小时前
Git不是工具,是协作哲学
git
生活很暖很治愈2 小时前
Linux基础开发工具
linux·服务器·git·vim
极地星光4 小时前
如何使用 Git 实现 revert
git
厨 神4 小时前
IFLOW-Git-Claude
git·cloudera
用户40538369359 小时前
开源语音识别FunASR入门详解
ide·macos·xcode
ghostwritten10 小时前
git 发布版本
git
无限进步_11 小时前
206. 反转链表 - 题解与详细分析
c语言·开发语言·数据结构·git·链表·github·visual studio
是店小二呀12 小时前
Git远程仓库操作:从入门到精通的协作指南
git
每天要多喝水13 小时前
git常用命令
git
哪里不会点哪里.13 小时前
Git 入门与常用操作总结
git