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

RE: Purely LDAP-based Automounts



Michael,

This isn't "exactly" OpenLDAP specific, but there aren't many other useful
forums to discuss it...

I quit using RH's version of autofs some time ago, but I'll try to relate as
much as I can remember about it.  One difference in my setup vs yours is that
I use the nisMap/nisObject objectclasses...it shouldn't make much difference
since RH's autofs should be happy with either one.

My auto.master looks like:
dn: nisMapName=auto.master,dc=example,dc=com
objecClass: top
objectClass: nisMap
nisMapName: auto.master

The /home entry looks like:
dn: cn=/home,nisMapName=auto.master,dc=example,dc=com
objectClass: nisObject
cn: /home
nisMapEntry: ldap:nisMapName=auto.home,dc=example,dc=com
nisMapName: auto.master

My auto.home looks like:
dn: nisMapName=auto.home,dc=example,dc=com
objectClass: top
objectClass: nisMap
nisMapName: auto.home

And an entry out of it looks like:
dn: cn=joeuser,nisMapName=auto.home,dc=example,dc=com
objectClass: nisObject
cn: joeuser
nisMapEntry: -rw,soft,nosuid nfsserver:/path/to/joeuser
nisMapName: auto.home

In order for this to work you need to configure your /etc/openldap/ldap.conf.
AFAIK, RH's autofs package does not use nss_ldap directly for anything,
so verification of a user's account via "getent" or whatever does not
guarantee that your autofs is configured correctly.

You can verify your maps using /usr/lib/autofs/autofs-ldap-auto-master.  Running
it with no arguments will dump what your auto.master looks like.  Give it a 
map name (like auto.home) and it'll dump that map.

-Steve

-----Original Message-----
From: owner-openldap-software@OpenLDAP.org
[mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Michael
Lackner
Sent: Tuesday, February 03, 2004 3:11 AM
To: OpenLDAP-Software@OpenLDAP.org
Subject: Purely LDAP-based Automounts


Hello!

I've got my OpenLDAP Server readily set up on RedHat9 now.  It's OpenLDAP 2.0.27-8.
What I'm now trying to achieve is purely LDAP-based automounting of user's home directories.

I don't want to use /etc/auto.master at all, so i set the automounter to "ldap" in /etc/nsswitch.conf:
####
automount:  ldap
####
auto.master has been renamed to be totally sure of this.

I'm trying to export the following directory, as you will see in my LDIF files:
/etc/exports:
####
/exports/home 193.171.81.0/24(rw,no_root_squash,sync)
####

Manually mounting the directories within /exports/home succeeds.

So, the hairy part seem to be the LDIF files / the data within the directory database. I tried to
test this on my testserver with a user called "testuser" and with user root, using autofs 3.1.7-36.

LDIF Data:
####
dn: ou=auto.master,o=ait,c=com
objectClass: top
objectClass: automountMap
ou: auto.master
####

####
dn: cn=/home,ou=auto.master,o=ait,c=com
objectClass: automount
cn: /home
automountInformation: ldap 193.171.81.222:ou=auto.home,o=ait,c=com
####

####
dn: ou=auto.home,o=ait,c=com
objectClass: top
objectClass: automountMap
ou: auto.home
####

####
dn: cn=test,ou=auto.home,o=ait,c=com
objectClass: automount
cn: test
automountInformation: -fstype=nfs,hard,intr,nodev 193.171.81.222:/exports/home/testuser
####

As you can see, "o=ait,c=com" is the base DN. 193.171.81.222 is the IP of my OpenLDAP
and NFS server.

When i run "service autofs status" on my client, i can see a directory "/home" being configured
for automounting, nothing else, but this isn't what i intended. I want autofs to automount
the directory "test" within "/home" of course ("/home/test" being the homedir of "testuser").

Cannot find my error although i searched the web intensively for two days. Any help is
appreciated, thanks in advance.

MfG,
Michael Lackner
--
Montanuniversität Leoben
Institut für angewandte Mathematik und Geometrie
Abteilung für Informationstechnologie, IT-Administration
michael.lackner@unileoben.ac.at  |  +43 (0)3842/402-1505
http://www.hardoverclock.com | thrawn@hardoverclock.com