no matching host key type found. Their offer: ssh-rsa 问题解决

这篇具有很好参考价值的文章主要介绍了no matching host key type found. Their offer: ssh-rsa 问题解决。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

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

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

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

no matching host key type found. their offer: ssh-rsa,Linux,ssh,服务器,linux

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

no matching host key type found. their offer: ssh-rsa,Linux,ssh,服务器,linux

解决办法:

方法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 也是一种权宜之法.文章来源地址https://www.toymoban.com/news/detail-790537.html

到了这里,关于no matching host key type found. Their offer: ssh-rsa 问题解决的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包