解决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
相关推荐
Benny的老巢1 小时前
Mac上用XAMPP搭建局域网可访问的开发环境,让局域网内其他设备通过域名访问
nginx·macos·apache·xampp·php开发环境
小龙6 小时前
[Git 报错解决]本地分支落后于远程分支(`non-fast-forward`)
大数据·git·elasticsearch·github
爱敲代码的婷婷婷.7 小时前
git 指定版本回退、临时保存 等操作
git
闲云一鹤8 小时前
Git 焚决!一个绝招助你找回丢失的代码文件!
前端·git
DKunYu8 小时前
2.分支管理
大数据·git·elasticsearch·搜索引擎·gitee
DKunYu9 小时前
1.基本操作
git·gitee
2501_941881409 小时前
在墨西哥城复杂流量环境下构建高稳定性API网关的架构设计与实现实践分享
macos·golang·xcode
小龙9 小时前
【Git 报错解决】SSH 公钥认证失败(`Permission denied (publickey)`)
运维·git·ssh
wadesir9 小时前
macOS Sequoia与macOS Tahoe全面对比:功能、性能与升级教程(新手入门指南)
macos
哆啦code梦10 小时前
Git Flow架构图解:分支策略全解析
git·git flow·分支策略