[Samba] Sharing "other" home directories

Raymond Wan rwan.work at gmail.com
Fri Aug 16 06:09:54 MDT 2013


Dear all,

I'm new to Samba and am trying to set it up on an Ubuntu 12.04 system using
version 3.6.3 .  Thanks to some great documentation, I actually have it
*working* as I had intended.  However, there is something puzzling me which
I cannot figure out from any of the documentation I've seen (so far).

What I would like to do is to share 3 different sets of folders:

* home directories
* home-like directories -- a path where there are directories, one for each
user, inside
* a group directory -- for all users of a Unix group

This is what I have:

[homes]
    comment = Home Directories
    browseable = no
    writeable = yes
    create mask = 0700
    directory mask = 0700
    valid users = %S
;    guest ok = no

[home2]
    comment = Secondary Home Directories
    path = /share/home2
    browseable = no
    writeable = yes
    create mask = 0700
    directory mask = 0700
    valid users = user1 user2
;    guest ok = no

[accounting]
    comment = Account group
    path = /share/accounting
    browseable = no
    writeable = yes
    create mask = 0770
    directory mask = 0770
    valid users = @accounting


And surprisingly, it works!  But, I'm not sure why...and would like to
understand why it is working and more importantly, is it a fluke that will
go away in a few days.

I understand "[homes]" is special and when Samba sees it, it looks for user
accounts inside that directory.

But for both [homes2] and [accounting], I've given paths in two different
ways.  The first, it is the path one-level up from what I want to share
(i.e., because I want it treated like a "home" directory).  But with the
second, I want to share /share/accounting and not /share/accounting/user1,
etc.

Somehow, it seems to work as I'd like it.  Is there a reason why this
works?  The alternative which I wanted to avoid was for [homes2], I'd have
to create one entry for each user on the system.  So, I'm very happy it
works...just wondering why and if it is by some luck...  :-)

Thank you!

Ray


More information about the samba mailing list