This is a really strange one. I have a Ubuntu server setup (12.04) with proFTPD, and I have turned on SFTP. I have a user I want to be able to edit a set of files. The files are owned by the user www-data and the group www-data. The files have permissions 664. The user is in the group www-data, and is able to view, and edit the files when connected over ssh through the shell. However, over SFTP, the user can view these files, but attempting to edit them causes SFTP to report permission denied, and then causes the file to be zero sized. The user is however, able to delete and move the files. Can anyone think of any reason why this might be happening? I have also tried changing the group ownership of the file to another group, and adding the user to that group, but the same issue occurs.
The issue does not occur over regular FTP with proFTPD.
Edit: As requested, the full text of the error (this is over sftp command line interactive mode):
Uploading /Users/leonaves/Desktop/testfile to /testfile
remote open("/testfile"): Permission denied
Edit 2: ls -l output for home directory of user:
Edit 3: SFTP log shows the following:
error changing permissions of '/testfile' to 0100644: Operation not permitted
testfile
? – Kenster