向后兼容opensshconfiguration?

我的〜/ .ssh / config包含这个:

HostKeyAlgorithms +ssh-dss 

我复制这个configuration跨越多个系统。 最近我把它复制到一个运行OpenSSH v5.3的系统上,那条目现在是一个错误:

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

有没有办法使这个configuration向后兼容,以便新的选项用于较新的客户端,并为老客户端忽略?

旧的OpenSSH不支持+号。 但是您可以按照列出所有algorithm的方式来编写它们(这些版本通用):

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

或者只是真的更新你的服务器,不要使用DSA主机密钥,因为它们是不安全的。