运维安全中心 Mac 电脑登录 Linux 提示 no matching host key type found

在 Mac 系统上登录 Linux 服务器时,提示“no matching host key type found”的错误。

相关产品
运维安全中心(堡垒机) 产品页,含版本规格、价格与购买入口。

一、可能原因

从 OpenSSH 8.8起,默认不支持 ssh-rsa。

二、解决思路

修改 sshd_config 配置文件,增加算法。

三、处理步骤

1. 在本地电脑上执行:

sudo vim /etc/ssh/ssh_config

2. 在 sshd_config 配置文件的最后追加一行(注意缩进):

HostKeyAlgorithms +ssh-rsa,ssh-dss PubkeyAcceptedKeyTypes +ssh-rsa

注意:说明:

注意:若在 macOS Tahoe 26 系统中,需将HostKeyAlgorithms +ssh-rsa,ssh-dss修改为 HostKeyAlgorithms +ssh-rsa。

3. 重新登录 Linux 服务器。

赞 (0)
上一篇 5天前
下一篇 5天前