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
相关推荐
NaCl鱼呜啦啦11 小时前
Git 仓库损坏修复指南:从诊断到恢复
git
huazi9912 小时前
AI编程(一):Trae+Git 应用开发
git·ai编程·trae
badhope15 小时前
GitHub热门AI技能Top20实战指南
前端·javascript·人工智能·git·python·github·电脑
m0_6356474816 小时前
git管理github上的repository(三)
git·github
圥忈&&丅佽&&扗虖17 小时前
ubuntu 安装git
linux·git·ubuntu
好运yoo18 小时前
git fetch和git pull的区别
大数据·git·elasticsearch
薛不痒18 小时前
github基础入门(3):版本控制(提交,分支删除,提交规范)
大数据·windows·git·elasticsearch·github
摇滚侠1 天前
git 把已经推送到远程仓库的文件取消被 git 管理
git
007张三丰1 天前
掌握核心!Git最常用的15个命令行:从入门到实战详解
git·gitlab·github·git命令行·常用命令行
月光下的麦克1 天前
Git 打 Tag 的作用
git