win10 git 命令行出现 no matching host key type found. Their offer: ssh-rsa 解决方案

背景:

win10电脑, 公私钥都已经配置好。

 

一 现象:

1. 配置好公私钥之后,仍然无法直接用 git ssh的方式,下载代码。

2. 出现形如

   no matching host key type found. Their offer: ssh-rsa 的错误.

 

二. 解决方案:

C:\Users\walkerjiang\.ssh\config

 

增加以下二项

HostKeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa

最终如下:

Host git.oa.com
HostName git.oa.com
User xxxx  #用户名
Port 12345  #真实端口
IdentityFile C:\Users\xxxxx\.ssh\私钥名   
HostKeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa

 

解决问题来源参与:

https://www.linuxquestions.org/questions/linux-security-4/no-matching-host-key-type-found-their-offer-ssh-rsa-ssh-dss-4175701155/

posted @ 2021-11-26 10:34  跬步者  阅读(11771)  评论(0编辑  收藏  举报