Apart of apache group, yet still can't upload to /var/www/

Posted January 27, 2013 25.1k views
I've been ignoring this issue for now by using root in filezilla, but how can i get my other users to make uploads and changes?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
14 answers
If you want to use multiple users to upload to the same directory the best way to do that is to manage it through groups.

You can all add them to the same group and set the directory to group writeable and then set the .umask to also automatically set each file that is uploaded to group writeable as well.

That way all of the users that upload there can all edit/delete each other's files.
The problem is i have them apart of www-data but they still can't upload, www-data also has ownership of all the files.
Does it have group write permissions enabled as well?


Should be the permissions on the directories and the files need:

# chmod -R g+w *

In the directory where you are uploading to.
I'm having the same issue as well.
AH! how did i not notice that! thank you! i used

# sudo chmod -R 775 /var/www/

thank you!
dont forget to umask or stickybit the parent directory as raiyu mentioned. this will avoid future problems where users upload files and the file owner and the group becomes the user and no one else will be able to edit them. umasking will make sure the newly created files will get the www-data as their group.
I'm fairly new to this
chown -R user:group usr/share/nginx/www
chmod -R 775 usr/share/nginx/www

By default when a file is created only the "owner" not the group has write permissions.

If you have multiple users sharing a directory then each user that uploads a file will be the only owner of it so other members of that group will be unable to edit or delete that file.

That is why you setup the umask for the directory which will automatically make each file that is created there writeable by both the owner and the group. Then any other user in the group can delete another user's file or update it.

It really depends on whether or not you want to allow that.
Well at least in my case I'm developing locally. my www directory is set to owner and group being root.
I'm going to change it to www-data like in Apache and I'm going to add my user to the www-data group :P

how do you unmark stuff in linux? :S
I'm fairly new to this :S
If I'm not mistaken just goto the directory where you want to set it and do:

# umask 022

And you should be all set so that all new files created will be group writeable.
Previous 1 2 Next