解决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
相关推荐
玉梅小洋22 分钟前
Git 使用技巧——查看 Commit 修改文件的概要
git·github
仙剑魔尊重楼10 小时前
iMazing 3.1.3官方中文版新功能介绍
macos·objective-c·cocoa
Howie Zphile11 小时前
Git 拉 NocoBase 2.0 beta(next 分支),并“每天自动更新 + 自动编译 + 自动重启”
大数据·git·elasticsearch
吕司13 小时前
Git分支管理
git
Genie cloud13 小时前
在 Mac 上使用 Docker 安装宝塔并部署 LNMP 环境
macos·docker·容器·云计算
黑屋里的马14 小时前
GitExtension下载、安装
git·gitextension
清蒸鳜鱼14 小时前
【Mobile Agent——Droidrun】MacOS+Android配置、使用指南
android·macos·mobileagent
Geoking.14 小时前
Git 中的 Rebase 与 Merge:原理、区别与最佳实践
git
linweidong15 小时前
屏幕尺寸的万花筒:如何在 iOS 碎片化生态中以不变应万变?
macos·ios·移动开发·objective-c·cocoa·ios面试·ios面经
invicinble16 小时前
一文了解git
大数据·git·elasticsearch