[Samba] Multiple groups accessing subdirectories

Jeremy Allison jra at samba.org
Sat Feb 4 01:08:34 GMT 2006


On Fri, Feb 03, 2006 at 09:12:57AM -0600, lburns1 at mmm.com wrote:
> Hello,
> What I want to do is setup a samba directory that two groups can access,
> however, beneath that main samba directory I want two directories, one that
> is accessed by all of the users who have access and the other limited to a
> certain group of users.
> 
> If you could provide any help on this, I would really appreciate it.
> Thanks.

Do this with POSIX ACLs.

On the main directory, set permissions as follows :

owner: <not important>
group: group1: rwx
group: group2: rwx
other: --- (no access)

Make the first directory have identical permissions to the
main directory, for the second directory, simply make the
owning group the group you want to have access, and give
them appropriate permissions.

To make sure smbd creates files and directories in these
areas with the correct permissions, firstly set the SGID
bit on these directories to get BSD semantics (created
files and directories have the same group owner as their
containing directory) and then set the following smb.conf
options for that share :

inherit acls = yes
inherit owner = yes

That will keep the user and group ownerships in those
directories constant no matter who edits the files.

Jeremy.


More information about the samba mailing list