In your output I see "NFSHomeDirectory: /home/first.last"
On macOS the attribute NFSHomeDirectory: is the local path to your home (which could be an url for network homes, but usually /Users/first.last) (OS X is not using the LDAP homedir attribute, but you can use that attribute to calculate other attributes with mappings.
Change the mapping for NFShomedir and try again. I would not be surprised that the home will be created at login.
@mjsanders thanks this help, i remove HomeDirectory: /Users/first.last and edit /etc/auto_master and home dir create. I would like to create home dir whitout edit /etc/auto_master
I answered under the assumption you want this:
A local home folder (created from /System/Library/User Template/) for any user from LDAP that log's in to the Mac.
If you want network home folder (similar to windows roaming profiles) enter the url for that in the NFSHomeDir (like afp://server.example.com/Users/first.last)
There are a few more details you need to take into account with using a 'plain' LDAP server, please read the chapter 3 of this book : Mac OS X Directory Services v10.6: A Guide to Open Directory....
by Arek Dreyer,Ben Greisler aviailable in iBooks store , and partly availlable in Google books.
Althoug this book is written for 10.6, this should still work.
I have not edited /etc/auto_master so far, I guess you do not have to edit this to make the network home folder work, but I have not worked with 'plain' LDAP since 10.8, so please investigate.
Network home folders are not promoted by Apple, but they still work. Please stay away from syncronizing a cached local home of a network home (called 'Portable Home Directory' or PHD). It never works without errors, and is removed from macOS Sierra.
I am using an LDAP server but also running into issues creating home directories on first login. Currently this NFSHomeDirectory attribute is default set as : /home/first.last similar to above which causes the login not to work or create a new user home directory based on the local user template folder. If I open directory utility and change that attribute to #/Users/$uid$ it works like a charm. How do I set that attribute in script or on a programatic level so I don't have to touch every machine?
I have the same question as @bkimelman We currently have NFSHomeDirectory set to #/Users/$uid$ and we Screen Share and log in, macOS creates the user's home directory... but we have a fleet of headless Mac Minis and I need to find a way to do this, so that anyone in the department can ssh into a machine and get their home directory created.
I tried:
sudo /usr/sbin/createhomedir -u <username>
But that seemed to literally do nothing, (no home directory created...)
I also tried:
sudo /System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount -n <username>
and it appeared to work, but I was unable to use my ldap password afterwards to login.
I have the same question as @bkimelman We currently have NFSHomeDirectory set to #/Users/$uid$ and we Screen Share and log in, macOS creates the user's home directory... but we have a fleet of headless Mac Minis and I need to find a way to do this, so that anyone in the department can ssh into a machine and get their home directory created.
I tried:
sudo /usr/sbin/createhomedir -u <username>
But that seemed to literally do nothing, (no home directory created...)
I also tried:
sudo /System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount -n <username>
and it appeared to work, but I was unable to use my ldap password afterwards to login.
The createhomedir should be:
sudo /usr/sbin/createhomedir -c -u <username>