尝试使用 DSA 指纹通过 SFTP 将文件传输到远程服务器?

Trying to transfer file to remote server via SFTP using DSA fingerprint?

坦白说,我是一名 Web 开发人员而不是网络管理员,所以这些东西有点超出我的掌控范围。

我正在尝试使用 cURL 启动 SFTP 连接并将简单的文本文件传输到远程主机。当我 运行 这个 cURL 命令时:

curl -u username:password -T /path/to/file.txt sftp://host.com:22/file.txt

我收到此错误:curl: (51) SSL 对等证书或 SSH 远程密钥不正确

所以我联系了远程主机的管理员,他们回复了这条消息:

Please use our host key ssh-dss 1024 12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef

经过一些挖掘,我了解到我无法根据他们提供的信息生成 public 密钥。我不确定如何处理这些信息。有什么建议吗?我想我认为我需要他们提供的 public 密钥文件...对吗?

任何和所有见解将不胜感激。谢谢!

我想最简单的方法是使用 sftp

手动连接
sftp host.com

它会提示您验证主机密钥或出现不允许 DSA 的错误。在第一种情况下,确认您拥有与管理员提供的相同的内容并写入 "yes".

如果您的客户不接受 DSA,请在您的 ~/.ssh/config 中添加 HostKeyAlgorithms +ssh-dss

之后您应该可以使用您的命令传输文件了。

-k, --insecure

(SSL) This option explicitly allows curl to perform "insecure" SSL connections > and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered "insecure" fail unless -k, --insecure is used.

See this online resource for further details: http://curl.haxx.se/docs/sslcerts.html

来自:https://serverfault.com/questions/469824/curl-disable-certificate-verification