1 <samba:parameter name="add user script"
4 advanced="1" developer="1"
5 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
7 <para>This is the full pathname to a script that will
8 be run <emphasis>AS ROOT</emphasis> by <citerefentry><refentrytitle>smbd</refentrytitle>
9 <manvolnum>8</manvolnum></citerefentry> under special circumstances described below.</para>
11 <para>Normally, a Samba server requires that UNIX users are
12 created for all users accessing files on this server. For sites
13 that use Windows NT account databases as their primary user database
14 creating these users and keeping the user list in sync with the
15 Windows NT PDC is an onerous task. This option allows smbd to create the required UNIX users
16 <emphasis>ON DEMAND</emphasis> when a user accesses the Samba server.</para>
18 <para>In order to use this option, <citerefentry><refentrytitle>smbd</refentrytitle>
19 <manvolnum>8</manvolnum></citerefentry> must <emphasis>NOT</emphasis> be set to <parameter moreinfo="none">security = share</parameter>
20 and <parameter moreinfo="none">add user script</parameter>
21 must be set to a full pathname for a script that will create a UNIX
22 user given one argument of <parameter moreinfo="none">%u</parameter>, which expands into
23 the UNIX user name to create.</para>
25 <para>When the Windows user attempts to access the Samba server,
26 at login (session setup in the SMB protocol) time, <citerefentry><refentrytitle>smbd</refentrytitle>
27 <manvolnum>8</manvolnum></citerefentry> contacts the <parameter moreinfo="none">password server</parameter> and
28 attempts to authenticate the given user with the given password. If the
29 authentication succeeds then <command moreinfo="none">smbd</command>
30 attempts to find a UNIX user in the UNIX password database to map the
31 Windows user into. If this lookup fails, and <parameter moreinfo="none">add user script
32 </parameter> is set then <command moreinfo="none">smbd</command> will
33 call the specified script <emphasis>AS ROOT</emphasis>, expanding
34 any <parameter moreinfo="none">%u</parameter> argument to be the user name to create.</para>
36 <para>If this script successfully creates the user then <command moreinfo="none">smbd
37 </command> will continue on as though the UNIX user
38 already existed. In this way, UNIX users are dynamically created to
39 match existing Windows NT accounts.</para>
42 See also <smbconfoption name="security"/>, <smbconfoption name="password server"/>,
43 <smbconfoption name="delete user script"/>.
47 <value type="default"/>
48 <value type="example">/usr/local/samba/bin/add_user %u</value>