解决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
相关推荐
Magnetic_h5 小时前
【iOS】方法与消息底层分析
笔记·学习·macos·ios·objective-c·cocoa
xchenhao5 小时前
基于 Flutter 的开源文本 TTS 朗读器(支持 Windows/macOS/Android)
android·windows·flutter·macos·openai·tts·朗读器
Franklin8 小时前
VS 版本更新git安全保护问题的解决
git
IT WorryFree9 小时前
macos安装iper3
网络·macos·iperf·打流
我是一只代码狗12 小时前
idea中合并git分支
git
我是一只代码狗12 小时前
idea中使用git
git·gitee·github
恋喵大鲤鱼12 小时前
git restore
git·git restore
李少兄13 小时前
Git Commit Message写错后如何修改?已Push的提交如何安全修复?
git·安全
Fireworkitte13 小时前
git stash
git