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
相关推荐
不吃鱼的羊14 小时前
git推送提示错误missing Change-Id in message footer
git
小霍同学18 小时前
Git 常用指令汇总
git
无限进步_19 小时前
深入解析list:一个完整的C++双向链表实现
开发语言·c++·git·链表·github·list·visual studio
Awna19 小时前
Git 合并多次提交记录实战
git
火车叼位21 小时前
一次看懂 Git 仓库分叉、冲突已解决但仍在合并中的状态
git
ruanCat1 天前
simple-git-hooks 踩坑实录:钩子装对了却从没触发过,原来是 .git 目录捣的鬼
前端·git·代码规范
葱卤山猪1 天前
Git常用核心命令实操总结(新手避坑版)
大数据·git·elasticsearch
深蓝轨迹1 天前
Git误操作急救手册
chrome·git·elasticsearch
无限进步_1 天前
【C++】字符串中的字母反转算法详解
开发语言·c++·ide·git·算法·github·visual studio
Tipriest_1 天前
git reflog介绍(找回之前detach后做的commit)
git