解决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
相关推荐
会飞的爱迪生12 分钟前
Git客户端使用之TortoiseGit和Git
git
追梦的鱼儿1 小时前
Git之代已修改文件的目录高亮设置
android·git·intellij-idea·目录·高亮
Betray3912 小时前
Git进行版本控制操作流程
git
yanling20232 小时前
Parallels Desktop 20 for Mac 2024年最新激活码秘钥
科技·macos·pd
VAllen3 小时前
从Windows 11 23H2升级至24H2后,Git操作提示文件所有权错误的3种有效解决方案
windows·git
Java入门学习4 小时前
IDEA如何设置查看差异时到达最下面不自动跳到下一个文件
git·intellij idea
cooldream20094 小时前
如何在 IDEA 中导入 Java 项目的 Git 仓库并启动
java·git·intellij-idea
axing_13145 小时前
关于win10中的Git Bash安装python及虚拟环境venv的激活
git·python·bash
korgs6 小时前
04. Form表单相关(一) - NSLabel 标签和 NSTextField 文本输入控件
macos·ios·objective-c·swift
狼刀流7 小时前
(10) GTest c++单元测试(mac版)
c++·macos·单元测试