[Samba] Use of samba-tool create

Rowland penny rpenny at samba.org
Fri Sep 4 20:21:51 UTC 2020


On 04/09/2020 21:06, Robert Wooden via samba wrote:
> I have been working on creating users with samba-tool create.
>
> samba-tool user create tuser70 --surname="Test" --given-name="User"
> --initials=70 --uid-number=10070 --gid
> -number=10000 --description='70 user' --gecos='Test 70. User' --uid='Test
> 70. User' --login-shell=/bin/sh --unix-home=/h
> ome/SAMDOM/tuser70 --home-directory=\\mbr04.subdom.example.com\users\tuser70
> --home-drive=U: --profile-path \\mbr04.subdom.example.com\profiles\tuser70
>
> Clearly the "--home-directory=\\mbr04.subdom.example.com\users\tuser70"
> and  "--profile-path= \\mbr04.subdom.example.com\profiles\tuser70" is
> incorrect as the following was created:
>
> root at dc1:~# samba-tool user show tuser70
> dn: CN=User 70. Test,CN=Users,DC=subdom,DC=example,DC=com
> objectClass: top
>        snipped for brevity
> countryCode: 0
> homeDirectory: \mbr04.subdonexamplecomuserstuser70
> homeDrive: U:
> badPasswordTime: 0
> lastLogoff: 0
> lastLogon: 0
> primaryGroupID: 513
> profilePath: \mbr04.subdonexamplecomprofilestuser70
>
> SOme of the 'backslashes' are missing.
>
> I see no in depth output from "samba-tool user create --home-directory
> --help".
>
> What is the correct way to enter these paths?

Ah, the old 'Unix treats a '\' as an escape character' problem ;-)

You need to double them up e.g. echo 
"\\\\mbro4.subdom.example.com\\users\\tuser70" will produce 
'\\mbro4.subdom.example.com\users\tuser70'

Rowland





More information about the samba mailing list