no matching host key type found. Their offer: ssh-rsa 问题解决
创始人
2025-01-17 10:32:38
0

最近升级了Mac OS Ventura 13.0.1后发现ssh指定密钥登录服务器失败。

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

进入当前用户的.ssh目录发现比之前系统多了一个config文件

查看sshd版本,发现升级了,需要指定算法参数

解决办法:

方法1. ssh命令指定算法,每次指定比较麻烦

ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa  user@host -p 2222

方法2. 修改ssh配置文件 ~/.ssh/config, 增加配置项,一劳永逸

HostKeyAlgorithms +ssh-rsa PubkeyAcceptedKeyTypes +ssh-rsa

上面配置默认对所有连接的服务器生效,也可以通过制定服务器使部分服务器生效

Host 172.16.x.x HostName k8s-node001 User root Port 22 HostKeyAlgorithms +ssh-rsa PubkeyAcceptedKeyTypes +ssh-rsa

为什么会有这个错误

Future deprecation notice It is now possible[1] to perform chosen-prefix attacks against the SHA-1 algorithm for less than USD$50K.

In the SSH protocol, the “ssh-rsa” signature scheme uses the SHA-1 hash algorithm in conjunction with the RSA public key algorithm. OpenSSH will disable this signature scheme by default in the near future.

Note that the deactivation of “ssh-rsa” signatures does not necessarily require cessation of use for RSA keys. In the SSH protocol, keys may be capable of signing using multiple algorithms. In particular, “ssh-rsa” keys are capable of signing using “rsa-sha2-256” (RSA/SHA256), “rsa-sha2-512” (RSA/SHA512) and “ssh-rsa” (RSA/SHA1). Only the last of these is being turned off by default.

也就是说 >=8.8p1 版的 openssh 的 ssh 客户端默认禁用了 ssh-rsa 算法, 但是服务器端未升级只支持 ssh-rsa, 当你不能自己升级远程服务器的 openssh 版本或修改配置让它使用更安全的算法时, 在本地 ssh 针对这些旧的ssh server重新启用 ssh-rsa 也是一种权宜之法.

相关内容

热门资讯

透视美元局!wpk俱乐部是做什... 透视美元局!wpk俱乐部是做什么的,先前是真的有挂(透视)必赢方法(有挂教程)透视美元局!wpk俱乐...
透视好牌!aapoker怎么控... 透视好牌!aapoker怎么控制牌(透视)真的假的(本来真的是有挂)aapoker怎么控制牌软件透明...
透视私人局"wepo... 透视私人局"wepoker辅助是真的假的"都是存在有挂(透视)微扑克教程(有挂方法);所有人都在同一...
透视玄学!wepoker安装教... 透视玄学!wepoker安装教程,最初有挂(透视)安装教程(有挂攻略);1、下载好wepoker安装...
透视好友房!aapoker a... 透视好友房!aapoker ai插件(透视)透视脚本入口(一直真的是有挂)该软件可以轻松地帮助玩家将...
透视ai代打"哈糖大... 透视ai代打"哈糖大菠萝辅助器"一贯是有挂(透视)安装教程(有挂脚本);1、每一步都需要思考,不同水...
透视好友!pokemmo脚本辅... 透视好友!pokemmo脚本辅助下载,其实是真的有挂(透视)德州论坛(有挂方法)1、透视好友!pok...
透视玄学!aapoker辅助器... 透视玄学!aapoker辅助器怎么用(透视)透视脚本下载(总是存在有挂);1、下载好aapoker辅...
透视实锤"hhpok... 透视实锤"hhpoker有没有辅助"切实是有挂(透视)安装教程(有挂解说)hhpoker有没有辅助辅...
透视辅助!hhpoker可以控... 透视辅助!hhpoker可以控制吗,从来真的是有挂(透视)科技教程(有挂细节);1、构建自己的hhp...