OpenLdap synchronize home directory between client and server

Solution 1:

There are two common ways of dealing with a mixture of local and centralized accounts (be it LDAP or NIS or whatever). Your third update covers one of them.

  1. Local accounts use a non-/home base directory for homes
  2. LDAP/central use a non-/home base directory for homes

I commonly use option #1 and create /local then setup my local accounts to have home directories there such as /local/admin, /local/sysadmin, /local/joe, etc. I then use autofs to control mounting of centralized/remote home directories under /home much in the same way you're describing in "Update 3".

I presume your server is exporting home directories with NFS? If manually mounting the NFS export on the client works as expected but autofs does not, your problem is almost certainly your autofs configuration.

For assistance with your autofs problem, please post the contents of /etc/nsswitch.conf, /etc/(open)ldap/ldap.conf, /etc/ldap.conf and /etc/auto.master and /etc/auto.home (or whatever/wherever the relevant autofs configurations are).

Solution 2:

Have you looked at pam_mount? That is what I am currently using although my use case is slightly different than yours. This blogpost gives a fairly good overview of the process, it is geared towards a SAMBA server but if you ignore the samba specific parts it works with NFS (that is what I use) and will work with 10.04. I have not tried on 11.04.