OSX上对curl的SFTP支持

gpnt7bae  于 2023-05-07  发布在  其他
关注(0)|答案(3)|浏览(186)

我试图在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
我做错了什么?

pdsfdshx

pdsfdshx1#

运行'curl -V'并查看SFTP是否被列为受支持的协议。
如果不是,就需要用libssh 2重新构建curl来获得内置的支持。

fwzugrvs

fwzugrvs2#

由于--with-libssh2选项是removed from 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 ...
2vuwiymt

2vuwiymt3#

如果你是在Mac上,你必须首先运行这个来启用:

brew install curl --with-libssh2

相关问题