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 "[email protected]"

ssh-keygen -t rsa -C "[email protected]"

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

config 内容如下:

复制代码
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
相关推荐
柚个朵朵3 小时前
IDEA中使用Git
java·git·spring
我是哈哈hh3 小时前
【Git】初始Git及入门命令行
git·gitee·github·版本控制器
lifejump3 小时前
Git命令(Gitee)
git·gitee
极小狐3 小时前
如何创建并使用极狐GitLab 部署令牌?
运维·git·ssh·gitlab·github
Kusunoki_D4 小时前
Win11 配置 Git 绑定 Github 账号的方法与问题汇总
git·github
Justice link6 小时前
Git和Gitlab的部署和操作
git
极小狐6 小时前
极狐GitLab 的合并请求部件能干什么?
运维·git·安全·gitlab·极狐gitlab
vortex56 小时前
Git常用命令简明教程
git
YoungHong199212 小时前
Git Bisect 使用指南:高效定位引入 Bug 的提交
git·bug
极小狐15 小时前
极狐GitLab 的压缩和合并是什么?
运维·git·ssh·gitlab·github