[Samba] Home Directories on the fly?

Aaron Kincer kincera at gmail.com
Fri Oct 13 16:28:34 GMT 2006

If I understand you correctly, you have user jsmith that wants to 
connect to /your_samba_share_root/home/jsmith (or whatever your home 
path is). When your Windows XP users login to the domain, they are not 
getting their home directories mapped.

If this is the case, your home directory mapping is the job of Active 
Directory itself. Are you using your Samba server as an AD member 
server? If not and it is all Windows based domain controllers, you need 
to setup your home share configuration in the user account in AD.

1) Open Active Dirctory Users and Computers (on your DC or local PC if 
you installed it there)
2) Right-click on the user account jsmith (or whatever) and select 
3) Click the Profile tab
4) Click the Connect option button
5) Select the drive letter you want the share to be under (we use H for 
6) Put in the full UNC path (i.e. \\your_samba_server_name\home\jsmith)
7) Click OK
8) Close Active Directory Users and Computers

Ta da!

NOTES: When creating new users, you can copy an existing user and it 
will automatically add this configuration to the new user account AND 
create their home share on the Samba server IFF you give domain full 
rights to the /home folder. You MUST go back and configure permissions 
properly on this folder after creating a new account. You need to be 
diligent and consistent when choosing a global home share. Make sure you 
don't later try to map a drive to that letter. It won't work.


Aaron Kincer

Golden Butler wrote:
> Hello all,
> I have a functional samba/windind file server (SLES 10) thats a member server of an Active Directory domain.  I'm able to successfully resolve user and group accounts from AD.  The problem I'm having is samba isn't creating home directories automatically when I try to map to a AD user share from Win XP.  What I am able to do is, when I ssh into the machine with an AD user, it creates the the home directory.  I can't figure out why because my pam.d configs are configured for this to happen.  But obviously I'm missing something.  One thing I did try as a result from googling is changing the /home/MYDOM directory to 777, but no cigar.  Here's my pam.d configs and smb.conf below.  Thanks in advance.
> /etc/pam.d/samba:
> auth     include        common-auth
> account  include        common-account
> password include        common-password
> session  include        common-session
> /etc/pam.d/sshd
> auth     include        common-auth
> auth     required       pam_nologin.so
> account  include        common-account
> password include        common-password
> session  include        common-session
> /etc/pam.d/common-session
> session required        pam_mkhomedir.so
> session required        pam_limits.so
> session required        pam_unix2.so
> =======================================
> /etc/samba/smb.conf:
> [global]
>         workgroup = MYDOM
>         printing = cups
>         printcap name = cups
>         printcap cache time = 750
>         cups options = raw
>         logon drive = H:
>         idmap gid = 10000-20000
>         idmap uid = 10000-20000
>         realm = MYDOM.ORG
>         security = ADS
>         template homedir = /home/%D/%U
>         template shell = /bin/bash
>         winbind refresh tickets = yes
>         winbind enum users = yes
>         winbind enum groups = yes
>         winbind use default domain = yes

More information about the samba mailing list