解决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 小时前
mac电脑安装OpenClaw步骤
人工智能·macos
Rhystt1 小时前
furryCTF 题解|Web方向|保姆级详解|固若金汤、DeepSleep
git·python·安全·web安全·网络安全
头发那是一根不剩了17 小时前
Git 常用命令
git
x-cmd17 小时前
[x-cmd] x git - Git 命令增强工具
git·终端·命令行·x-cmd
程序员果子19 小时前
Git从零到远程协作:手把手实战指南
git
猫头虎1 天前
OpenClaw 常用操作命令完整速查手册:终端 CLI 操作指令详解|聊天斜杠指令详情
运维·git·容器·开源·github·aigc·ai编程
小哈里1 天前
【工具】Linux远程开发核心工具,Git命令缩写与SSH常用命令
linux·git·ssh·工具·远程开发
迈克桀森2 天前
Git 日常操作全攻略:拉取 / 提交代码 + 高频命令速查
git·github