解决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
相关推荐
拽着尾巴的鱼儿2 小时前
工具篇:git 分支版本回退
git
无限进步_5 小时前
深入理解 C/C++ 内存管理:从内存布局到动态分配
c语言·c++·windows·git·算法·github·visual studio
要加油哦~9 小时前
报错 | git 提交时,报错 .husky/commit-msg: line 4: npx: command not found | 仓库提交规范问题
git
Mr卜颛9 小时前
【Git】TortoiseGit(小乌龟)配置SSH和使用;Fork设置ssh key
git·ssh
_OP_CHEN10 小时前
【Git原理与使用】(二)Git 配置与基本操作全攻略:从配置到实战,新手也能轻松上手!
linux·运维·git·版本管理·企业级组件·git基本操作·git配置
安果移不动12 小时前
git Cherry-Pick合并分支上的某些commits-》Android studio
android·git·android studio
Better Bench12 小时前
git与github协作开发的常用命令
git·github
木兰不吃草13 小时前
mac playCover 金铲铲无法使用麦克风问题详细教程
macos·语音·麦克风·playcover·金铲铲
allnlei14 小时前
优化大仓库项目中git的使用
git
芒克芒克14 小时前
《Git分支实战:从创建到合并的全流程》
java·git