lftp error: port 22: no matching host key type found. Their offer: ssh-dss

lftp error: port 22: no matching host key type found. Their offer: ssh-dss

如何修复此错误,no matching host key type found. Their offer: ssh-dss 在安装了 Ubuntu 18.04 的虚拟机上执行 lftp 时。

我试过添加

Host *
    PubkeyAcceptedKeyTypes=+ssh-dss

到我的 ~/.ssh/config 文件,但我仍然看到错误。我试图避免编辑我的 /etc/ssh/config 文件,因为我无力重新启动我的 ssh 服务器。有没有我可以在 运行 时间用 lftp 传递的选项?

我发现了一个 hack,我在 lftp 命令中利用了一些 ssh 选项。

lftp -p 22 -u <username>,<password> sftp://<domain> -e 'set sftp:connect-program "ssh -a -x -oHostKeyAlgorithms=+ssh-dss"'

通过将 PubkeyAcceptedKeyTypes 添加到我的 .ssh/config

来修复
HostKeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa