I am setting up a web development uBuntu server for multiple users.
The website files are all owned by root and in the group root.
As I was trying to avoid giving parts of the file structure 777 permissions, I tried solving my problem by using user groups with the following lines of code:
user@localhost:~$ sudo groupadd developers user@localhost:~$ grep 'developers' /etc/group user@localhost:~$ sudo usermod -a -G developers user user@localhost:~$ sudo chown -R root:developers test user@localhost:~$ sudo chmod 664 test user@localhost:~$ ll . . . -rw-rw-r-- 1 root developers 0 Oct 10 11:33 test
- I add my "developers" group
- I confirm my developers group exists
- I add an existing user to the new group
- I change the group of a test file from root to developers
- I give the group read and write permissions on the test file
- I list the contents of the directory to confirm the group and permissions have been correctly altered
With all those steps accomiplished, attempts to save the test file are still unsuccessful.
Am I doing something wrong, please?