解决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
相关推荐
007张三丰10 小时前
Git Rebase详解,与merge,cherry-pick比较
git·rebase·rebasing
追夢秋陽20 小时前
MacOS app打包Dmg线下分发测试及公证shell脚本
macos·shell·dmg·cocoa打包·打包脚本
jimy121 小时前
GitHub的codespaces入门,以及git设置
git·github
追夢秋陽21 小时前
MacOS 通过Shell 脚本一步到位配置nginx+Php环境
nginx·macos·php·一站式配置
专业开发者21 小时前
Wi-Fi 技术学习:一文读懂WPA2四次握手的密钥体系与交互逻辑
网络·学习·macos
睡醒了叭1 天前
缝缝补补---Git使用
git
qq_172805591 天前
Mac book pro 清理系统数据270G的硬盘空间
macos
Alkaid:1 天前
GIT常用命令
大数据·git
rock——you1 天前
macos如何升级到指定版本,而不是默认最新的版本。我的现在为15.3,如何升级到15.4,而不是最新的15.54
macos
打倒苦瓜蛋1 天前
Mac typora安装 破解教程!!!
macos