There is a special section for home directories.
http://samba.org/samba/docs/man/manp...mb.conf.5.html
The [homes] section
If a section called [homes] is included in the configuration file, services connecting clients to their home directories can be created on the fly by the server.
When the connection request is made, the existing sections are scanned. If a match is found, it is used. If no match is found, the requested section name is treated as a username and looked up in the local password file. If the name exists and the correct password has been given, a share is created by cloning the [homes] section.
Some modifications are then made to the newly created share:
- The share name is changed from homes to the located username.
- If no path was given, the path is set to the user's home directory.
If you decide to use a
path = line in your [homes] section, it may be useful to use the %S macro. For example:
path = /data/pchome/%S is useful if you have different home directories for your PCs than for UNIX access.
This is a fast and simple way to give a large number of clients access to their home directories with a minimum of fuss.
A similar process occurs if the requested section name is “homes”, except that the share name is not changed to that of the requesting user. This method of using the [homes] section works well if different users share a client PC.
The [homes] section can specify all the parameters a normal service section can specify, though some make more sense than others. The following is a typical and suitable [homes] section:
[homes] read only = no
An important point is that if guest access is specified in the [homes] section, all home directories will be visible to all clients
without a password. In the very unlikely event that this is actually desirable, it is wise to also specify
read only access.
The
browseable flag for auto home directories will be inherited from the global browseable flag, not the [homes] browseable flag. This is useful as it means setting
browseable = no in the [homes] section will hide the [homes] share but make any auto home directories visible.