[Samba] how to automatically create the home directory

LORANG Geert geert.lorang at hexagon.com
Thu Oct 10 12:14:12 UTC 2019


On 10/10/2019 12:26, Rowland penny via samba wrote:
> There are three ways, depending on how the user connects.
>
> You can manually create a home directory for each user.
>
> If the user actually logs into the unix domain member, you can lever PAM
> to create the home directory the first the user connects
>
> If the user only connects over Samba, then you need to create the users
> home directory with a script. Myself and Louis wrote such a script,
> would you like a copy ?
>
> Rowland

On Debian we have enabled mkhomedir via pam-auth-update, this puts 
following line in /etc/pam.d/common-session-noninteractive:

session required                        pam_mkhomedir.so skel=/etc/skel 
umask=0022

Together with "obey pam restrictions = Yes" in /etc/samba/smb.conf this 
has been working great for us on both Windows, Linux and macOS for many 
years already.

Home directories get automatically created when users first connect to 
the smb share / server.

HTH;

Cheers,
Geert


More information about the samba mailing list