I'm trying to wrap my head around file permissions on a Samba share and the following puzzles me why both user1 and user2 can delete each others files even though they don't seem to have the permission to do so. This is what those files look like on the ubuntu machine running the samba server:
-rwxr--r-- 1 user1 private 0 okt 8 00:43 'test file user1.txt'*
-rwxr--r-- 1 user2 private 0 okt 8 00:06 'test file user2.txt'*
In case it somehow matters, both user1
and user2
are members of private
. Both users are accessing the share via their respective windows machines, first creating their respective file, then deleting each others files.
In the smb.conf
this share is configured as follows:
[Together]
path = /srv/together
browseable = yes
read only = no
writable = yes
create mask = 0755
directory mask = 0755
valid users = @private
force group = private
My best guess is that the valid users
parameter is much more powerful that I thought, basically elevating all members of the group to the status of owner. Is this so?
Edit: (in response to the comments)
The parent directory has the following permissions:
drwxrwx--- 19 root private 44 okt 8 00:58 together/
So I guess that this is what warrants the deletions. I guess I need to do a crash course in linux file permissions. It would never have occurred to me that deletion is not simply a special kind of edit... So does this mean that if the users had tried to edit the files, they would not have been able even though deletion worked fine?
The hint at the sticky bit t
is also helpful. Thanks.
As for extended ACL support: yes it is on (apparently by default) but I can't quite seem to grasp what that means for my "problem" (if we assume for a minute that the parent directory permissions didn't explain things). Would extended ACL have to be on or off to create the kind of behaviour I'm seeing?