[Samba] Correct syntax for --home-directory option in samba-tool

Rowland Penny rowlandpenny at googlemail.com
Tue Nov 25 03:01:48 MST 2014

On 24/11/14 16:01, Th Söldenwagner wrote:
> Hi Rowland,
> thanks for the tip. Now the path is set correctly in ADUC, but the 
> directory under the home-share still wasn't created.
> If I create a user from ADUC and set the path for the home directory 
> and its drive letter the directory appears under the home-share as 
> expected.
> Is the samba-tool broken?
> Thoralf

You say that the directory appears under the home-share, I take it this 
on windows, have you tried to connect to the share ? As far as I know, 
there is no automatic mechanism to create the users home directory on a 
Unix machine when a user is created in ADUC, or with samba-tool.

There are workarounds, you can wrap a script around samba-tool to create 
the users homedir after creation, or use pam_mkhomedir to create the 
users homedir when they connect to it.

> Am 24.11.2014 um 16:11 schrieb Rowland Penny:
>> On 24/11/14 14:53, "Th. Söldenwagner" wrote:
>>> Hi,
>>> I am working at a school and have to change lots of users every 6 or
>>> twelve months.
>>> Until now i used the following for loop on this behalf:
>>> for i in $(cat user.txt); do samba-tool user add $i  password
>>> --must-change-at-next-login --home-drive=H:
>>> --home-directory=\\\\elektra\\home\\$i --script-path=domusers.cmd; done
>>> This worked fine but today I recognized that everything looks fine in
>>> ADUC except that there was no home directory created for my users.
>>> I had to create it with another for loop.
>>> Thanks for any hint
>>> Thoralf
>> Enclose the path in double quotes i.e.
>> <--home-directory="\\\\elektra\\home\\$i">
>> Rowland

More information about the samba mailing list