Giving two different users permissions to a dir
- by Jason Swett
I have a script that is run sometimes via the web, sometimes via the command line. When the script is run via web, it's run via user www-data. When it's run via command line, it's run via user jason.
This script writes to a directory called cache.
If I chown -R jason cache, I can run the script as jason but not www-data. This makes sense.
If I chown -R www-data cache, I can run the script as www-data but not jason. This also makes sense.
I tried creating a group called scripts, adding my two users, then chowning cache to scripts. I'm not really sure how to do the last part, the chowning part. The Linux command docs I've found online for this are astoundingly bad.
I don't know if I explained this all that well but hopefully it's clear what I'm trying to do. Any advice would be appreciated.