NFS Services Administrator's Guide
Configuring and Administering NFS
Configuring and Administering the NFS Automounter
Chapter 2 79
# /etc/auto_master file
# local mount point map name mount options
/home /etc/auto_home -nosuid
Following is the line from the automounter indirect map
/etc/auto.home that mounts users’ home directories on demand.
# /etc/auto_home file
# local mount point mount options remote
server:directory
* basil:/home/&
A user’s home directory is configured in the /etc/passwd file as
/home/username. For example, the home directory of user terry is
/home/terry. When Terry logs in, the automounter looks in the
/etc/auto_home map and substitutes terry for both the asterisk and
the ampersand. The automounter then mounts Terry’s home directory
from /home/terry on server basil to /home/terry on the local NFS
client.
The ampersand character can be used 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 /home/servername on all the servers, the following line
in the /etc/auto_home map will mount all users’ home directories from
any server:
* &:/home/&
If the home directory of user terry is configured in the /etc/passwd file
as /home/basil/terry, when Terry logs in, the automounter will mount
the remote directory /home/basil from server basil on the local
directory /home/basil.
The line with the asterisk and ampersand should be the last line in an
indirect map. The automounter reads the lines in the indirect map
sequentially until it finds a match for the requested local subdirectory.
The asterisk (*) matches any subdirectory, so the automounter stops
reading at the line with the asterisk, because it has found a match. Any
lines after the asterisk are never read.
For example, if the /etc/auto_home map contains the following lines,
* basil:/home/&
charlie thyme:/home/charlie