文档中心>运维安全中心(堡垒机)>故障处理>Mac 电脑登录 Linux 提示 no matching host key type found

Mac 电脑登录 Linux 提示 no matching host key type found

最近更新时间:2024-05-30 17:54:31

我的收藏

现象描述

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


可能原因

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

解决思路

修改 sshd 文件,增加算法。

处理步骤

1. 在本地电脑上执行:
sudo vim /etc/ssh/ssh_config
2. 在 sshd 文件的最后追加一行(注意缩进):
HostKeyAlgorithms +ssh-rsa,ssh-dss
PubkeyAcceptedKeyTypes +ssh-rsa

3. 重新登录 Linux 服务器。