Enhanced AutoFS Administrator's Guide

Configuring and Administering AutoFS
Shortcuts for AutoFS Maps
Chapter 3 51
You can use the ampersand character to represent both the remote
server and the remote subdirectory in the same line of the indirect map.
For example, if users’ home directories are physically located on many
different servers, but the directory under which the home directories are
located is called /export/home/
servername
on all the servers, the
following line in the /etc/auto_home map mounts all users’ home
directories from any server:
* &:/export/home/&
Consider that the home directory of user terry is configured in the
/etc/passwd file as /home/basil/terry. When Terry logs on, AutoFS
mounts the remote directory /export/home/basil from the basil
server on the local directory, /home/basil.
The line with the asterisk and ampersand characters should be the last
line in an indirect map. AutoFS reads the lines in the indirect map
sequentially until it finds a match for the requested local subdirectory.
The asterisk (*) character matches any subdirectory. Therefore, AutoFS
stops reading at the line with the asterisk character because it finds a
match. The lines in the map after the line with the asterisk character are
never read.
Consider the following example:
* basil:/export/home/&
charlie thyme:/export/home/charlie
If the /etc/auto_home map contains the preceding lines, AutoFS
attempts to mount /export/home/charlie from the basil host. The
asterisk character is a match for charlie; therefore, AutoFS does not
read the second line.
Now, consider the following example:
charlie thyme:/export/home/charlie
* basil:/export/home/&
If the /etc/auto_home map contains the preceding lines, AutoFS
mounts Charlie’s home directory from the thyme host and everyone else’s
home directory from the basil host.
For more information on the AutoFS configuration, see the
automount(1M) man page.