解决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
相关推荐
gcygeeker3 小时前
解决 Mac 迁移数据后用户目录无权限问题
macos
hadage2333 小时前
--- git 笔记 ---
笔记·git·elasticsearch
johnny2333 小时前
Git:进阶、衍生
git
todoitbo5 小时前
Rust新手第一课:Mac环境搭建踩坑记录
开发语言·macos·rust
草莓熊Lotso7 小时前
Git 本地操作入门:版本控制基础、跨平台部署与仓库核心流程
开发语言·人工智能·经验分享·git·后端·架构·gitee
熊猫在哪12 小时前
macos安装mysql
数据库·mysql·macos
计算衎15 小时前
git仓库中的.git目录 , .gitattributes、.gitignore、.gitmodules、.modules文件作用与讲解
git·git bash·文件结构
心灵宝贝18 小时前
如何在 Mac 上安装 MySQL 8.0.20.dmg(从下载到使用全流程)
数据库·mysql·macos
Murphy_lx18 小时前
git工作流程
git
Elias不吃糖18 小时前
Git常用指令合集
linux·git