1

My current situation is that I can successfully authenticate using ldap and pam, I also succeeded to use pam_mkdir to autocreate home directories in the /home filesystem.

What now I'm trying to achieve is to autocreate the same home directories but on an automounted nfs export. The automount works correctly and the homes root is correctly reachable. The aim is to avoid to create homes on the nfs manually.

I spent last two days lurking around, but I did not succeed to merge all the informations together.

The questions I still have:

  • could pam_mkdir create directories over nfs?
  • if the mounted homes path is not standard (e.g. homes are mounted to /mnt/nfs/homes), how pam_mkdir can know that? Using a homeDirectory LDAP attribute?
  • Should I instead trigger the creation on the LDAP server after user creation?
  • Am I overthinking an actually simpler problem?
1
  • I use mounting of the home directory on /etc/fstab. I mount to /mnt/home. I create a symlink /home -> /mnt/home. The OS stays with its default and looks in /home for user profile. As you know, it's really getting it from /mnt/home which is really server:/homedrive. Having said all that, I cannot convince mine to make homedrive on the network either. I'm fairly certain it's the local root not having permissions on the nfs server. But I'm in the middle of a project and have not been able to research further.
    – Jeter-work
    Aug 26, 2016 at 2:15

1 Answer 1

3

It's most likely that you're running into an NFS permissions issue. In a standard setup, NFS client machines are not trusted for root access on the NFS server; access by uid=0 is mapped to an unprivileged user (nfsnobody or similar). In order to create the home directory, pam_mkdir (which runs as root) would need to have permissions to the directory in which the user's homedir would be created (generally /home/), and when remapped to nfsnobody, this fails. You could disable this remapping option, but that's generally a bad idea; the better approach is to have a script that walks your LDAP directory and creates missing home directories on the NFS server directly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .