If a client attempts to connect to a share that doesn't appear in the
smb.conf file, Samba will search for a
[homes]
share in the configuration file. If one exists, the unidentified share name is assumed to be a Unix username, which is queried in the password database of the Samba server. If that username appears, Samba assumes the client is a Unix user trying to connect to his or her home directory on the server.
For example, assume a client machine is connecting to the Samba server
hydra
for the first time, and tries to connect to a share named [
alice]
. There is no
[alice]
share defined in the
smb.conf file, but there is a
[homes]
, so Samba searches the password database file and finds an
alice
user account is present on the system. Samba then checks the password provided by the client against user
alice
's Unix password - either with the password database file if it's using non-encrypted passwords, or Samba's
smbpasswd file if encrypted passwords are in use. If the passwords match, then Samba knows it has guessed right: the user
alice
is trying to connect to her home directory. Samba will then create a share called
[alice]
for her.
The process of using the
[homes]
section to create users (and dealing with their passwords) is discussed in more detail in the Chapter 6,
Users, Security, and Domains .