0

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?

Tak
  • 103
  • 5
  • You should try to manually mount the NFS share and start troubleshooting there. If the */home/users* directory is different on each client, then the folders are created on login by *pam_mkhomedir* or similar. – Thomas Jul 20 '18 at 16:36
  • Does `mount` on the client show the server as having been mounted? – 84104 Jul 20 '18 at 21:57
  • @84104 no it doesn’t show – Tak Jul 20 '18 at 21:58

1 Answers1

1

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.

84104
  • 12,905
  • 6
  • 45
  • 76
  • What do you mean by “intended mountpoint isn’t empty”? – Tak Jul 20 '18 at 22:02
  • The client's mountpoint, i.e. `/home/users` has files/folders in it. It should not. – 84104 Jul 20 '18 at 22:03
  • But why the folders of the users were created in /home/users in the client machines but not in the server machine? Am I missing something? – Tak Jul 24 '18 at 08:13
  • These are the steps I followed to install ldap https://www.dropbox.com/s/76c811vhbskbt1n/LDAP%20steps.docx?dl=0 if you could please advise what I did wrong? – Tak Jul 24 '18 at 08:36
  • @Tak It looks like you never mounted the server on the client. – 84104 Jul 24 '18 at 16:44
  • could you advise me of steps to follow to use autofs instead of nfs? – Tak Jul 25 '18 at 13:18