小编squ*_*wav的帖子

sshd:“没有主机密钥 alg”已修复但仍然很困惑

显然 Fedora 35 没有在 HostKeyAlgorithms 或 PubkeyAcceptedKeyTypes 中列出 ssh-rsa,因此尝试从旧的 CentOS 6 机器进行 ssh 会产生错误:

$ ssh as1s16.intra.corp.us
no hostkey alg
Run Code Online (Sandbox Code Playgroud)

所以我在 /etc/ssh/sshd_config 中的 Include 之后添加了选项:

Include /etc/ssh/sshd_config.d/*.conf

HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
Run Code Online (Sandbox Code Playgroud)

但同样的错误。然后我像这样运行 sshd :

# /usr/sbin/sshd -ddd
...
debug3: /etc/ssh/sshd_config:20 setting HostKeyAlgorithms +ssh-rsa
debug3: /etc/ssh/sshd_config:21 setting PubkeyAcceptedKeyTypes +ssh-rsa
...
debug1: SELinux support disabled [preauth]
...
debug3: append_hostkey_type: ssh-rsa key not permitted by HostkeyAlgorithms [preauth]
debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Run Code Online (Sandbox Code Playgroud)

但同样的错误。然后我删除了运行 sshd 的选项,如下所示:

# /usr/sbin/sshd -ddd -oHostKeyAlgorithms=ssh-rsa
Run Code Online (Sandbox Code Playgroud)

它起作用了。我能够从 CentOS 6 客户端成功 ssh …

configuration sshd

8
推荐指数
1
解决办法
4万
查看次数

标签 统计

configuration ×1

sshd ×1