解决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
相关推荐
春波petal1 天前
MacOS 13.7.8版本-前端环境一键搭建指南
前端·macos
阿林爱吃大米饭1 天前
课题组远程服务器Git版本控制实战
服务器·git·elasticsearch
阿寻寻1 天前
【云原生技术】git checkout -- . 应该用在切分之前还是之后?
git
周杰伦fans1 天前
Git 推送实战:冲突解决与强制推送
git
eppen2 天前
macOS 快捷键修改
macos
郁大锤2 天前
macOS 终端 SSH 到 Linux 后快捷键失效解决方法
linux·macos·ssh
Beyond欣2 天前
Git 踩坑记录
git
没有bug.的程序员2 天前
分布式配置深潜:Spring Cloud Config 与 Git 集成内核、版本回滚机制与多环境治理实战指南
java·分布式·git·spring cloud·分布式配置·版本回滚
阿捏利2 天前
详解Mach-O(十三)Mach-O __TEXT
macos·ios·c/c++·mach-o
Laughtin2 天前
macos的python安装选择以及homebrew python的安装方法
开发语言·python·macos