How to Add an Automounter Entry for an SMB Share
You can add an SMB share to an automount map, such as the /etc/auto_direct file, so that the share will be automatically mounted when a user accesses the mount point. You cannot add these automount entries to the /etc/auto_master file.
                  
To successfully use the automount feature without the need to specify a password, you must store a persistent password to mount the share. See Storing SMB Persistent Passwords.
Caution:
When a user mounts a remote SMB share by usingsmbfs, all accesses through that mount, even by other users, are as the user who established the mount. For shares that will be used only by the owner, you should restrict access to the share by using the dirperms mount option to ensure that only the owner can access the share.
                  Example 4-2 Editing the automounter map
The following examples show the changes to the automount map, in this example the /etc/auto_direct file, to configure automount maps.
                  
- 
                        
To configure a private automount (a share that will only be accessed by the owner) of the
//solarsystem/testshare on the/sam-testmount point, create the following entry in the/etc/auto_directfile:/sam-test -fstype=smbfs,dirperms=0700,uid=sam //solarsystem/test
The
dirperms=0700mount option ensures that only the owner can access the share. Theuid=sammount option ensures that the share root and everything in the share is owned by usersam. - 
                        
To configure a public automount of the
//solarsystem/publicshare on the/PUBLICmount point, create the following entry in the/etc/auto_directfile:/PUBLIC -fstype=smbfs,dirperms=0555 //solarsystem/public
The
dirperms=0555mount option ensures that everyone has read and execute access to the share. - 
                        
To configure a public automount of a share that can be accessed anonymously, which does not require a password, specify the
nopromptoption:/PUBLIC -noprompt,fstype=smbfs,dirperms=0555 //solarsystem/public
The
nopromptmount option suppresses the prompting for a password when mounting the share. Thedirperms=0555mount option ensures that everyone has read and execute access to the share.