解决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
相关推荐
Selicens1 天前
git批量删除本地多余分支
前端·git·后端
闲云一鹤2 天前
Git LFS 扫盲教程 - 你不会还在用 Git 管理大文件吧?
前端·git·前端工程化
pe7er5 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
vibecoding日记5 天前
为什么我就想要「线性历史 + Signed Commits」,GitHub 却把我当猴耍 🤬🎙️
git·编程工具
程序员小崔日记5 天前
如何将代码轻松上传到 Gitee?Git 使用全攻略!
git·gitee·上传
Bigger6 天前
为什么你的 Git 提交需要签名?—— Git Commit Signing 完全指南
git·开源·github
DianSan_ERP7 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
红豆子不相思7 天前
Tomcat 环境搭建与集群实战
服务器·git·tomcat
杰哥技术分享7 天前
Git 仓库迁移技术文档:从 CODING.net 迁移至腾讯云 CNB
git