[Gllug] Group directories and Samba shares

Mike Brodbelt mike at coruscant.demon.co.uk
Wed Nov 28 01:16:02 UTC 2001


On Tue, 2001-11-27 at 22:51, John Edwards wrote:
> Hi
> I'm looking into ways of automating the setting up of Samba shares for 
> shared group areas, and was wondering if anyone has tried this and got 
> any suggestions on how to do it or what to avoid.

<snip>

> The beginnings of a plan:
> 
> *) User and group account information are aquired from the default name 
>    service using getpwent and getgrent (probably using Perl). We can not 
>    assume /etc/passwd and /etc/group.
> 
> *) User home directories stay in /home/$USERNAME (mainly private files).
>    Samba will automatically share this, and it's mounted by a login script.
> 
> *) Group shared directories in /home/SHARED/$GROUPNAME, and chmod 2775 
>    so that all files are always group-writable by the group. System groups 
>    and private groups belonging to a user account would not be included.

Can't you achieve this with just:-

[group]
        comment = Shared Group directories
        path = /home/SHARED/%G/
        writeable = Yes

Not as extensible as you're asking, as it'll just share a directory
named after the primary group, but you can then place symlinks to real
directories within that.

So, for a user with username "joeuser", and primary group "joeuser",
who's a member of "staff", "sales", and "marketing", he just maps a
drive letter to \\server\group, which maps to /home/shared/joeuser. In
/home/shared/joeuser, there are symlinks to /home/realgroups/sales,
/home/realgroups/marketing ... you get the idea.

Should take all of 5 minutes to write a Perl script that'll get the
group memberships for each user, and create appropriate symlinks.
Whenever you change group memberships, you just rerun the script.

Mike.



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list