【发布时间】:2017-10-14 01:56:25
【问题描述】:
我正在尝试通过 shell 脚本将文件发送到 SFTP,但收到以下错误
Bad protocol 2 host key algorithms '+ssh-dss'
但如果手动运行 SFTP 命令,我可以传输文件。
请提出建议。
【问题讨论】:
-
OpenSSH 7.0 及更高版本同样禁用 ssh-dss (DSA) 公钥算法。它也很弱,我建议不要使用它。可以使用 HostKeyAlgorithms 配置选项重新启用它:ssh -oHostKeyAlgorithms=+ssh-dss user@legacyhost 或在 ~/.ssh/config 文件中:Host somehost.example.org HostKeyAlgorithms +ssh-dss