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
相关推荐
眼小博4 小时前
多人协作Git开发流程指南
git
lpfasd12311 小时前
git-团队协作基础
chrome·git·elasticsearch
John Song13 小时前
git多个账号管理
git·github
CV_J14 小时前
解决Git 冲突后本地提交丢失/未推送问题
git
__Witheart__14 小时前
Git 某个分支恢复到某个特定的 commit 状态
git
XU磊26016 小时前
Git 实现github仓库管理-删除指定目录下的所有文件并保留目录结构
git·github
zhimingwen18 小时前
解决 GitLab Token 轮换后 SourceTree 认证失败问题
git
昵称是6硬币18 小时前
代码管理——VS Code|Git
git·代码管理
Trouville0119 小时前
如何在VScode环境下使用git进行版本控制,并上传到gitee远程仓库
ide·git·vscode
weixin_4233919319 小时前
从开发到合并:AICR 项目 Git 协作提交全流程指南
git