Categories
Linux Mastering Development

Why is public read and execute required for my script to work?

I have a php page that executes as script. The script is run by the user www-data. The script is very simply and only copies some files and checks the size using du -h. It all works but only if I put chmod 775 on the directory. I do not understand why public needs access.

Dir

drwxrwsr-x   8 myuser    logging

Group

www-data : www-data logging

If I change the owner to www-data then chmod 700 (as expected) is sufficient. However I have multiple users that need to be able to read/write/del files in that folder hence I thought creating the logging group and add all users that need access to the folder to that group would work.

How come public is required even though the group already has rwx?

Leave a Reply

Your email address will not be published. Required fields are marked *