Objective: Creating a folder on the root, chown to group and add users to group - but users get too wide permissions!
Consider the following:
# as root
we need a user group
groupadd team1
we need a shared folder
mkdir /project1
chown root:team1 /project1
chmod 770 /project1
we need users - and they get set pw elsewhere :)
for i in bob tina jim joy; do useradd $i; done
we add them to the project group 'team1' that gives access to the shared folder
usermod -aG team1 [username]
What is puzzling is that user jim
can create a file in /project1
and user joy
can open, change and save the file in vim or try to delete the file, which will be executed after confirmation that this is the intent.
Question: Is this to be considered correct behaviour? Shouldn't chmod 770 /project1
be limited to permissions on the folder itself, but not as it appears: recursively to files within said folder?