LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   ldap+nfs+autofs for centralized storage of home directories (http://www.linuxquestions.org/questions/linux-server-73/ldap-nfs-autofs-for-centralized-storage-of-home-directories-789082/)

Blue_Ice 02-14-2010 03:18 PM

ldap+nfs+autofs for centralized storage of home directories
 
Hi all,

Does anyone have experience with setting up OpenLDAP with NFS and AutoFS regarding to the storage of home directories?
When I googled I got some information, but I have the feeling that most of them are incomplete or maybe even incorrect. So I wonder if someone can help me setting it up.
I already have an NFS share setup for it. Created an ldif file based on some howto's found by google. And finally OpenLDAP is setup and running supporting Samba domain logon and linux client logon.

Code:

# /etc/exports

/opt/nfs/home  10.0.0.0/8(rw)

Code:

# autofs.ldif

dn: ou=auto.master,dc=hulshoff,dc=home
objectClass: top
objectClass: automountMap
ou: auto.master

dn: cn=/home,ou=auto.master,dc=hulshoff,dc=home
objectClass: top
objectClass: automount
automountInformation: ldap:ldap.hulshoff.home:ou=auto.home,dc=hulshoff,dc=home
cn: /home

dn: ou=auto.home,dc=hulshoff,dc=home
objectClass: top
objectClass: automountMap
ou: auto.home

dn: cn=/,ou=auto.home,dc=hulshoff,dc=home
objectClass: automount
cn: Administrator
automountinformation: -rsize=8192,wsize=8192,intr server.hulshoff.home:/opt/nfs/home/&
cn: /

Code:

dn: uid=Administrator,ou=users,dc=hulshoff,dc=home
objectClass: account
objectClass: posixAccount
objectClass: sambaSamAccount
objectClass: shadowAccount
uid: Administrator
cn: Administrator
displayName: Administrator
uidNumber: 50000
sambaSID: S-1-5-21-960022806-<hidden>
sambaPasswordHistory: 00000000000000000000000000000000000000000000000000000000
 00000000
sambaAcctFlags: [U          ]
loginShell: /bin/bash
gidNumber: 50001
sambaLMPassword: <password>
sambaNTPassword: <password>
sambaPwdLastSet: 1265359113
gecos: Administrator
shadowWarning: 7
shadowMax: 99999
userPassword:: <password>
shadowFlag: 0
shadowLastChange: 14615
ou: users
homeDirectory: /home/Administrator

TIA,
Arjan

Blue_Ice 02-15-2010 08:21 AM

Fixed it myself...

I changed /etc/sysconf/autofs, which I shouldn't have done. Further more I had to change /etc/autofs_ldap_auth.conf and set usetls="yes".
And last but not least the ldif file should look like:
Code:

dn: nisMapName=auto.master,dc=hulshoff,dc=home
objectClass: top
objectClass: nisMap
nisMapName: auto.master

dn: cn=/home,nisMapName=auto.master,dc=hulshoff,dc=home
objectClass: nisObject
cn: /home
nisMapEntry: ldap:ldap.hulshoff.home:nisMapName=auto.home,dc=hulshoff,dc=home
nisMapName: auto.master

dn: nisMapName=auto.home,dc=hulshoff,dc=home
objectClass: top
objectClass: nisMap
nisMapName: auto.home

dn: cn=/,nisMapName=auto.home,dc=hulshoff,dc=home
objectClass: nisObject
cn: /
nisMapEntry: -fstype=nfs server.hulshoff.home:/opt/nfs/home/&
nisMapName: auto.home

One thing I haven't tried yet is to change the location where the client will expect to find the home directory. Currently I am not going to worry about that. For this I probably need to change the dn: cn=/home,nisMapName=auto.master,dc=hulshoff,dc=home and the attribute homeDirectory of the ldap account should probably also changed to the new location.

Going to test that later on.


All times are GMT -5. The time now is 03:44 AM.