I need to grant users in a group to delete the directory and files inside the directory. I have added all the users to group named "fileHandlers". I want all users in this group to have permission to create files or folders and delete them.
drwxr-sr-x 2 www-data fileHandlers 4096 Nov 26 13:13 7005C0FA85E4A0B445E77C126EEB8056
In the above example only www-data is able to delete this files. how can i extend it for all the users in group "fileHandlers"
2 Answers 2
You need to give the users (i.e., the group) write permission to the directory:
chmod g+w dirnameFor them to be able to delete the directory itself, they need write permission to the parent directory.
fixed the problem with following commands
chgrp -R fileHandlers attachments/
chmod -R g+w attachments/
find attachments -type d -exec chmod 2775 {} \;
find attachments -type f -exec chmod ug+rw {} \;
chmod -R g+w whatever