解决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
相关推荐
qq_377572779 小时前
git commit - revert + reset + checkout + reorder
git
2301_7672332215 小时前
Git使用和理解上的一些问题
git
共享家952717 小时前
linux-数据链路层
linux·网络·macos
nyf_unknown1 天前
(vue)将文件夹打成tar包, Git Bash(推荐)具体使用
vue.js·git·bash
兔老大RabbitMQ1 天前
Git Revert 特定文件/路径的方法
git
CZIDC1 天前
MacOS字体看起来比在 Windows 上更好?
macos
Cosmoshhhyyy1 天前
linux远程部署dify和mac本地部署dify
linux·运维·macos
行星0081 天前
mac 通过homebrew 安装和使用nvm
macos·npm·node.js
星哥说事2 天前
如何将堡塔云WAF迁移到新的服务器
服务器·git·github