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.

My www files is located at ~/www, and I change the owners of the files to myuser:www-data.

However, when I create new file by the user, it doesn't get the group (www-data) by his owner.

How can I define that every file who will create in ~/www will owned by myuser:www-data automatically?

share|improve this question
add comment

1 Answer

Since you only need to change the default group ownership, set the 'setgid' bit (g+s) on your ~/www directory.

It's not possible to change the default user ownership, however.

share|improve this answer
    
I'd have to disagree on the defalt user ownership, but it is more compilcated, you'd have to delve into the world of ACLs in Linux and UNIX which are not commonly used. –  mdpc Feb 1 '13 at 3:10
    
@mdpc: POSIX ACLs can only set default permissions, not user/group ownership. –  grawity Feb 1 '13 at 10:32
add comment

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.