大网数据广告活动
服务器运维问答

Backwards compatible openssh configuration?

· 52CE 我爱测

My ~/.ssh/config contains this: HostKeyAlgorithms +ssh-dss I copy this configuration across many systems. Recently I copied it to a system running OpenSSH v5.3 and that entry is now an error: /home/sparr/.ssh/config line 3: Bad p…

问题原文

原帖链接 · Sparr · CC BY-SA 3.0

My ~/.ssh/config contains this:

HostKeyAlgorithms +ssh-dss

I copy this configuration across many systems. Recently I copied it to a system running OpenSSH v5.3 and that entry is now an error:

/home/sparr/.ssh/config line 3: Bad protocol 2 host key algorithms '+ssh-dss'.

Is there a way to make this configuration backwards compatible, so that the new option is used for newer clients and ignored for older clients?

已采纳解答

原帖链接 · Jakuje · CC BY-SA 3.0

The old OpenSSH does not support the + sign. But you can write it the way you list all of the algoriths (that are common for these versions):

HostKeyAlgorithms [email omitted],[email omitted],[email omitted],[email omitted],[email omitted],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa,ssh-dss

Or just really update your server and do not use DSA host keys, since they are insecure.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-04-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。