git:Unable to negotiate问题解决

场景说明:

安装了Gitblit(自架的代码仓库服务)发现部分电脑无法推代码,报错误如下:

Unable to negotiate with **** port 22: no matching host key type found. Their offer: ssh-rsa

并排队了账户权限问题。

解决方案:

1.打开问题电脑的系统盘的当前登陆用户文件夹('C:\Users\你当前的账户名')

2.在这个文件夹中看是否有一个.ssh文件夹

如果没有则需要通过命令(CMD)创建,分别通过如下三条命令

复制代码
git config --global user.name "yourname"

git config --global user.email "your@email.com"

ssh-keygen -t rsa -C "your@email.com"

3.再次打开.ssh文件夹并在文件夹内创建config文件(注意无扩展格式),并配置内容

config 内容如下:

复制代码
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
相关推荐
-大头.1 天前
GIT教程系列(共3篇)---------第一篇:Git入门与核心概念完全指南
大数据·git·elasticsearch
_Xiaosz1 天前
Git 拉取子模块报错 Permission denied (publickey) 的排查与解决
git
晚霞的不甘1 天前
Flutter for OpenHarmony 实战:[开发环境搭建与项目编译指南]
git·flutter·react native·react.js·elasticsearch·visual studio code
-大头.1 天前
GIT教程系列(共3篇)-----第三篇:Git高级技巧与专业配置完全指南
大数据·git·elasticsearch
查拉图斯特拉面条1 天前
Git推送完全指南:从首次推送到冲突解决
大数据·git·elasticsearch
脸大是真的好~1 天前
Git的快速使用
git
沛沛老爹1 天前
从Web到AI:金融/医疗/教育行业专属Skills生态系统设计实战
java·前端·人工智能·git·金融·架构
夜流冰1 天前
Git - 学习掌握Git的建议
git·学习
小鸡脚来咯2 天前
Git 新手入门指南
大数据·git·elasticsearch
一允2 天前
Git学习记录
git·学习