[Samba] Breaking up user homes by letter

Marc Muehlfeld samba at marc-muehlfeld.de
Tue Apr 23 04:14:21 MDT 2013


Am 22.04.2013 23:45, schrieb Christopher Horsager:
> Is there a way to have Samba assign home  directory paths by the first
> letter of a username and then the actual username underneath? Like this:
> /Users/j/Johnson

Maybe I understand you wrong, but you don't really need to do anything 
special in samba for that.

Depending on your samba installation, the path on your unix server, 
where the homes are located, is defined in AD (unixHomeDirectory), 
openLDAP, passwd or whereever. In your smb.conf, you don't need a 'path' 
parameter for the 'homes' share:

    read only = No
    browseable = No
    valid users = %S

See 'man smb.conf' for 'The [homes] section':
   If no path was given, the path is set to the user's home directory.

So samba set the 'path' parameter for every user in that share to the 
one, that is defined in the backend.

> If I can, is there a way for Samba to also still direct the user right into
> that folder if in Windows they were to enter \\sbmserver\username
> <file:///\\sbmserver\username> ?

If you have a '[homes]' share, then you automatically having a 
\\smbserver\username share, pointing for every user it's unixHomeDirectory.

 > I'm just trying to separate out the home directories as this may
 > possibly be used by 1000+ at once and I'm worried about performance
 > having all the homes in one directory.

You also can create a share with 'path = /home' and point the users home 
folder to '\\smbserver\x\%USERNAME%'. This you can change with a small 

If you ment something else, then please provide some more information 
about your environment (samba version, AD/NT4 environment, userbackend, 
DC/member server, etc.).


More information about the samba mailing list