AutoFS 5 and LDAP   4 comments

[edited 04-jun-08] – A useful post on AutoFS and OSX over here.

Coworker Dave gets all the credit for figuring this out:

AutoFS in LDAP

Changes in autofs4 made it possible to store automount maps inside LDAP, rather than storing maps in the filesystem that pointed to LDAP for the entries. It appears that in autofs5 if you have entries in LDAP for automount maps, the maps themselves must also be in LDAP (at least, this seems like the default behavior and there is no documentation describing how to override the default).

Which LDAP server?

This information is stored in /etc/openldap/ldap.conf — the default hostname, base, and search type for command-line requests; i.e., via ldapsearch.

Data in LDAP

To find which mountpoints autofs will be handled, it searches LDAP for entries with objectclass automountMap. It then searches all subordinate entries under the resulting list of mountpoints (automountMap entries) with the objectclass automount, each representing a directory to mount.

Each entry under automountMap points to a different branch of the LDAP tree, which stores one entry per automount describing the directory to be mounted. Example autofs map:

automountMap and subtree:

dn: ou=auto.master,ou=Mounts,ou=FOO,o=DOMAIN,c=US
objectClass: top
objectClass: automountMap
ou: auto.master


dn: cn=/home,ou=auto.master,ou=Mounts,ou=FOO,o=DOMAIN,c=US
objectClass: top
objectClass: automount
cn: /home
automountInformation: auto.home

The above instructs autofs that the auto.master map contains the mount point for /home. It also instructs autofs where to find the “map” for which directories will be mounted under /home — the auto.home map.

Let us examine the auto.home automount map:

dn: ou=auto.home,ou=Mounts,ou=FOO,o=DOMAIN,c=US
objectClass: top
objectClass: automountMap
ou: auto.home

dn: cn=user0,ou=auto.home,ou=Mounts,ou=FOO,o=DOMAIN,c=US
objectClass: top
objectClass: automount
cn: user0
automountInformation: filer:/vol/vol1/staff/user0

dn: cn=user1,ou=auto.home,ou=Mounts,ou=FOO,o=DOMAIN,c=US
objectClass: top
objectClass: automount
cn: user1
automountInformation: filer:/vol/vol1/staff/user1

The above constitutes the auto.home map in that all entries are directories that autofs is responsible for in the /home mount point.

Posted April 3, 2007 by padraic2112 in directory service, ldap, software, tech

4 responses to “AutoFS 5 and LDAP

Subscribe to comments with RSS.

  1. Pingback: AutoFS 5 and LDAP « Paranoid Linux Ninja Geek

  2. Pingback: Wednesday, November 5th, 2008 - Best Day « Pat’s Daily Grind

  3. Hi,
    Thanks for the article, not many talk about autofs 5.
    I’m trying to get working an ldap directory for user authentication with autofs for homes.
    Your article raises one doubt, One automount entry per user?

    Thanks a lot!!

  4. Pingback: bschaefe.net » LDAP Deployment on CentOS, with AutoFS and Posix Schema

Leave a comment