ssh 登录报错 no matching host key type found

cmd> ssh root@1.1.1.1

cmd> Unable to negotiate with 1.1.1.1 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

该错误表明服务器仅支持旧版的 ssh-rsa 和 ssh-dss 主机密钥算法,而你的 SSH 客户端默认可能不再支持这些算法。新的 OpenSSH 客户端默认禁用了过时或不安全的加密算法。

  1. 添加支持 ssh-rsa 的选项
ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa root@1.1.1.1
  1. 本地的 SSH 配置文件中,显式启用支持旧算法:

    ~/.ssh/config,添加以下内容:

Host 1.1.1.1
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
本作品采用《CC 协议》,转载必须注明作者和本文链接
welcome come back
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
98
粉丝
25
喜欢
159
收藏
359
排名:316
访问:3.0 万
私信
所有博文
社区赞助商