Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got some trouble with a server situation, where i keep some configuration files in a sub-directory of a web project. Using my superuser account, i make changes to these files, which NetBeans commits for me, by uploading them.

But the client needs to be able to access and modify these files via ftp. I was able to run a chown ftpuser *.* and it worked, but only until i re-uploaded the file, after which it was again owned by me, and the client could no longer modify it.

How can i make these files modifiable by me and the client?

(It's Debian 6.0 running on Plesk 11)

share|improve this question
    
    
I read through the links, but found nothing helpful in there for my situation. –  Cummander Checkov Jul 2 at 15:38

1 Answer 1

up vote 2 down vote accepted

You should look up file-based ACLs (FACL), as they're made to do what you are looking to do.

The short version is you set the partition in question to track file-based acl permissions by editing your /etc/fstab and add the "acl": option:

#example /dev/VolGroup00/LogVol02 / ext3 defaults,acl 1 1

Then you set the appropriate FACL on the directory you want the client to access:

#set existing owner/group to rwx chmod ug=rwX -R /some/ftp/directory

#set existing files/folders to rwx for ftpuser setfacl -m u:ftpuser:rwX -R /some/ftp/directory

#set future files/folders to rwx for ftpuser setfacl -dm u:ftpuser:rwX -R /some/ftp/directory

(Note that we set the existing owner and group to rwx because FACLs are limited to the owning group's permissions. There are other ways around this, but the easiest is just ensuring the owning group as rwx)

Links: http://linuxcommando.blogspot.com/2007/12/basic-linux-permission-model-lets-you.html http://retrop.wordpress.com/2012/02/10/enabling-file-acls-in-debian-6-access-control-lists/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.