如何在 OpenSSH 8.8 的 sshd 中启用 ssh-rsa?

Pro*_*kup 12 arch-linux openssh sshd raspberry-pi

由于 OpenSSH 版本 8.8 ssh-rsa 在 OpenSSH sshd 中被禁用:

$ ssh-audit 1.2.3.4
# algorithm recommendations (for OpenSSH 8.8)
...
(rec) +ssh-rsa                              -- key algorithm to append
...
Run Code Online (Sandbox Code Playgroud)

Archlinux 论坛帖子“最新 sshd 不接受关键算法”建议:

$ grep PubkeyA /etc/ssh/sshd_config
#PubkeyAuthentication yes
PubkeyAcceptedKeyTypes=+ssh-rsa
Run Code Online (Sandbox Code Playgroud)

尽管该配置片段不会在 5.10.74-1-raspberrypi4-ARCH 上的 openssh-8.8p1-1 中启用 ssh-rsa,即使在重新启动sshd.

如何强制 OpenSSH sshd 版本 8.8 启用 ssh-rsa?

小智 24

要允许对 OpenSSH 8.8+ 使用旧的 RSA 密钥,请将以下行添加到您的sshd_config

HostKeyAlgorithms=ssh-rsa,ssh-rsa-cert-v01@openssh.com

PubkeyAcceptedAlgorithms=+ssh-rsa,ssh-rsa-cert-v01@openssh.com
Run Code Online (Sandbox Code Playgroud)

其他发行版(然后是 RPi 上的 Arch)可能支持更安全的xmss密钥,最新的 NIST 论文建议使用这些密钥

HostKeyAlgorithms=ssh-rsa,ssh-rsa-cert-v01@openssh.com,ssh-xmss-cert-v01@openssh.com,ssh-xmss@openssh.com

KexAlgorithms=+sntrup761x25519-sha512@openssh.com

PubkeyAcceptedAlgorithms=+ssh-rsa,ssh-rsa-cert-v01@openssh.com,ssh-xmss-cert-v01@openssh.com,ssh-xmss@openssh.com
Run Code Online (Sandbox Code Playgroud)

  • 是否有非美国(例如欧洲、澳大利亚、南美、加拿大)建议在 2048 位 RSA 上使用 XMSS? (2认同)