解决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 小时前
【SwiftUI娓娓道来】第3课:让界面活起来——交互与动画指南
学习·macos·ui·ios·swiftui·swift
朋友圈自动点赞工具8 小时前
Gmail 委托邮箱在手机上关不掉
macos·智能手机·cocoa·硬件评测
小黄人软件8 小时前
AndroidStudio老项目 macOS运行BlueTooth蓝牙串口助手(Android+Studio源码).rar
android·macos
她说..11 小时前
IntelliJ IDEA 快捷键速查表(Mac 版)
java·macos·intellij-idea
louisgeek15 小时前
Git submodule 子模块
git
for_ever_love__15 小时前
iOS: CABasicAnimation动画
macos·ios·cocoa
imDwAaY15 小时前
6篇文章讲清楚Git:Git 实用技巧:暂存现场、挑选提交与定位 Bug (5/6)
git·后端
imDwAaY15 小时前
6篇文章讲清楚Git:Git 团队开发实践:从 Pull Request 到版本发布 (6/6)
git·后端
ITKEY_15 小时前
Mac mini彻底禁止自动睡眠
macos
誰能久伴不乏1 天前
看懂 Git 团队协作全流程:分支、提交、PR、rebase 到底在干嘛
git