Openldap and nfserver, both work although /home/user cannot be created unless I log into the nfserver first with new ldapusers

Solution 1:

The automatic creation of new home directories is done by root, but by default root is mapped to the anonymous user on nfs mounts and therefore the home directory can't be created on all nfs clients. Add no_root_squash to your line in /etc/exports on your nfs server to disable this and run sudo exportfs -ra for the changes to take effect. So based on your comment it should look like this:

/home 10.10.1.0/24(rw,no_root_squash)

This will allow root access to the mounted nfs filesystem on all clients.

However this has some implications. From the exportfs manpage:

User ID Mapping

nfsd bases its access control to files on the server machine on the uid and gid provided in each NFS RPC request. The normal behavior a user would expect is that she can access her files on the server just as she would on a normal file system. This requires that the same uids and gids are used on the client and the server machine. This is not always true, nor is it always desirable.

Very often, it is not desirable that the root user on a client machine is also treated as root when accessing files on the NFS server. To this end, uid 0 is normally mapped to a different id: the so-called anonymous or nobody uid. This mode of operation (called `root squashing') is the default, and can be turned off with no_root_squash.

By default, exportfs chooses a uid and gid of 65534 for squashed access. These values can also be overridden by the anonuid and anongid options. Finally, you can map all user requests to the anonymous uid by specifying the all_squash option.