summaryrefslogtreecommitdiff
path: root/docs/smbdotconf/logon/adduserscript.xml
blob: 7128cb73c7e03f08fb6f525b23fec18f0a6989f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<samba:parameter name="add user script"
                 context="G"
				 type="string"
                 advanced="1" developer="1"
                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
	<para>
	This is the full pathname to a script that will be run <emphasis>AS ROOT</emphasis> by 
	<citerefentry><refentrytitle>smbd</refentrytitle> <manvolnum>8</manvolnum></citerefentry> 
	under special circumstances described below.
	</para>

	<para>
	Normally, a Samba server requires that UNIX users are created for all users accessing 
	files on this server. For sites that use Windows NT account databases as their primary 
	user database creating these users and keeping the user list in sync with the Windows 
	NT PDC is an onerous task. This option allows smbd to create the required UNIX users 
	 <emphasis>ON DEMAND</emphasis> when a user accesses the Samba server.
	</para>

	<para>
	In order to use this option, <citerefentry><refentrytitle>smbd</refentrytitle>
	<manvolnum>8</manvolnum></citerefentry> must <emphasis>NOT</emphasis> be set to 
	<smbconfoption name="security">share</smbconfoption> and <smbconfoption name="add user script"/> 
	must be set to a full pathname for a script that will create a UNIX user given one argument of 
	<parameter moreinfo="none">%u</parameter>, which expands into the UNIX user name to create.
	</para>

	<para>
	When the Windows user attempts to access the Samba server, at login (session setup in 
	the SMB protocol) time, <citerefentry><refentrytitle>smbd</refentrytitle>
	<manvolnum>8</manvolnum></citerefentry> contacts the <smbconfoption name="password server"/> 
	and attempts to authenticate the given user with the given password. If the authentication 
	succeeds then <command moreinfo="none">smbd</command> attempts to find a UNIX user in the UNIX 
	password database to map the Windows user into. If this lookup fails, and 
	<smbconfoption name="add user script"/> is set then <command moreinfo="none">smbd</command> will
	call the specified script <emphasis>AS ROOT</emphasis>, expanding any 
	<parameter moreinfo="none">%u</parameter> argument to be the user name to create.
	</para>

	<para>
	If this script successfully creates the user then <command moreinfo="none">smbd</command> will 
	continue on as though the UNIX user already existed. In this way, UNIX users are dynamically created to
	match existing Windows NT accounts.
	</para>

	<para>
	See also <smbconfoption name="security"/>, <smbconfoption name="password server"/>,
	<smbconfoption name="delete user script"/>.
	</para>
</description>

<value type="default"/>
<value type="example">/usr/local/samba/bin/add_user %u</value>
</samba:parameter>