Samba not creating users home directory

Issues related to configuring your network
Posts: 3
Joined: 2011/10/21 23:26:31

Samba not creating users home directory

Postby Mike31 » 2011/11/07 18:11:17


From my Windows 2008 R2 server, a user can properly access his share on the Linux file server if he already has a home directory. The problem is that upon first logon, if there is no home directory for the user, Samba doesn't create one. Thanks in advance ...

This is the output from testparm:

Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Unknown parameter encountered: "idmap domains"
Ignoring unknown parameter "idmap domains"
Processing section "[Public Folder]"
Processing section "[homes]"
Processing section "[netlogon]"
WARNING: The "share modes" option is deprecated
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Press enter to see a dump of your service definitions

workgroup = MYDOMAIN
server string = Samba external file server
interfaces = lo, eth1
security = ADS
password server =
log level = 3 ads:10 auth:10 sam:10 rpc:10
log file = /var/log/samba/log.%m
max log size = 50
idmap uid = 500-100000000
idmap gid = 500-100000000
template homedir = /MYDOMAIN/%U
template shell = /bin/bash
winbind enum users = Yes
winbind enum groups = Yes
winbind use default domain = Yes
idmap config MYDOMAIN:range = 20000 - 49999
idmap config MYDOMAIN:base_rid = 0
idmap config MYDOMAIN:backend = rid
hosts allow = 127., 10.10.1.
cups options = raw

[Public Folder]
comment = Public Folder
path = /MYDOMAIN/public_folder
read only = No
guest ok = Yes

comment = Home Directories
path = /MYDOMAIN/%S
read only = No
browseable = No

comment = Network Logon Service
path = /var/lib/samba/netlogon
guest ok = Yes
share modes = No

Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Samba not creating users home directory

Postby pschaff » 2011/11/10 18:50:45

As far as I know there is no way to cause Samba to create home directories. The administrator must perform that function.

Posts: 43
Joined: 2011/07/06 15:28:39

Re: Samba not creating users home directory

Postby beaker_ » 2011/11/10 19:54:05

hmmm.... just a guess:

Code: Select all

tried setting a boolean?
getsebool -a |grep samba

Maybe try telling samba just how to create users and groups.

Code: Select all

        # various scripts can be used on a domain controller or a stand-alone
        # machine to add or delete corresponding UNIX accounts:

;       add user script = ???
;       add group script = ???
;       add machine script = ???
;       delete user script = ???
;       delete user from group script = ???
;       delete group script = ???

But I'm just guessing. Actually I'm leaning towards pschaff's direction but don't know.

Past that. I'm thinking something under net or rpc or privileges. But, again, I don't know.

Posts: 181
Joined: 2007/05/06 20:15:23

Re: Samba not creating users home directory

Postby gulikoza » 2011/11/11 06:26:44

Since accounts are never created in samba (joined to a domain) I guess the add user script will never execute.

How about setting: authconfig --enablemkhomedir
(help says: create home directories for users on their first login)
But I have no idea if it works for samba logins...