Install autodir by entering the following commands in the terminal:
sudo apt update sudo apt install autodir
Automatically creates home and group directories for LDAP/NIS/SQL/local accounts
A modular and thread-enabled tool to create and/or mounting and managing automagically and transparently user/group home directories, on demand. . It can work with any authentication framework (e.g. system files, NIS, LDAP or SQL) and does not require PAM, which is a required feature for session-less service such as smtp servers. . Automounter version 4 (autofs4) has to be enabled when compiling the kernel. Debian packaged kernels have it enabled as module.