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

Rowland Penny rowlandpenny at googlemail.com
Mon Nov 24 12:55:42 MST 2014


On 24/11/14 19:44, Thoralf wrote:
> Thanks again, for all your suggestions. I think, I will update my 
> script .
>
> Anyway, my home dirs are not created when using samba-tool alone, e.g.:
>
> samba-tool user add test19 geheimnis 
> --home-directory='\\elektra\home\thoralf' --home-drive='W:'
>
> results in a correct data set for the user in ADUC, he just doesn't 
> have a home dir.

If you want the users homedir created automatically when you create the 
user, you will have to get your script to do this, or use pam_mkhomedir, 
this will create the users homedir the first time they connect to the 
samba server.

> After I set the home dir for the user under Windows to 
> \\elektra\home\%username% the directory appears in my home share.

I take it this is on a windows share, it will not work on a samba share.

Rowland

> But that's fine with me. So, I benefit from samba-tool when adding 
> lots of users to my domain and from Windows ADUC when creating their 
> home dirs.
> Linux and Windows in perfect harmony ;-)
> Thoralf
> Am 24.11.2014 um 19:48 schrieb Marc Muehlfeld:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Am 24.11.2014 um 19:17 schrieb Rowland Penny:
>>> The OP is using a variable for the username, single quotes will not
>>> work.
>> You're right. I haven't seen that.
>>
>>
>>
>>
>> for i in demo12 demo13 demo14 ; do
>>     samba-tool user add $i pass --home-directory='\\dc1\home\'"$i"
>> done
>>
>> E. g. a could would prevent the necessity to escape the backlashes and
>> allows the usage of variables. Many escaped backslashes are so
>> crabbed. :-)
>>
>>
>> Regards,
>> Marc
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1
>>
>> iQEcBAEBAgAGBQJUc31rAAoJEFNERvHO3m51pnsIAIj9dlW1BetTN4VD1y1x/hbs
>> lPFnVT/SsVDjB1XllqjJGoOzEVHbTGyqGbQzALtBQZxsa7TUHSAgsgtNA6wD5QPs
>> 2aeQV91snT8P8lnVtFV750XFvNgULmA2ZhuKNaNCCKf8Pi16zTye6I5F4g+D1FHQ
>> uI0+66eK74g25BfV+yrYMa+utkG6LJcB1hKijyxmvVvODBTpOztdN6XwzkDBt8nz
>> J1wJ+bhFCXJxSLgMK83uHEhu5fb/p01k4Ys2Zv33/lUyxWpT9eGZuPBDkhyccAqf
>> IjD+S0RwYs2BANzV1N7vd3f4E8tNYO0ojCU/qKYMDcp+e1HeDTHmCD3cm0rL/jA=
>> =V7lX
>> -----END PGP SIGNATURE-----
>



More information about the samba mailing list