Subject: Permissions problem with mod_sftp

Permissions problem with mod_sftp

From: Will Cosgrove <>
Date: Fri, 25 May 2012 12:42:02 -0700

Hi Guys,
We've run into a curious problem with libssh2 (1.4.1) with users using proFTPD (1.3.4) and mod_sftp. What is happening is when we open a remote handle for *reading* like so:

remoteHandle = libssh2_sftp_open(session, file, LIBSSH2_FXF_READ, 0);

The server wipes out the file permissions. I.e., sets them to 000. According to the docs, if the file exists on disk it should ignore the mode bits. But it seems not to be the case.

We've tracked it back to the server config setting IgnoreSFTPUploadPerms, if this is set to yes, everything is fine. This seems like an pretty obvious server-side issue; *however* it works correctly using openssh's sftp client.

Before I continue tracking this down, do you guys have any ideas what the differences would be between openssh's sftp implementation and libssh2 which would be causing this?


Received on 2012-05-25