11

我正在尝试在 OSX 中获得对 curl 的 SFTP 支持。我通过安装 curl

$ brew install curl --with-ssh

我还通过将自制版本符号链接到 /usr/bin

$ sudo ln -s /usr/local/bin/curl /usr/bin/curl

但我仍然得到一个

curl: (1) Protocol sftp not supported or disabled in libcurl

使用时

$ curl sftp://some.host.com/path/to/file

我的努力与真棒 git-ftp https://github.com/resmo/git-ftp/issues/146的问题有关

我究竟做错了什么?

4

3 回答 3

8

运行“curl -V”并查看 SFTP 是否被列为支持的协议。

如果不是,则需要使用 libssh2 重建 curl 以获得内置支持。

于 2012-11-01T12:42:16.443 回答
0

由于该--with-libssh2选项已从 brew中删除,因此可以采用以下方法:

brew install curl-openssl

意识到:

curl is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have curl first in your PATH, run:
  echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.zshrc

或使用以下方法直接调用它:

/usr/local/opt/curl/bin/curl ...
于 2021-08-20T15:36:52.183 回答
-3

如果您使用的是 Mac,则必须先运行它才能启用:

brew install curl --with-libssh2
于 2019-11-27T01:50:20.237 回答