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
相关推荐
安庆平.Я1 小时前
git互联GitHub 使用教程
git·github
自来也_8 小时前
Git配置代理
git
Jooolin1 天前
【编程史】Git是如何诞生的?这可并非计划之中...
linux·git·ai编程
Lw老王要学习1 天前
VScode 使用 git 提交数据到指定库的完整指南
windows·git·vscode
去旅行、在路上1 天前
Git & Svn
git·svn
abcnull1 天前
github中main与master,master无法合并到main
git·github
养意1 天前
git提交代码和解决冲突修复bug
git·bug
码农黛兮_462 天前
Git 常用命令大全
git
一弓虽2 天前
git 学习
git·学习
疯狂的沙粒2 天前
如何通过git命令查看项目连接的仓库地址?
大数据·git·elasticsearch