Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is somewhat confusing for me so i hope someone can quickly explain the run down once and forall.

I have a User, "John", and group created named "John". I make john a "Primary group members" of group John, and user www-data a member also of group John.

I create /home/john and chown john:john.

files and directories are chmod 755, so it makes sense then that www-data cannot write, which i want it to.

Do i need to chmod everything to 775, or is there a better way to go about this securely?

share|improve this question

2 Answers 2

There are different ways to go:

  1. chmod 775
    If I understood you correctly, the user www-data is part of the group john. So in this setting this user can also write to your directories.
  2. chown www-data
    You can also transfer the ownership of your directories to www-data. Now obviously www-data can write. However in this setting the user john can't write.
  3. Use POSIX ACLs
    ACL stands for access control list. Using this mechanism you can give additional users additional rights, i.e. write for www-data. See this answer for a description: How to make a directory with permanent permissions different from default
share|improve this answer

I think 755 is appropriate permission if you don't want other group members to write to that area and read only, but if you really want groups to write should use 775.

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.