[Date Prev][Date Next] [Chronological] [Thread] [Top]

Linux Autofs + LDAP



This is in response to many requests for help in getting the Linux Autofs to 
work with Openldap.  In my experience, this is what I did to get everything 
working just fine on Redhat 7.1 with a lot of help from Nalin at Redhat.  
Nalin, if I am wrong on any of this please correct me.  Also if anyone has 
comments on this, please let me know.  I'd like to publish this somewhere for 
all to use.

There are two ways to use ldap with autofs. One way is to use a 
/etc/auto.master file, and the other is to put the auto.master in the LDAP 
tree.

=========================================================
/etc/auto.master (nsswitch.conf is automounter: files )

/home  ldap:hostname.domain.com:ou=auto.home,dc=mydom,dc=com 

When the automounter starts, it will parse the nsswitch.conf file.  Since our 
entry contains files first, it will and search for a /etc/auto.master file.  
In the above entry, the automounter knows the /home entry is ldap, and will 
query the ldap server under the specified base dn for cn entries in the 
ou=auto.home.

dn: ou=auto.home, dc=mydom,dc=com
ou: auto.home
objectClass: top
objectClass: organizationalUnit

dn: cn=user1,ou=auto.home, dc=mydom,dc=com
objectClass: automount
automountInformation: -rw,hard,intr host:/export/home/user1
cn: user1
=========================================================

=========================================================
Openldap auto.master (nsswitch.conf is automounter: ldap there is no 
/etc/auto.master file)

Sample ldif for auto.master and auto.home entries

dn: ou=auto.master, dc=mydom,dc=com
ou: auto.master
objectClass: top
objectClass: automountMap

dn: cn=/home,ou=auto.master, dc=mydom,dc=com
objectClass: automount
automountInformation: ldap:host.mydom.com:ou=auto.home,dc=mydom,dc=co
 m --timeout 60
cn: /home

dn: ou=auto.home, dc=mydom,dc=com
ou: auto.home
objectClass: top
objectClass: organizationalUnit

dn: cn=user1,ou=auto.home, dc=mydom,dc=com
objectClass: automount
automountInformation: -rw,hard,intr host:/export/home/user1
cn: user1

In this senario, when the automounter starts, it will parse the nsswitch.conf 
file.  Since our entry contains ldap it will search the base dn specified in 
the /etc/ldap.conf file for the objectClass: automount with the 
ou=auto.master and use the automountinformation entry as a pointer to rest of 
the mount information as in the sample ldif above.  
========================================================

Now, as for other automounters, these entries only work with the Linux 
automounter. Sun and the rest of the world use the nisMap and nisObject 
schema and ou=auto_home instead of auto.home.   Now we have just duplicated 
all of our entries in the ldap tree according to the OS.  Oh man...  But, 
Nalin mentioned some compatibility in the future from his last message to me.

Anyway, there is a bug in the Solaris automounter (Sun Bug ID 4379906) that 
prevents it from working with OpenLDAP.  If someone would like sample ldif 
entries for the Solaris automounter, I can post those also on a different 
post explaining the bug and how it should work.  The fact is right now though 
is that it doesn't, at all.  I haven't tested the HP-UX or AIX automounters.  
If anyone has information on these, I would like to know if anyone got these 
to work with OpenLDAP.  My access to those hardware platforms has gone away 
for now.

Good luck,
Brian Wert