解决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
相关推荐
MrZWCui27 分钟前
iOS app语言切换
macos·ios·cocoa
晴天无痕2 小时前
iOS修改tabbar的背景图
macos·ios·cocoa
2501_916007473 小时前
iOS文件管理工具深度剖析,从系统沙盒到跨平台文件操作的多工具协同实践
android·macos·ios·小程序·uni-app·cocoa·iphone
嚴寒5 小时前
Mac 安装 Dart & Flutter 完整开发环境指南
前端·macos
眼小博8 小时前
多人协作Git开发流程指南
git
lpfasd12314 小时前
git-团队协作基础
chrome·git·elasticsearch
John Song17 小时前
git多个账号管理
git·github
CV_J17 小时前
解决Git 冲突后本地提交丢失/未推送问题
git
__Witheart__17 小时前
Git 某个分支恢复到某个特定的 commit 状态
git