this is a strange issue I've been struggling with some time now. I have a working ldap and authentication via pam on debian 8. I have successful tested pam_mkhomedir and I got a home directory for the logged in user with ownership username:groupname.
In the second phase of the project I created an nfs (nfsv4) mount on /home/nfs I want to put my home dirs there so I can share them across servers. The problem I face is when I use pam_mkhomdir to create the home dir it has ownership nobody:nogroup. If I create this manually logged in as an ldap user I get the correct ownership username:groupname so I am fairly sure nfs can deal with the ldap usernames.
idmap is configured to use nsswitch and
id ldapuser
returns the same info on both the nfs client and server. Also ldap login works on both of them
does anyone have an idea as to why pam_mkhomdir would default to nobody:nogroup while nfs works with ldap users?
pam_mkhomedir is running with root privileges and the NFS share is probably not exported with the
no_root_squash
option, so the root user gets mapped to NFS nobody.