报错内容:

Unable to negotiate with x.x.x.x port 22: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

已经在服务器上添加了windows电脑的公钥,刚开始一段时间,是能正常使用的,但是突然之间,windows上无法更新代码了。

 

解决:

C:\Users\Administrator\.ssh (这是我的电脑上的路径,你们的电脑路径可能不一样,根据具体情况来找)

在该目录下新增文件 config,文件内容为:

Host x.x.x.x
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa

注意,这里的x.x.x.x代表的是你的git服务器的IP地址。

 

重新拉取代码,此时就恢复了。

相关文章:

  • 2021-04-19
  • 2022-12-23
  • 2022-02-19
  • 2021-05-18
  • 2021-08-02
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-12-11
  • 2021-10-29
  • 2021-11-23
相关资源
相似解决方案