一、可能原因
从 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 服务器。