[Samba] Unable to set up home share correctly
Rowland Penny
rpenny at samba.org
Tue Oct 18 10:11:56 UTC 2016
On Tue, 18 Oct 2016 11:36:32 +0200
Udo Willke via samba <samba at lists.samba.org> wrote:
> Hello Rowland,
>
> the home folder creation works now(!) It was a misunderstanding on my
> side. The key phrase in the wiki is:
>
> "Close the users properties window with „OK“ to save the
> modification. **The users home directory is created on the fly during
> the save processes.**"
>
> This is a different behaviour as with the "profiles" folders which
> are created during the first login with a new account. I thought it
> would be the same mechanism with the home shares too, which was
> wrong. Sorry for taking so much of your time.
No problem, just glad you got it working ;-)
>
> Does folder creation also work when I create user accounts on the
> linux side with samba-tool
>
> samba-tool user create kbuwi first_time_passwd \
> --userou=CN=Users \
> --surname="Willke" \
> --given-name="Udo" \
> --profile-path="\\\\fileserver\\profiles\\kbudwi" \
> --home-drive="H" \
> --home-directory="\\\\fileserver\\home\\kbudwi" \
> --job-title="IT Specialist" \
> --department="Some Department" \
> --company="Some Company" \
> --description="Some Description" \
> --mail-address="Udo.Willke at somedomain.edu" \
> --internet-address="http://somedomain.edu/somepage" \
> --telephone-number="+49 123/4567890" \
> --physical-delivery-office="Some Office" \
> --nis-domain="mydomain" \
> --unix-home="/var/share/samba/homes/kbudwi" \
> --uid="$USERNAME" \
> --uid-number="$uidNumber" \
> --gid-number="$gidNumber" \
> --gecos="$PRENAME $NAME" \
> --login-shell="/bin/false" \
> --must-change-at-next-login
>
No, it would be created at first connection, as long as you have set
PAM up to do it for you.
>
> Is the command meant to be used in this way?
Yes, you can script around samba-tool.
>
> What I also noticed is, that wbinfo has the --allocate-gid und
> --allocate-uid options which could be used to assign the $uidNumber
> and $uidNumber variables in my script. However "samba-tool create
> user" is supposed to run as "root" on the DC while "wbinfo
> --allocate-gid" seems to give results only on the member server. Is
> there a possibility to run everything on the same machine? OK, the
> obvious solution is to execute it remotely over ssh.
To be honest, I have never tried using wbinfo to set uid & gid, but if
you are scripting this and can use ldap or ldb tools their are a couple
of attributes you can set in AD, these store the next uid & gid numbers.
You can create users from a domain member with samba-tool, by using the
-H or --url option with ldap//<name of DC>
Rowland
More information about the samba
mailing list