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
相关推荐
chen_2274 分钟前
KZPROJ Git Diff AI 审查工具
git·ai·claude·kanzi
向日的葵00632 分钟前
大模型技术之git(第八章)
git
xuhaoyu_cpp_java2 小时前
Git学习(一)
经验分享·笔记·git·学习
Mr YiRan3 小时前
Android构建优化:基于Git Diff+TaskGraph
android·git·elasticsearch
Huazzi.4 小时前
Git本地和远程历史不一致问题解决步骤
大数据·git·elasticsearch
黑白园4 小时前
Windows下修改文件,使用git commit --amend推送到同一笔commit上
git
向日的葵0064 小时前
大模型技术之git(第七章)
git
Tingjct19 小时前
git/gdb指令
大数据·git·elasticsearch
谷哥的小弟20 小时前
(最新版)Git&GitHub实操图文详解教程(03)—Git工作原理
git·github·版本控制·工作原理·git工作原理
devilnumber20 小时前
idea中git的commit弹出框改为工具框
git