cURL / Mailing Lists / curl-users / Single Mail

curl-users

What I do wrong with this sftp command with curl?

From: Wei Weng <wweng_at_kencast.com>
Date: Wed, 14 Nov 2007 18:46:37 -0500

hi all.

I tried this first: (download with curl via FTP)
[wweng@Monet tmp]$ curl -v -u wweng:mypass ftp://192.168.1.162/test.jpg
> test.jpg
* About to connect() to 192.168.1.162 port 21 (#0)
* Trying 192.168.1.162... connected
* Connected to 192.168.1.162 (192.168.1.162) port 21 (#0)
< 220 (vsFTPd 2.0.5)
> USER wweng
< 331 Please specify the password.
> PASS mypass
< 230 Login successful.
> PWD
< 257 "/home/wweng"
* Entry path is '/home/wweng'
> EPSV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||8266|)
* Trying 192.168.1.162... connected
* Connecting to 192.168.1.162 (192.168.1.162) port 8266
> TYPE I
< 200 Switching to Binary mode.
> SIZE test.jpg
< 213 23568
> RETR test.jpg
< 150 Opening BINARY mode data connection for test.jpg (23568 bytes).
* Maxdownload = -1
* Getting file with size: 23568
{ [data not shown]
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
 69 23568 69 16384 0 0 1996k 0 --:--:-- --:--:-- --:--:--
1996k* Remembering we are in dir ""
< 226 File send OK.
100 23568 100 23568 0 0 2654k 0 --:--:-- --:--:-- --:--:--
7015k* Connection #0 to host 192.168.1.162 left intact

> QUIT
< 221 Goodbye.
* Closing connection #0

so far so good. Ok, then I tried the same command but instead of FTP, I
used SFTP.

[wweng@Monet tmp]$ curl -v -u wweng:mypass sftp://192.168.1.162/test.jpg
> test.jpg
* About to connect() to 192.168.1.162 port 22 (#0)
* Trying 192.168.1.162... connected
* Connected to 192.168.1.162 (192.168.1.162) port 22 (#0)
* SSH authentication methods available: publickey,gssapi-with-mic,password
* Using ssh public key file /home/wweng/.ssh/id_dsa.pub
* Using ssh private key file /home/wweng/.ssh/id_dsa
* Initialized password authentication
* Authentication complete
* Could not open remote file for reading: No such file or directory
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0* Closing connection #0

curl: (78) Could not open remote file for reading: No such file or directory

Can someone enlighten me why I have this error with SFTP but not FTP?
(From what I have read, they are very similar protocols in behaviors)

Thanks

Wei
Received on 2007-11-15