Ldap – Automount LDAP home folders in client machines

automountldapmountnfsopenldap

I have created couple of users on my ldap, and setup a couple of ubuntu ldap client machines, where users can login with their accounts. I now want to share their home folders and make it centralised in all the client machines. Below are the steps I did:

On the LDAP server machine

  1. I installed the nfs server package:

    apt-get install nfs-kernel-server

  2. On my ldap server the home folders are saved in /home/users folder, so I created a folder on the machine server and named it /home/users

  3. I modified /etc/exports to export home directories on LDAP server to client by adding this line:

    /home/users *(rw,no_root_squash,no_subtree_check,no_wdelay,sync)

On the LDAP client machine

  1. I install the client nfs software:

    apt-get install nfs-common

  2. I created a folder and named it /home/users to match the ones of the ldap server and server machine

  3. I modified /etc/fstab and added the below to make it mounted automatically:

    192.168.1.10:/home/users /home/users nfs _netdev,auto,hard,intr 0 4

I restarted the machines (both server and clients) to see the effect, but still the home directory of the users are not synchronised, they are totally separate, like on the server machines there is nothing in the /home/users directory, but in the client machines there are folders with the user names in /home/users but they don't have the same data.

I wonder how to make the home folders of my users centralised so that updates are synched across the machines? So that when a user logins in with his account from any machine he can see that his home folder is the same and that his files and folders are there. Any advice please?

Best Answer

Your client is not mounting the server because its intended mountpoint isn't empty.

After you empty the mountpoint, perhaps by moving its contents to the correct location on the server, it should work as intended.


Long term, esp. if you have more than one file server, it's best to use autofs. I use sssd-ldap for these things, it seems like it might also be decent fit for you.