[Samba] Fw: Home directory is not created

Rowland Penny rpenny at samba.org
Thu May 31 09:13:16 UTC 2018

On Thu, 31 May 2018 08:25:52 +0000
Suman Koirala <koiralasu at mnstate.edu> wrote:

> I am using ubuntu 18.04
> and samba Version 4.7.6-Ubuntu
> I am able to login using domain credentials but not being able to get
> the script executed to make the home directory.

I am very surprised that it works, you do not use the winbind ldap
backend on a Unix domain member.

Try this smb.conf:

## Browsing/Identification ###
   # set to act as domain member in an ADS realm
   realm = EXAMPLE.NET
   workgroup = DOMAIN
   security = ads

#### Debugging/Accounting ####
   # use a separate log file for each machine that connects
   log file = /var/log/samba/log.%m
   # Cap the size of the individual log files (in KiB).
   max log size = 1000
   # nothing is logged through syslog, but sent to /var/log/samba/log.{smbd,nmbd} instead
   syslog = 0
   # Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d

   # Winbind configuration
   idmap config * : backend = tdb
   idmap config * : range = 3000-7999
   # seeing as you were trying to get data from ldap, I think you must have
   # uidNumber & gidNumber attributes in AD
   # If so use the next four lines.
   idmap config DOMAIN : backend = ad
   idmap config DOMAIN : unix_nss_info = yes
   idmap config DOMAIN : schema_mode = rfc2307
   idmap config DOMAIN : range = 10000-999999
   # If you haven't got uidNumber & gidNumber attributes in AD, comment the
   # four lines above and uncomment the next two lines.
   #idmap config DOMAIN : backend = rid
   #idmap config DOMAIN : range = 10000-999999

   winbind separator = +

   # this option will remove 'DOMAIN\' from user & group names
   # but must not be used if multiple domains are used
   winbind use default domain = yes
   template homedir = /home/remote/%U
   template shell = /bin/bash
   domain master = no
   local master = no
   preferred master = no
   usershare allow guests = no

Please read the comments around the 'idmap config' lines.

Do not bother with a script to create the homedirs, let PAM do it for
you. Add this line to the end of /etc/pam.d/common-session

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


More information about the samba mailing list