우분투 리눅스의 curl에서 SFTP프로토콜 사용하기

fortpower의 이미지

안녕하세요

우분투 리눅스의 curl에서 SFTP프로토콜 사용하려는데

잘 안되서 질문 드립니다.

curl을 이용해서 SFTP프로토콜 사용해서 파일 전송을 하려고 했는데
* Protocol "sftp" not supported or disabled in libcurl 오류가 나서

libssh2를 설치하려고 하는데...

https://ykamal.com/ubuntu-fix-protocol-sftp-not-supported-or-disabled-in-libcurl/

이 사이트 보고 진행중입니다만...

./configure --with-libssh2=/usr/local

에서 잘 안되네요

SELECT TLS backend(s) or disable TLS with --without-ssl이 나오네요...

혹시

우분투 리눅스에서

libssh2 를 설치해서

curl로 SFTP프로토콜 사용해서 파일전송 해보신분

좀 도와주실 수 있을까요?

File attachments: 
첨부파일 크기
Image icon 질문.png28 KB
chanik의 이미지

우선, 제가 쓰는 우분투 20.04에서 확인해보니 기본설치된 curl이 sftp를 지원하는 것으로 나옵니다.

$ curl -V
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

그리고, 링크하신 페이지를 따라서 libssh2와 curl을 빌드해봐도 별 오류 없이 되고요.

$ sudo apt install -y build-essential libssl-dev
$ wget "https://www.libssh2.org/download/libssh2-1.9.0.tar.gz"
$ wget "https://curl.haxx.se/download/curl-7.73.0.tar.gz"
$ tar xzf libssh2-1.9.0.tar.gz
$ tar xzf curl-7.73.0.tar.gz
$ cd libssh2-1.9.0
$ ./configure --prefix=/home/testuser/test/curl
$ make install
$ cd ../curl-7.73.0
$ ./configure --with-libssh2=/home/testuser/test/curl --prefix=/home/testuser/test/curl
$ make install
 
$ /home/testuser/test/curl/bin/curl -V
curl 7.73.0 (x86_64-pc-linux-gnu) libcurl/7.73.0 OpenSSL/1.1.1f zlib/1.2.11 libssh2/1.9.0
Release-Date: 2020-10-14
Protocols: dict file ftp ftps gopher http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets

사용하시는 우분투 버전과 작업과정을 올려주시면 도움을 얻기가 더 수월할 것입니다.