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
相关推荐
charlie11451419140 分钟前
Git团队协作完全入门指南(下)
git
golang学习记3 小时前
Facebook 为什么不用 Git?
git·elasticsearch·facebook
GIS阵地3 小时前
git拉取时报错
大数据·git·elasticsearch
无限进步_6 小时前
C++ Vector 全解析:从使用到深入理解
开发语言·c++·ide·windows·git·github·visual studio
charlee446 小时前
Git使用经验总结9-Git提交关联到Issue
git·issue
-拟墨画扇-7 小时前
Git | Bug分支操作
git·gitee·github·bug·gitcode
-拟墨画扇-8 小时前
Git | Feature分支操作
git·gitee·github·gitcode
无限进步_8 小时前
C++多态全面解析:从概念到实现
开发语言·jvm·c++·ide·git·github·visual studio
henreash9 小时前
windows下git的hooks
git
无限进步_9 小时前
C++ STL list容器深度解析与模拟实现
开发语言·数据结构·c++·windows·git·list·visual studio