cURL / Mailing Lists / curl-users / Single Mail

curl-users

command-line tool / SFTP / 644 permissions

From: Aaron Couts <aaroncouts_at_gmail.com>
Date: Tue, 23 Jun 2015 11:59:54 -0400

I recently ran into an issue while attempting to download a file from my
SFTP server using the curl command-line tool.

$ curl sftp://<user>:<password>@<server>/<file> -o <file>
curl: (9) Could not open remote file for reading: Permission denied

The remote file has 664 permissions, so there shouldn't be a permissions
issue. My SFTP server logs show that curl is attempting to change the
permissions on the file:

Jun 23 15:16:05 mod_sftp/0.9.7[15657]: error changing permissions of
'/<file>' to 0100644: Operation not permitted

My SFTP user is not the owner of the file, which is why the chmod command
fails. When I change the permissions from 664 to 644, I can download the
file with curl, and my SFTP logs don't show any attempt to change the
permissions.

Is there any way to suppress the chmod command that curl is running? I
haven't been able to find anything about this in the documentation, the
curl-users archive, or on google. Hopefully I'm not missing something
obvious.

My SFTP server is ProFTPD 1.3.3g with mod_sftp. I've tested this issue
with curl 7.43.0 and 7.19.7.

Thanks,
Aaron

-------------------------------------------------------------------
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 2015-06-23