Sorry for the second newbie question, I’m a developer not a sysadmin so this is all quite new to me. I hope I can explain myself clearly! Here goes.
Here’s what I did:
-
Logged into the root account
-
Created the accounts ‘richard’ and ‘austin’
-
Created the group ‘developers’, and added ‘richard’ and ‘austin’ to it
-
Created the directory /server, and used ‘chown richard:developers /server’ to change the owner
-
Changed the permissions of /server to drwxrwxr-x (so the group can write to it)
-
Logged out of the root account, and into the ‘richard’ account
-
Created the directories /server/production and /server/staging
-
Used ‘ls -l’ inside /server to list the contents, and found permissions of drwxr-xr-x and ownership of ‘richard:richard’ for both /server/production and /server/staging. Consequently, ‘austin’ can edit inside the /server directory, but not inside the directories ‘richard’ created.
What am I doing wrong? I want to ensure that any files or folders created inside the /server directory have group write permissions and belong to the developers group. How do I go about that?
Thanks for any help!
Looks like you want to use ‘chmod g+s’ or ‘chmode 2775’ to get the SetGID bit set on the directory, that should preserve the group if I remember my permission modes properly.