I need the directory /var/www/ (and everything inside it) to be modifiable by only authorized users.
The way I tried to do this was:
sudo groupadd webmasters sudo usermod -G webmasters pi # My user is pi sudo chown -R root:webmasters /var/www/ sudo chmod -R ug+rw /var/www/ ...but I can't modify anything in /var/www/, nor can I create new files in it.
What am I doing wrong? How do I set this up the way it needs to be?
What I'm envisioning is:
- Everyone in the group
webmasterscan create, delete, and edit files in/var/www/ - All newly-created files/folders are owned by
root:webmasters - All newly created files have permissions 775:
-rwxrwxr-x - Is is vital that no one without authorization be able to have write permissions, OR any sort of Setuid/Setgid ability. (Authorization for write access can only be granted by Root.)
Am I taking the wrong approach to this? Do I have the right idea, but I'm just messing something up? What's going wrong?
getent group webmastersiswebmasters:x:1005:pi, so I know I'm in the group.../etc/groupsafter a process has been created and initialized.