Indirect Autofs Maps

An indirect map uses a substitution value of a key to establish the association between a mount point on the client and a directory on the server. Indirect maps are useful for accessing specific file systems, such as home directories. The auto_home map is an example of an indirect map.

Lines in indirect maps have the following general syntax:

key [mount-options] location
key

Name without slashes in an indirect map.

mount-options

Options that you want to apply to this particular mount. These options are required only if the options differ from the map default. Options for each specific type of file system are listed in the mount man page for that file system. For example, see the mount_nfs(8) man page for NFS-specific mount options.

location

Location of the file system. One or more file systems are specified as server:pathname.

Note:

The path name should not include an automounted mount point. The path name should be the actual absolute path to the file system. For instance, the location of a directory should be listed as server:/usr/local, not as server:/net/server/usr/local.

As in the master map, a line that begins with # is a comment. All the text that follows until the end of the line is ignored. Put a backslash (\) at the end of the line to split long lines into shorter ones. Sample /etc/auto_master File shows an auto_master map that contains the following entry:

/home      auto_home        -nobrowse    

auto_home is the name of the indirect map that contains the entries to be mounted under /home. A typical auto_home map might contain the following:

user1                  server1:/export/home/user1
user2                  server2:/export/home/user2
user3                  server3:/export/home/user3
user4                  server4:/export/home/user4
user5                  server5:/export/home/user5
user6                  server6:/export/home/user6
user7    -rw,nosuid    server7:/export/home/user7

As an example, assume that the previous map is on host master-server. Suppose that the user user7 has an entry in the password database that specifies her home directory as /home/user7. Whenever user7 logs in to computer master-server, autofs mounts the directory /export/home/user7 that resides on the computer server7. Her home directory is mounted read-write, nosuid.

Assume the following conditions occur: User user7's home directory is listed in the password database as /home/user7. Anybody, including user7, has access to this path from any computer that is set up with the master map referring to the auto_home map.

Under these conditions, user user7 can run login or ssh on any of these computers and have the home directory mounted in place.

Furthermore, now user7 can also type the following command:

# cd ~user1

Autofs mounts user1's home directory for user7 (if all permissions allow).

Note:

No concatenation of options occurs between the automounter maps. Any options that are added to an automounter map override all options that are listed in maps that are searched earlier. For instance, options that are included in the auto_master map are overridden by corresponding entries in any other map.

On a network without a name service, you have to change all the relevant files (such as /etc/passwd) on all systems on the network to allow Linda access to her files. With NIS, make the changes on the NIS master server and propagate the relevant databases to the slave servers.