问题原文
原帖链接 · rdbisme · CC BY-SA 3.0
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_mkdircreate directories over nfs? - if the mounted
homespath is not standard (e.g. homes are mounted to/mnt/nfs/homes), howpam_mkdircan know that? Using ahomeDirectoryLDAP attribute? - Should I instead trigger the creation on the LDAP server after user creation?
- Am I overthinking an actually simpler problem?
已采纳解答
原帖链接 · techieb0y · CC BY-SA 3.0
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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
