cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Re: unable to read remote file via curl-proxy-sftp (command line) - Permission denied

From: Stephen Chai <jc_tt_at_yahoo.com>
Date: Mon, 8 Apr 2013 20:08:38 -0700 (PDT)

On  Mon, 8 Apr 2013 13:42:24 +0200 (CEST), Daniel Stenberg wrote:
>My guess is that you're using a wrong URL so that it doesn't point to the specific file you want. The "targetFile" you mention in your command line.

>But without more details it is hard to tell for sure.
> / daniel.haxx.se

Hi Daniel, 

Many thanks for your reply. The url I am using should be correct as I can rename the file successfully. 

Additionally, I am successsful in downloading a file having the same user id as my log in. 
The issue is with files which user id is not the same as my login (eventhough having the same user group).

I put here some more info. Hope this helps. By the way, is there a way to get more debug logging (beside -v & -trace) ?
Thanks in advance.

file to get : 
=============
-rw-rw----    1 sftpUserB groupA    24368 Mar 14 15:26 targetFile 

Curl version: 
=============
curl 7.28.1 (sparc-sun-solaris2.10) libcurl/7.28.1 OpenSSL/0.9.7d zlib/1.2.3 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz

command: 
========
curl -v -x [proxyServer]:[proxyPort] -U [proxyUser]:[proxyPassword] --proxytunnel --insecure -u [sftpUserA]:[sftpPassword] sftp://[sftpserver]/[targetFile]
 
verbose output:
===============
* About to connect() to proxy  [proxyServer]  port [proxyPort] (#0)
*   Trying [proxyServer]...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* connected
* Connected to [proxyServer] ([proxyServer]) port [proxyPort]  (#0)
* Establish HTTP proxy tunnel to [sftpserver]:22
* Proxy auth using Basic with user '[proxyUser]'
* Server auth using Basic with user '[sftpUserA]'
> CONNECT [sftpserver]:22 HTTP/1.1
> Host: [sftpserver]:22
> Proxy-Authorization: Basic 02ur0josdjfljmfld
> User-Agent: curl/7.28.1
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
* SSH MD5 fingerprint: 21321as23d123s13as21d3a21
* SSH authentication methods available: password
* Initialized password authentication
* Authentication complete
* Could not open remote file for reading: Permission denied
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host [proxyServer] left intact
curl: (9) Could not open remote file for reading: Permission denied
* Closing connection #0

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-09