We currently have a setup (running on Ubuntu 14.04 LTS) with mixed LDAP/NIS authentication and automounted home directories from several servers (with the
auto.home map distributed over NIS). Everything runs smoothly as long as the user logging in (either with NIS or LDAP) already has a home directory somewhere (i.e.,
ls /home/user successfully triggers its mounting).
I wanted to use pam_mkhomedir.so to have local home directories automatically created for people not having a home on the servers (which works fine on normal setups), but of course this could not work (same problem described in this question: LDAP/NFS/PAM/AutoFS : mkhomedir PAM plugin failling), as autofs and pam_mkhomedir could not work together. Any mkdir in
/home actually fails when automounting is enabled there, therefore making a bind mount inside
/home is also not a solution.
Does anybody know a good solution to have local home directories created for uses not having a NFS home, knowing that we have no control over the info coming from the LDAP (i.e., users must have their homes in
/home/username, and autofs is working there), and without hacking into autofs sources? Creating a home on a NFS server at login would be a possibility, but how to do that in a safe way?