解决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
相关推荐
leoZ23114 小时前
Git 集成实战完全指南(四):Git 冲突解决
大数据·git·elasticsearch
枫荷19 小时前
Git LFS 大文件优化说明
git
techdashen20 小时前
不用再反复 stash:用 Git Worktree 同时开发多个分支
大数据·git·elasticsearch
之歆21 小时前
从 Mac 回到 Windows:用 PowerToys + AutoHotkey 找回熟悉手感
windows·macos
星辰即远方1 天前
字符串合法性检验
macos·ios·cocoa
leoZ2311 天前
Git 集成实战完全指南(八):团队协作最佳实践
git
2501_916008892 天前
苹果上架工具怎么选 不用 Mac 上架 App Store 的几种方案
android·macos·ios·小程序·uni-app·iphone·webview
晴雨天️2 天前
Git工具使用指南
笔记·git
酷可达拉斯2 天前
Linux操作系统-简单内核优化
linux·git·php
秋雨梧桐叶落莳2 天前
iOS——3GShare项目总结
学习·macos·ios·objective-c·cocoa