解决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
相关推荐
权咚1 天前
阿权的开发经验小集
git·ios·xcode
小溪彼岸2 天前
macOS自带截图命令ScreenCapture
macos
TESmart碲视2 天前
Mac 真正多显示器支持:TESmart USB-C KVM(搭载 DisplayLink 技术)如何实现
macos·计算机外设·电脑
2501_915106322 天前
Xcode 上传 ipa 全流程详解 App Store 上架流程、uni-app 生成 ipa 文件上传与审核指南
android·macos·ios·小程序·uni-app·iphone·xcode
nightunderblackcat2 天前
新手向:Git下载全攻略
git
他们都不看好你,偏偏你最不争气2 天前
【iOS】AFNetworking
开发语言·macos·ios·objective-c
若无_3 天前
了解 .husky:前端项目中的 Git Hooks 工具
前端·git
想当花匠的小码农3 天前
Git 仓库“减肥”指南:从检测、清理到同步的全流程实践
git
钟念3 天前
【打包app】uniapp打包ios端和安卓端app
macos·objective-c·cocoa