Managing SMB File Sharing and Windows Interoperability in Oracle Solaris 11.2

Exit Print View

Updated: July 2014
 
 

SMB Autohome Shares

The autohome share feature eliminates the administrative task of defining and maintaining home directory shares for each user that accesses the system through the SMB protocol. The system creates autohome shares when a user logs in, and removes them when the user logs out. This process reduces the administrative effort needed to maintain user accounts, and increases the efficiency of service resources.

For example, if /home is a home directory that contains subdirectories for users bob and sally, you can manually define the shares as follows:

bob

/home/bob

sally

/home/sally

However, defining and maintaining directory shares in this way for each user is inconvenient. Instead, you can use the autohome feature.

To configure the autohome feature, you need to specify autohome share rules. For example, if a user's home directory is /fort/sally, the autohome path is /fort. The temporary share is named sally. Note that the user's home directory name must be the same as the user's login name. See How to Create a Specific Autohome Share Rule.

When a user logs in, the SMB server looks for a subdirectory that matches the user's name based on any rules that have been specified. If the server finds a match and if that share does not already exist, the subdirectory is added as a transient share. When the user logs out, the server removes that transient share.

Some Windows clients log a user out after 15 minutes of inactivity, which results in the autohome share disappearing from the list of defined shares. This behavior is expected for SMB autohome shares. Even after an SMB autohome share is removed, the share reappears when the user attempts to access the system (for example, in an Explorer window).


Note -  If you are using autohome share, you cannot allow other users to access files in your home directory. All autohome shares are removed when the SMB server is restarted.

SMB Autohome Entries

The SMB server can automatically share home directories when an SMB client connects. The autohome map file, /etc/smbautohome, uses the search options and rules to determine whether to share a home directory when an SMB client connects to the server.

For example, the following entries specify the autohome rules for a particular environment:

+nsswitch	    dc=ads,dc=oracle,dc=com,ou=users
jane    /home/?/&    dc=ads,dc=oracle,dc=com,ou=users

The nsswitch autohome entry uses the naming service to match users to home directories. The second autohome entry specifies that the home directory for user jane is /home/j/jane.

SMB Autohome Map Entry Format

A map entry uses the following format:

key location [ container ]
key

Specifies a user name

location

Specifies the fully qualified path for the user's home directory

container

Specifies an optional AD container

An AD container name is specified as a comma-separated list of attribute name-value pairs. The attributes use the LDAP distinguished name (DN) or relative distinguished name (RDN) format.

The DN or RDN must be specified in LDAP format by using the following prefixes:

  • cn= represents the common name.

  • ou= represents the organizational unit.

  • dc= represents the domain component.

cn=, ou=, and dc= are attribute types. For more information about AD container attribute names and values, see the share_smb (1M) man page.

SMB Autohome Map Key Substitution

    The autohome feature supports the following wildcard substitutions for the value of the key field:

  • The ampersand (&) is expanded to the value of the key field for the entry in which it occurs. In the following example, & expands to jane:

    jane /home/&
  • The question mark (?) is expanded to the value of the first character in the key field for the entry in which it occurs. In the following example, the path is expanded to /home/jj/jane:

    jane /home/??/&
Wildcard Rule

When supplied in the key field, the asterisk (*) is recognized as the “catch-all” entry. This type of entry matches any key not previously matched.

For example, the following entry would map any user to a home directory in /home in which the home directory name was the same as the user name:

*    /home/&

Note -  The wildcard rule is applied only if an appropriate rule is not matched by another map entry.
nsswitch Map

The nsswitch map is used to request that the home directory be obtained from a password database, such as the local, NIS, or LDAP database. If an AD path is appended, it is used to publish shares.

+nsswitch

Like the asterisk wildcard entry, the nsswitch map is searched only if an appropriate rule is not matched by another map entry.


Note -  The wildcard and nsswitch rules are mutually exclusive. Do not include an nsswitch rule if a wildcard rule has already been defined.