Change the S3 fileserver over to se_file_access_check().
[Samba/gebeck_regimport.git] / docs-xml / Samba3-HOWTO / TOSHARG-Passdb.xml
blobc1738e397d2cb81cffdc9788e12928bcaf223cd2
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="passdb">
4 <chapterinfo>
5         &author.jelmer;
6         &author.jht;
7         &author.jerry;
8         &author.jeremy;
9         <author>&person.gd;<contrib>LDAP updates</contrib></author>
10         <author>
11                 <firstname>Olivier (lem)</firstname><surname>Lemaire</surname>
12                 <affiliation>
13                         <orgname>IDEALX</orgname>
14                         <address><email>olem@IDEALX.org</email></address>
15                 </affiliation>
16         </author>
18         <pubdate>May 24, 2003</pubdate>
19 </chapterinfo>
20 <title>Account Information Databases</title>
22 <para>
23 <indexterm><primary>account backends</primary></indexterm>
24 <indexterm><primary>password backends</primary></indexterm>
25 <indexterm><primary>scalability</primary></indexterm>
26 <indexterm><primary>ADS</primary></indexterm>
27 Early releases of Samba-3 implemented new capability to work concurrently with multiple account backends. This
28 capability was removed beginning with release of Samba 3.0.23. Commencing with Samba 3.0.23 it is possible to
29 work with only one specified passwd backend.
30 </para>
32 <para>
33 <indexterm><primary>passdb backend</primary></indexterm>
34 <indexterm><primary>smbpasswd</primary></indexterm>
35 <indexterm><primary>tdbsam</primary></indexterm>
36 <indexterm><primary>ldapsam</primary></indexterm>
37 <indexterm><primary>LDAP</primary></indexterm>
38 <indexterm><primary>single repository</primary></indexterm>
39 The three passdb backends that are fully maintained (actively supported) by the Samba Team are:
40 <literal>smbpasswd</literal> (being obsoleted), <literal>tdbsam</literal> (a tdb-based binary file format),
41 and <literal>ldapsam</literal> (LDAP directory).  Of these, only the <literal>ldapsam</literal> backend
42 stores both POSIX (UNIX) and Samba user and group account information in a single repository. The
43 <literal>smbpasswd</literal> and <literal>tdbsam</literal> backends store only Samba user accounts.
44 </para>
46 <para>
47 In a strict sense, there are three supported account storage and access systems. One of these is considered
48 obsolete (smbpasswd). It is recommended to use the <literal>tdbsam</literal> method for all simple systems. Use
49 <literal>ldapsam</literal> for larger and more complex networks.
50 </para>
52 <para>
53 <indexterm><primary>passdb backend</primary></indexterm>
54 <indexterm><primary>account storage mechanisms</primary></indexterm>
55 <indexterm><primary>account storage system</primary></indexterm>
56 <indexterm><primary>user and trust accounts</primary></indexterm>
57 <indexterm><primary>machine trust accounts</primary></indexterm>
58 <indexterm><primary>computer accounts</primary></indexterm>
59 <indexterm><primary>interdomain trust accounts</primary></indexterm>
60 In a strict and literal sense, the passdb backends are account storage mechanisms (or methods) alone. The choice
61 of terminology can be misleading, however we are stuck with this choice of wording. This chapter documents the
62 nature of the account storage system with a focus on user and trust accounts. Trust accounts have two forms,
63 machine trust accounts (computer accounts) and interdomain trust accounts. These are all treated as user-like
64 entities.
65 </para>
67 <sect1>
68 <title>Features and Benefits</title>
70 <sect2>
71         <title>Backward Compatibility Account Storage Systems</title>
73 <variablelist>
74         <varlistentry><term>Plaintext</term>
75                 <listitem>
76                         <para>
77 <indexterm><primary>plaintext</primary></indexterm>
78 <indexterm><primary>plaintext authentication</primary></indexterm>
79 <indexterm><primary>/etc/passwd</primary></indexterm>
80 <indexterm><primary>/etc/shadow</primary></indexterm>
81 <indexterm><primary>PAM</primary></indexterm>
82                         This isn't really a backend at all, but is listed here for simplicity.  Samba can be configured to pass
83                         plaintext authentication requests to the traditional UNIX/Linux <filename>/etc/passwd</filename> and
84                         <filename>/etc/shadow</filename>-style subsystems.  On systems that have Pluggable Authentication Modules
85                         (PAM) support, all PAM modules are supported. The behavior is just as it was with Samba-2.2.x, and the
86                         protocol limitations imposed by MS Windows clients apply likewise. Please refer to <link
87                         linkend="passdbtech">Technical Information</link>, for more information regarding the limitations of plaintext
88                         password usage.
89                         </para>
90                 </listitem>
91         </varlistentry>
93         <varlistentry><term>smbpasswd</term>
94                 <listitem>
95                         <para>
96 <indexterm><primary>smbpasswd</primary></indexterm>
97 <indexterm><primary>LanMan passwords</primary></indexterm>
98 <indexterm><primary>NT-encrypted passwords</primary></indexterm>
99 <indexterm><primary>SAM</primary></indexterm>
100                         This option allows continued use of the <filename>smbpasswd</filename>
101                         file that maintains a plain ASCII (text) layout that includes the MS Windows
102                         LanMan and NT-encrypted passwords as well as a field that stores some
103                         account information. This form of password backend does not store any of
104                         the MS Windows NT/200x SAM (Security Account Manager) information required to
105                         provide the extended controls that are needed for more comprehensive
106                         interoperation with MS Windows NT4/200x servers.
107                         </para>
109                         <para>
110                         This backend should be used only for backward compatibility with older
111                         versions of Samba. It may be deprecated in future releases.
112                         </para>
113                 </listitem>
114         </varlistentry>
115 </variablelist>
117 </sect2>
119 <sect2>
120 <title>New Account Storage Systems</title>
122 <para>
123 Samba-3 introduces a number of new password backend capabilities.
124 <indexterm><primary>SAM backend</primary><secondary>tdbsam</secondary></indexterm>
125 <indexterm><primary>SAM backend</primary><secondary>ldapsam</secondary></indexterm>
126 </para>
128 <variablelist>
129         <varlistentry><term>tdbsam</term>
130                 <listitem>
131                         <para>
132 <indexterm><primary>rich database backend</primary></indexterm>
133 <indexterm><primary>PDC</primary></indexterm>
134 <indexterm><primary>BDC</primary></indexterm>
135                         This backend provides a rich database backend for local servers. This
136                         backend is not suitable for multiple domain controllers (i.e., PDC + one
137                         or more BDC) installations.
138                         </para>
140                         <para>
141 <indexterm><primary>extended SAM</primary></indexterm>
142 <indexterm><primary>TDB</primary></indexterm>
143 <indexterm><primary>binary format TDB</primary></indexterm>
144 <indexterm><primary>trivial database</primary></indexterm>
145 <indexterm><primary>system access controls</primary></indexterm>
146 <indexterm><primary>MS Windows NT4/200x</primary></indexterm>
147                         The <emphasis>tdbsam</emphasis> password backend stores the old <emphasis>
148                         smbpasswd</emphasis> information plus the extended MS Windows NT/200x
149                         SAM information into a binary format TDB (trivial database) file.
150                         The inclusion of the extended information makes it possible for Samba-3
151                         to implement the same account and system access controls that are possible
152                         with MS Windows NT4/200x-based systems.
153                         </para>
155                         <para>
156 <indexterm><primary>simple operation</primary></indexterm>
157 <indexterm><primary>OpenLDAP</primary></indexterm>
158 <indexterm><primary>ADS</primary></indexterm>
159                         The inclusion of the <emphasis>tdbsam</emphasis> capability is a direct
160                         response to user requests to allow simple site operation without the overhead
161                         of the complexities of running OpenLDAP. It is recommended to use this only
162                         for sites that have fewer than 250 users. For larger sites or implementations,
163                         the use of OpenLDAP or of Active Directory integration is strongly recommended.
164                         </para>
165                 </listitem>
166         </varlistentry>
168         <varlistentry><term>ldapsam</term>
169                 <listitem>
170                         <para>
171 <indexterm><primary>rich directory backend</primary></indexterm>
172 <indexterm><primary>distributed account</primary></indexterm>
173                         This provides a rich directory backend for distributed account installation.
174                         </para>
176                         <para>
177 <indexterm><primary>LDAP</primary></indexterm>
178 <indexterm><primary>OpenLDAP</primary></indexterm>
179 <indexterm><primary>Samba schema</primary></indexterm>
180 <indexterm><primary>schema file</primary></indexterm>
181 <indexterm><primary>examples/LDAP</primary></indexterm>
182                         Samba-3 has a new and extended LDAP implementation that requires configuration
183                         of OpenLDAP with a new format Samba schema. The new format schema file is
184                         included in the <filename class="directory">examples/LDAP</filename> directory of the Samba distribution.
185                         </para>
187                         <para>
188 <indexterm><primary>expands control abilities</primary></indexterm>
189 <indexterm><primary>profile</primary></indexterm>
190 <indexterm><primary>home directories</primary></indexterm>
191 <indexterm><primary>account access controls</primary></indexterm>
192 <indexterm><primary>greater scalability</primary></indexterm>
193                         The new LDAP implementation significantly expands the control abilities that
194                         were possible with prior versions of Samba. It is now possible to specify
195                         <quote>per-user</quote> profile settings, home directories, account access controls, and
196                         much more. Corporate sites will see that the Samba Team has listened to their
197                         requests both for capability and greater scalability.
198                         </para>
199                 </listitem>
200         </varlistentry>
202 </variablelist>
204 </sect2>
206 </sect1>
208 <sect1 id="passdbtech">
209         <title>Technical Information</title>
211         <para>
212 <indexterm><primary>plaintext passwords</primary></indexterm>
213 <indexterm><primary>encrypted passwords</primary></indexterm>
214         Old Windows clients send plaintext passwords over the wire. Samba can check these
215         passwords by encrypting them and comparing them to the hash stored in the UNIX user database.
216         </para>
218         <para>
219 <indexterm><primary>encrypted passwords</primary></indexterm>
220 <indexterm><primary>LanMan</primary></indexterm>
221 <indexterm><primary>plaintext passwords</primary></indexterm>
222 <indexterm><primary>registry</primary></indexterm>
223         Newer Windows clients send encrypted passwords (LanMan and NT hashes) instead of plaintext passwords over
224         the wire. The newest clients will send only encrypted passwords and refuse to send plaintext passwords unless
225         their registry is tweaked.
226         </para>
228         <para>
229 <indexterm><primary>UNIX-style encrypted passwords</primary></indexterm>
230 <indexterm><primary>converted</primary></indexterm>
231         Many people ask why Samba cannot simply use the UNIX password database. Windows requires
232         passwords that are encrypted in its own format.  The UNIX passwords can't be converted to
233         Windows-style encrypted passwords. Because of that, you can't use the standard UNIX user
234         database, and you have to store the LanMan and NT hashes somewhere else.
235         </para>
237         <para>
238 <indexterm><primary>differently encrypted passwords</primary></indexterm>
239 <indexterm><primary>profile</primary></indexterm>
240 <indexterm><primary>workstations</primary></indexterm>
241 <indexterm><primary>tdbsam</primary></indexterm>
242         In addition to differently encrypted passwords, Windows also stores certain data for each
243         user that is not stored in a UNIX user database: for example, workstations the user may logon from,
244         the location where the user's profile is stored, and so on. Samba retrieves and stores this
245         information using a <smbconfoption name="passdb backend"/>. Commonly available backends are LDAP,
246         tdbsam, and plain text file. For more information, see the man page for &smb.conf; regarding the
247         <smbconfoption name="passdb backend"/> parameter.
248         </para>
251         <figure id="idmap-sid2uid">
252                 <title>IDMAP: Resolution of SIDs to UIDs.</title>
253                 <imagefile scale="40">idmap-sid2uid</imagefile>
254         </figure>
256         <para>
257         <indexterm><primary>SID</primary></indexterm>
258 <indexterm><primary>UID</primary></indexterm>
259 <indexterm><primary>SID</primary></indexterm>
260         The resolution of SIDs to UIDs is fundamental to correct operation of Samba. In both cases shown, if winbindd
261         is not running or cannot be contacted, then only local SID/UID resolution is possible. See <link
262         linkend="idmap-sid2uid">resolution of SIDs to UIDs</link> and <link linkend="idmap-uid2sid">resolution of UIDs
263         to SIDs</link> diagrams.
264         </para>
266         <figure id="idmap-uid2sid">
267                 <title>IDMAP: Resolution of UIDs to SIDs.</title>
268                 <imagefile scale="50">idmap-uid2sid</imagefile>
269         </figure>
271         <sect2>
272         <title>Important Notes About Security</title>
274                 <para>
275 <indexterm><primary>SMB password encryption</primary></indexterm>
276 <indexterm><primary>clear-text passwords</primary></indexterm>
277 <indexterm><primary>hashed password equivalent</primary></indexterm>
278 <indexterm><primary>LDAP</primary></indexterm>
279 <indexterm><primary>secret</primary></indexterm>
280                 The UNIX and SMB password encryption techniques seem similar on the surface. This
281                 similarity is, however, only skin deep. The UNIX scheme typically sends clear-text
282                 passwords over the network when logging in. This is bad. The SMB encryption scheme
283                 never sends the clear-text password over the network, but it does store the 16-byte
284                 hashed values on disk. This is also bad. Why? Because the 16 byte hashed values
285                 are a <quote>password equivalent.</quote> You cannot derive the user's password from them, but
286                 they could potentially be used in a modified client to gain access to a server.
287                 This would require considerable technical knowledge on behalf of the attacker but
288                 is perfectly possible. You should therefore treat the data stored in whatever passdb
289                 backend you use (smbpasswd file, LDAP) as though it contained the clear-text
290                 passwords of all your users. Its contents must be kept secret, and the file should
291                 be protected accordingly.
292                 </para>
294                 <para>
295 <indexterm><primary>password scheme</primary></indexterm>
296 <indexterm><primary>plaintext passwords</primary></indexterm>
297 <indexterm><primary>compatible</primary></indexterm>
298                 Ideally, we would like a password scheme that involves neither plaintext passwords
299                 on the network nor plaintext passwords on disk. Unfortunately, this is not available because Samba is stuck with
300                 having to be compatible with other SMB systems (Windows NT, Windows for Workgroups, Windows 9x/Me).
301                 </para>
303                 <para>
304 <indexterm><primary>encrypted passwords</primary></indexterm>
305 <indexterm><primary>plaintext passwords</primary></indexterm>
306                 Windows NT 4.0 Service Pack 3 changed the default setting so plaintext passwords
307                 are disabled from being sent over the wire. This mandates either the use of encrypted
308                 password support or editing the Windows NT registry to re-enable plaintext passwords.
309                 </para>
311                 <para>
312 <indexterm><primary>domain security</primary></indexterm>
313 <indexterm><primary>domain environment</primary></indexterm>
314                 The following versions of Microsoft Windows do not support full domain security protocols,
315                 although they may log onto a domain environment:
316                 </para>
318                 <itemizedlist>
319                         <listitem><para>MS DOS Network client 3.0 with the basic network redirector installed.</para></listitem>
320                         <listitem><para>Windows 95 with the network redirector update installed.</para></listitem>
321                         <listitem><para>Windows 98 [Second Edition].</para></listitem>
322                         <listitem><para>Windows Me.</para></listitem>
323                 </itemizedlist>
325                 <note>
326                 <para>
327 <indexterm><primary>Windows XP Home</primary></indexterm>
328 <indexterm><primary>domain member</primary></indexterm>
329 <indexterm><primary>domain logons</primary></indexterm>
330                 MS Windows XP Home does not have facilities to become a domain member, and it cannot participate in domain logons.
331                 </para>
332                 </note>
334                 <para>
335                 The following versions of MS Windows fully support domain security protocols.
336                 </para>
338                 <itemizedlist>
339                         <listitem><para>Windows NT 3.5x.</para></listitem>
340                         <listitem><para>Windows NT 4.0.</para></listitem>
341                         <listitem><para>Windows 2000 Professional.</para></listitem>
342                         <listitem><para>Windows 200x Server/Advanced Server.</para></listitem>
343                         <listitem><para>Windows XP Professional.</para></listitem>
344                 </itemizedlist>
346                 <para>
347 <indexterm><primary>SMB/CIFS</primary></indexterm>
348 <indexterm><primary>authentication</primary></indexterm>
349 <indexterm><primary>challenge/response mechanism</primary></indexterm>
350 <indexterm><primary>clear-text</primary></indexterm>
351 <indexterm><primary>encrypted</primary></indexterm>
352 <indexterm><primary>negotiate</primary></indexterm>
353                 All current releases of Microsoft SMB/CIFS clients support authentication via the
354                 SMB challenge/response mechanism described here. Enabling clear-text authentication
355                 does not disable the ability of the client to participate in encrypted authentication.
356                 Instead, it allows the client to negotiate either plaintext or encrypted password
357                 handling.
358                 </para>
360                 <para>
361 <indexterm><primary>cached encrypted password</primary></indexterm>
362 <indexterm><primary>plaintext passwords</primary></indexterm>
363 <indexterm><primary>registry change</primary></indexterm>
364 <indexterm><primary>auto-reconnect</primary></indexterm>
365 <indexterm><primary>encrypted passwords</primary></indexterm>
366                 MS Windows clients will cache the encrypted password alone. Where plaintext passwords
367                 are re-enabled through the appropriate registry change, the plaintext password is never
368                 cached. This means that in the event that a network connections should become disconnected
369                 (broken), only the cached (encrypted) password will be sent to the resource server to
370                 effect an auto-reconnect. If the resource server does not support encrypted passwords, the
371                 auto-reconnect will fail. Use of encrypted passwords is strongly advised.
372                 </para>
374                 <sect3>
375                 <title>Advantages of Encrypted Passwords</title>
377                         <itemizedlist>
378                                 <listitem><para>
379 <indexterm><primary>passed across the network</primary></indexterm>
380 <indexterm><primary>network sniffer</primary></indexterm>
381 <indexterm><primary>SMB server</primary></indexterm>
382                                 Plaintext passwords are not passed across the network. Someone using a network sniffer
383                                 cannot just record passwords going to the SMB server.
384                                 </para></listitem>
386                                 <listitem><para>
387 <indexterm><primary>not stored anywhere</primary></indexterm>
388 <indexterm><primary>memory</primary></indexterm>
389 <indexterm><primary>disk</primary></indexterm>
390                                 Plaintext passwords are not stored anywhere in memory or on disk.
391                                 </para></listitem>
393                                 <listitem><para>
394 <indexterm><primary>encrypted passwords</primary></indexterm>
395 <indexterm><primary>user-level security</primary></indexterm>
396 <indexterm><primary>password prompt</primary></indexterm>
397 <indexterm><primary>SMB encryption</primary></indexterm>
398                                 Windows NT does not like talking to a server that does not support encrypted passwords. It will refuse to
399                                 browse the server if the server is also in user-level security mode. It will insist on prompting the user for
400                                 the password on each connection, which is very annoying. The only thing you can do to stop this is to use SMB
401                                 encryption.
402                                 </para></listitem>
404                                 <listitem><para>
405 <indexterm><primary>encrypted password</primary></indexterm>
406 <indexterm><primary>automatic reconnects</primary></indexterm>
407                                 Encrypted password support allows automatic share (resource) reconnects.
408                                 </para></listitem>
410                                 <listitem><para>
411 <indexterm><primary>PDC</primary></indexterm>
412 <indexterm><primary>BDC</primary></indexterm>
413                                 Encrypted passwords are essential for PDC/BDC operation.
414                                 </para></listitem>
415                         </itemizedlist>
416                 </sect3>
419                 <sect3>
420                 <title>Advantages of Non-Encrypted Passwords</title>
422                         <itemizedlist>
423                                 <listitem><para>
424 <indexterm><primary>cached in memory</primary></indexterm>
425                                 Plaintext passwords are not kept on disk and are not cached in memory.
426                                 </para></listitem>
428                                 <listitem><para>
429 <indexterm><primary>Login</primary></indexterm>
430 <indexterm><primary>FTP</primary></indexterm>
431                                 Plaintext passwords use the same password file as other UNIX services, such as Login and FTP.
432                                 </para></listitem>
434                                 <listitem><para>
435 <indexterm><primary>Telnet</primary></indexterm>
436 <indexterm><primary>FTP</primary></indexterm>
437                                 Use of other services (such as Telnet and FTP) that send plaintext passwords over
438                                 the network makes sending them for SMB not such a big deal.
439                                 </para></listitem>
440                         </itemizedlist>
441                 </sect3>
442         </sect2>
444         <sect2>
445         <title>Mapping User Identifiers between MS Windows and UNIX</title>
447         <para>
448 <indexterm><primary>UID</primary></indexterm>
449 <indexterm><primary>SID</primary></indexterm>
450 <indexterm><primary>mapping</primary></indexterm>
451         Every operation in UNIX/Linux requires a user identifier (UID), just as in
452         MS Windows NT4/200x this requires a security identifier (SID). Samba provides
453         two means for mapping an MS Windows user to a UNIX/Linux UID.
454         </para>
456         <para>
457 <indexterm><primary>Samba SAM</primary></indexterm>
458 <indexterm><primary>SAM</primary></indexterm>
459 <indexterm><primary>UID</primary></indexterm>
460 <indexterm><primary>account information database</primary></indexterm>
461 <indexterm><primary>local user account</primary></indexterm>
462         First, all Samba SAM database accounts require a UNIX/Linux UID that the account will map to. As users are
463         added to the account information database, Samba will call the <smbconfoption name="add user script"/>
464         interface to add the account to the Samba host OS. In essence all accounts in the local SAM require a local
465         user account.
466         </para>
468         <para>
469         <indexterm><primary>idmap uid</primary></indexterm>
470         <indexterm><primary>idmap gid</primary></indexterm>
471         <indexterm><primary>UID</primary></indexterm>
472         <indexterm><primary>SAM</primary></indexterm>
473         <indexterm><primary>foreign domain</primary></indexterm>
474         <indexterm><primary>non-member Windows client</primary></indexterm>
475         <indexterm><primary>SID</primary></indexterm>
476         The second way to map Windows SID to UNIX UID is via the <emphasis>idmap uid</emphasis> and
477         <emphasis>idmap gid</emphasis> parameters in &smb.conf;.  Please refer to the man page for information about
478         these parameters.  These parameters are essential when mapping users from a remote (non-member Windows client
479         or a member of a foreign domain) SAM server.
480         </para>
482         </sect2>
484         <sect2 id="idmapbackend">
485         <title>Mapping Common UIDs/GIDs on Distributed Machines</title>
487         <para>
488 <indexterm><primary>UID</primary></indexterm>
489 <indexterm><primary>GID</primary></indexterm>
490 <indexterm><primary>BDC</primary></indexterm>
491 <indexterm><primary>domain member servers</primary></indexterm>
492 <indexterm><primary>NFS</primary></indexterm>
493 <indexterm><primary>rsync</primary></indexterm>
494         Samba-3 has a special facility that makes it possible to maintain identical UIDs and GIDs
495         on all servers in a distributed network. A distributed network is one where there exists
496         a PDC, one or more BDCs, and/or one or more domain member servers. Why is this important?
497         This is important if files are being shared over more than one protocol (e.g., NFS) and where
498         users are copying files across UNIX/Linux systems using tools such as <command>rsync</command>.
499         </para>
501         <para>
502 <indexterm><primary>LDAP-based</primary></indexterm>
503 <indexterm><primary>idmap backend</primary></indexterm>
504 <indexterm><primary>UID</primary></indexterm>
505 <indexterm><primary>GID</primary></indexterm>
506 <indexterm><primary>LDAP</primary></indexterm>
507 <indexterm><primary>SAM backend</primary></indexterm>
508 <indexterm><primary>LDAP idmap Backend</primary></indexterm>
509         <indexterm><primary>idmap backend</primary></indexterm>
510         The special facility is enabled using a parameter called <parameter>idmap backend</parameter>.
511         The default setting for this parameter is an empty string. Technically it is possible to use
512         an LDAP-based idmap backend for UIDs and GIDs, but it makes most sense when this is done for
513         network configurations that also use LDAP for the SAM backend.
514         <link linkend="idmapbackendexample">Example Configuration with the LDAP idmap Backend</link>
515         shows that configuration.
516         </para>
518 <indexterm><primary>SAM backend</primary><secondary>ldapsam</secondary></indexterm>
519 <example id="idmapbackendexample">
520 <title>Example Configuration with the LDAP idmap Backend</title>
521 <smbconfblock>
522 <smbconfsection name="[global]"/>
523 <smbconfoption name="idmap backend">ldap:ldap://ldap-server.quenya.org:636</smbconfoption>
524 <smbconfcomment>Alternatively, this could be specified as:</smbconfcomment>
525 <smbconfoption name="idmap backend">ldap:ldaps://ldap-server.quenya.org</smbconfoption>
526 </smbconfblock>
527 </example>
529         <para>
530 <indexterm><primary>LDAP backends</primary></indexterm>
531 <indexterm><primary>PADL Software</primary></indexterm>
532         A network administrator who wants to make significant use of LDAP backends will sooner or later be
533         exposed to the excellent work done by PADL Software. PADL <ulink url="http://www.padl.com"/> have
534         produced and released to open source an array of tools that might be of interest. These tools include:
535         </para>
537         <itemizedlist>
538                 <listitem>
539                 <para>
540 <indexterm><primary>nss_ldap</primary></indexterm>
541 <indexterm><primary>NSS</primary></indexterm>
542 <indexterm><primary>AIX</primary></indexterm>
543 <indexterm><primary>Linux</primary></indexterm>
544 <indexterm><primary>LDAP</primary></indexterm>
545 <indexterm><primary>Solaris</primary></indexterm>
546 <indexterm><primary>UID</primary></indexterm>
547 <indexterm><primary>GID</primary></indexterm>
548                 <emphasis>nss_ldap:</emphasis> An LDAP name service switch (NSS) module to provide native
549                 name service support for AIX, Linux, Solaris, and other operating systems. This tool
550                 can be used for centralized storage and retrieval of UIDs and GIDs.
551                 </para>
552                 </listitem>
554                 <listitem>
555                 <para>
556 <indexterm><primary>pam_ldap</primary></indexterm>
557 <indexterm><primary>PAM</primary></indexterm>
558 <indexterm><primary>LDAP</primary></indexterm>
559 <indexterm><primary>access authentication</primary></indexterm>
560                 <emphasis>pam_ldap:</emphasis> A PAM module that provides LDAP integration for UNIX/Linux
561                 system access authentication.
562                 </para>
563                 </listitem>
565                 <listitem>
566                 <para>
567 <indexterm><primary>idmap_ad</primary></indexterm>
568 <indexterm><primary>IDMAP backend</primary></indexterm>
569 <indexterm><primary>RFC 2307</primary></indexterm>
570 <indexterm><primary>PADL</primary></indexterm>
571                 <emphasis>idmap_ad:</emphasis> An IDMAP backend that supports the Microsoft Services for
572                 UNIX RFC 2307 schema available from the PADL Web
573                 <ulink url="http://www.padl.com/download/xad_oss_plugins.tar.gz">site</ulink>.
574                 </para>
575                 </listitem>
576         </itemizedlist>
578         </sect2>
580         <sect2>
581         <title>Comments Regarding LDAP</title>
583         <para>
584 <indexterm><primary>LDAP</primary><secondary>directories</secondary></indexterm>
585 <indexterm><primary>architecture</primary></indexterm>
586 <indexterm><primary>FIM</primary></indexterm>
587 <indexterm><primary>SSO</primary></indexterm>
588         There is much excitement and interest in LDAP directories in the information technology world
589         today. The LDAP architecture was designed to be highly scalable. It was also designed for
590         use across a huge number of potential areas of application encompassing a wide range of operating
591         systems and platforms. LDAP technologies are at the heart of the current generations of Federated
592         Identity Management (FIM) solutions that can underlie a corporate Single Sign-On (SSO) environment.
593         </para>
595         <para>
596 <indexterm><primary>LDAP</primary></indexterm>
597 <indexterm><primary>eDirectory</primary></indexterm>
598 <indexterm><primary>ADS</primary></indexterm>
599 <indexterm><primary>authentication</primary></indexterm>
600         LDAP implementations have been built across a wide variety of platforms. It lies at the core of Microsoft
601         Windows Active Directory services (ADS), Novell's eDirectory, as well as many others. Implementation of the
602         directory services LDAP involves interaction with legacy as well as new generation applications, all of which
603         depend on some form of authentication services.
604         </para>
606         <para>
607 <indexterm><primary>LDAP directory</primary></indexterm>
608 <indexterm><primary>authentication</primary></indexterm>
609 <indexterm><primary>access controls</primary></indexterm>
610 <indexterm><primary>intermediate tools</primary></indexterm>
611 <indexterm><primary>middle-ware</primary></indexterm>
612 <indexterm><primary>central environment</primary></indexterm>
613 <indexterm><primary>infrastructure</primary></indexterm>
614 <indexterm><primary>login shells</primary></indexterm>
615 <indexterm><primary>mail</primary></indexterm>
616 <indexterm><primary>messaging systems</primary></indexterm>
617 <indexterm><primary>quota controls</primary></indexterm>
618 <indexterm><primary>printing systems</primary></indexterm>
619 <indexterm><primary>DNS servers</primary></indexterm>
620 <indexterm><primary>DHCP servers</primary></indexterm>
621         UNIX services can utilize LDAP directory information for authentication and access controls
622         through intermediate tools and utilities. The total environment that consists of the LDAP directory
623         and the middle-ware tools and utilities makes it possible for all user access to the UNIX platform
624         to be managed from a central environment and yet distributed to wherever the point of need may
625         be physically located. Applications that benefit from this infrastructure include: UNIX login
626         shells, mail and messaging systems, quota controls, printing systems, DNS servers, DHCP servers,
627         and also Samba.
628         </para>
630         <para>
631 <indexterm><primary>LDAP</primary></indexterm>
632 <indexterm><primary>passdb backend</primary></indexterm>
633 <indexterm><primary>scalable</primary></indexterm>
634 <indexterm><primary>SAM backend</primary></indexterm>
635 <indexterm><primary>LDAP directory</primary></indexterm>
636 <indexterm><primary>management costs</primary></indexterm>
637         Many sites are installing LDAP for the first time in order to provide a scalable passdb backend
638         for Samba. Others are faced with the need to adapt an existing LDAP directory to new uses such
639         as for the Samba SAM backend. Whatever your particular need and attraction to Samba may be,
640         decisions made in respect of the design of the LDAP directory structure and its implementation
641         are of a durable nature for the site. These have far-reaching implications that affect long-term
642         information systems management costs.
643         </para>
645         <para>
646 <indexterm><primary>LDAP deployment</primary></indexterm>
647 <indexterm><primary>Directory Information Tree</primary><see>DIT</see></indexterm>
648         Do not rush into an LDAP deployment. Take the time to understand how the design of the Directory
649         Information Tree (DIT) may impact current and future site needs, as well as the ability to meet
650         them. The way that Samba SAM information should be stored within the DIT varies from site to site
651         and with each implementation new experience is gained. It is well understood by LDAP veterans that
652         first implementations create awakening, second implementations of LDAP create fear, and
653         third-generation deployments bring peace and tranquility.
654         </para>
656         <sect3>
657         <title>Caution Regarding LDAP and Samba</title>
659         <para>
660 <indexterm><primary>POSIX identity</primary></indexterm>
661 <indexterm><primary>networking environment</primary></indexterm>
662 <indexterm><primary>user accounts</primary></indexterm>
663 <indexterm><primary>group accounts</primary></indexterm>
664 <indexterm><primary>machine trust accounts</primary></indexterm>
665 <indexterm><primary>interdomain trust accounts</primary></indexterm>
666 <indexterm><primary>intermediate information</primary></indexterm>
667         Samba requires UNIX POSIX identity information as well as a place to store information that is
668         specific to Samba and the Windows networking environment. The most used information that must
669         be dealt with includes: user accounts, group accounts, machine trust accounts, interdomain
670         trust accounts, and intermediate information specific to Samba internals.
671         </para>
673         <para>
674 <indexterm><primary>deployment guidelines</primary></indexterm>
675 <indexterm><primary>HOWTO documents</primary></indexterm>
676 <indexterm><primary>LDAP</primary></indexterm>
677         The example deployment guidelines in this book, as well as other books and HOWTO documents
678         available from the internet may not fit with established directory designs and implementations.
679         The existing DIT may not be able to accommodate the simple information layout proposed in common
680         sources. Additionally, you may find that the common scripts and tools that are used to provision
681         the LDAP directory for use with Samba may not suit your needs.
682         </para>
684         <para>
685 <indexterm><primary>existing LDAP DIT</primary></indexterm>
686         It is not uncommon, for sites that have existing LDAP DITs to find necessity to generate a
687         set of site-specific scripts and utilities to make it possible to deploy Samba within the
688         scope of site operations. The way that user and group accounts are distributed throughout
689         the DIT may make this a challenging matter. The solution will, of course, be rewarding, but
690         the journey to it may be challenging. Take time to understand site needs and do not rush
691         into deployment.
692         </para>
694         <para>
695 <indexterm><primary>scripts</primary></indexterm>
696 <indexterm><primary>tools</primary></indexterm>
697         Above all, do not blindly use scripts and tools that are not suitable for your site. Check
698         and validate all scripts before you execute them to make sure that the existing infrastructure
699         will not be damaged by inadvertent use of an inappropriate tool.
700         </para>
702         </sect3>
704         </sect2>
706         <sect2>
707         <title>LDAP Directories and Windows Computer Accounts</title>
709                 <para>
710 <indexterm><primary>turnkey solution</primary></indexterm>
711 <indexterm><primary>LDAP.</primary></indexterm>
712 <indexterm><primary>frustrating experience</primary></indexterm>
713                 Samba doesn't provide a turnkey solution to LDAP. It is best to deal with the design and
714                 configuration of an LDAP directory prior to integration with Samba. A working knowledge
715                 of LDAP makes Samba integration easy, and the lack of a working knowledge of LDAP can make
716                 it a frustrating experience.
717                 </para>
719                 <para>
720 <indexterm><primary>computer accounts</primary></indexterm>
721 <indexterm><primary>machine accounts</primary></indexterm>
722 <indexterm><primary>LDAP</primary></indexterm>
723                 Computer (machine) accounts can be placed wherever you like in an LDAP directory subject
724                 to some constraints that are described in this chapter.
725                 </para>
727                 <para>
728 <indexterm><primary>POSIX</primary></indexterm>
729 <indexterm><primary>sambaSamAccount</primary></indexterm>
730 <indexterm><primary>computer accounts</primary></indexterm>
731 <indexterm><primary>machine accounts</primary></indexterm>
732 <indexterm><primary>Windows NT4/200X</primary></indexterm>
733 <indexterm><primary>user account</primary></indexterm>
734 <indexterm><primary>trust accounts</primary></indexterm>
735                 The POSIX and sambaSamAccount components of computer (machine) accounts are both used by Samba.
736                 Thus, machine accounts are treated inside Samba in the same way that Windows NT4/200X treats
737                 them. A user account and a machine account are indistinguishable from each other, except that
738                 the machine account ends in a $ character, as do trust accounts.
739                 </para>
741                 <para>
742 <indexterm><primary>user</primary></indexterm>
743 <indexterm><primary>group</primary></indexterm>
744 <indexterm><primary>machine</primary></indexterm>
745 <indexterm><primary>trust</primary></indexterm>
746 <indexterm><primary>UID</primary></indexterm>
747                 The need for Windows user, group, machine, trust, and other accounts to be tied to a valid UNIX
748                 UID is a design decision that was made a long way back in the history of Samba development. It
749                 is unlikely that this decision will be reversed or changed during the remaining life of the
750                 Samba-3.x series.
751                 </para>
753                 <para>
754 <indexterm><primary>UID</primary></indexterm>
755 <indexterm><primary>SID</primary></indexterm>
756 <indexterm><primary>NSS</primary></indexterm>
757                 The resolution of a UID from the Windows SID is achieved within Samba through a mechanism that
758                 must refer back to the host operating system on which Samba is running. The NSS is the preferred
759                 mechanism that shields applications (like Samba) from the need to know everything about every
760                 host OS it runs on.
761                 </para>
763                 <para>
764 <indexterm><primary>UID</primary></indexterm>
765 <indexterm><primary>passwd</primary></indexterm>
766 <indexterm><primary>shadow</primary></indexterm>
767 <indexterm><primary>group</primary></indexterm>
768 <indexterm><primary>NSS</primary></indexterm>
769 <indexterm><primary>winbindd</primary></indexterm>
770 <indexterm><primary>LDAP</primary></indexterm>
771                 Samba asks the host OS to provide a UID via the <quote>passwd</quote>, <quote>shadow</quote>,
772                 and <quote>group</quote> facilities in the NSS control (configuration) file. The best tool
773                 for achieving this is left up to the UNIX administrator to determine. It is not imposed by
774                 Samba. Samba provides winbindd with its support libraries as one method. It is
775                 possible to do this via LDAP, and for that Samba provides the appropriate hooks so that
776                 all account entities can be located in an LDAP directory.
777                 </para>
779                 <para>
780 <indexterm><primary>PADL</primary></indexterm>
781 <indexterm><primary>nss_ldap</primary></indexterm>
782 <indexterm><primary>UID</primary></indexterm>
783 <indexterm><primary>LDAP</primary></indexterm>
784 <indexterm><primary>documentation</primary></indexterm>
785                 For many the weapon of choice is to use the PADL nss_ldap utility. This utility must
786                 be configured so that computer accounts can be resolved to a POSIX/UNIX account UID. That
787                 is fundamentally an LDAP design question.  The information provided on the Samba list and
788                 in the documentation is directed at providing working examples only. The design
789                 of an LDAP directory is a complex subject that is beyond the scope of this documentation.
790                 </para>
792         </sect2>
794 </sect1>
796 <sect1 id="acctmgmttools">
797 <title>Account Management Tools</title>
799 <para>
800 <indexterm><primary>pdbedit</primary></indexterm>
801 <indexterm><primary>machine accounts</primary></indexterm>
802 <indexterm><primary>management tools</primary></indexterm>
803 Samba provides two tools for management of user and machine accounts:
804 <command>smbpasswd</command> and <command>pdbedit</command>.
805 </para>
807 <para>
808 <indexterm><primary>pdbedit</primary></indexterm>
809 <indexterm><primary>password aging</primary></indexterm>
810 <indexterm><primary>failed logins</primary></indexterm>
811 The <command>pdbedit</command> can be used to manage account policies in addition to
812 Samba user account information. The policy management capability is used to administer
813 domain default settings for password aging and management controls to handle failed login
814 attempts.
815 </para>
817 <para>
818 <indexterm><primary>smbpasswd</primary></indexterm>
819 <indexterm><primary>storage mechanism</primary></indexterm>
820 <indexterm><primary>SambaSAMAccount</primary></indexterm>
821 <indexterm><primary>net</primary></indexterm>
822 Some people are confused when reference is made to <literal>smbpasswd</literal> because the
823 name refers to a storage mechanism for SambaSAMAccount information, but it is also the name
824 of a utility tool. That tool is destined to eventually be replaced by new functionality that
825 is being added to the <command>net</command> toolset (see <link linkend="NetCommand">the Net Command</link>).
826 </para>
828         <sect2>
829         <title>The <command>smbpasswd</command> Tool</title>
831                 <para>
832 <indexterm><primary>smbpasswd</primary></indexterm>
833 <indexterm><primary>passwd</primary></indexterm>
834 <indexterm><primary>yppasswd</primary></indexterm>
835 <indexterm><primary>passdb backend</primary></indexterm>
836 <indexterm><primary>storage methods</primary></indexterm>
837                 The <command>smbpasswd</command> utility is similar to the <command>passwd</command>
838                 and <command>yppasswd</command> programs. It maintains the two 32 byte password
839                 fields in the passdb backend. This utility operates independently of the actual
840                 account and password storage methods used (as specified by the <parameter>passdb
841                 backend</parameter> in the &smb.conf; file).
842                 </para>
844                 <para>
845 <indexterm><primary>smbpasswd</primary></indexterm>
846 <indexterm><primary>client-server mode</primary></indexterm>
847                 <command>smbpasswd</command> works in a client-server mode where it contacts the
848                 local smbd to change the user's password on its behalf. This has enormous benefits.
849                 </para>
851                 <para>
852 <indexterm><primary>smbpasswd</primary></indexterm>
853 <indexterm><primary>change passwords</primary></indexterm>
854                 <command>smbpasswd</command> has the capability to change passwords on Windows NT
855                 servers (this only works when the request is sent to the NT PDC if changing an NT
856                 domain user's password).
857                 </para>
859                 <para>
860                 <indexterm><primary>user management</primary></indexterm>
861                 <indexterm><primary>user account</primary><secondary>Adding/Deleting</secondary></indexterm>
862                 <command>smbpasswd</command> can be used to:
863                 </para>
865                 <itemizedlist>
866                         <listitem><para><emphasis>add</emphasis> user or machine accounts.</para></listitem>
867                         <listitem><para><emphasis>delete</emphasis> user or machine accounts.</para></listitem>
868                         <listitem><para><emphasis>enable</emphasis> user or machine accounts.</para></listitem>
869                         <listitem><para><emphasis>disable</emphasis> user or machine accounts.</para></listitem>
870                         <listitem><para><emphasis>set to NULL</emphasis> user passwords.</para></listitem>
871                         <listitem><para><emphasis>manage</emphasis> interdomain trust accounts.</para></listitem>
872                 </itemizedlist>
874                 <para>
875                 To run smbpasswd as a normal user, just type:
876                 </para>
878                 <para>
879 <screen>
880 &prompt;<userinput>smbpasswd</userinput>
881 <prompt>Old SMB password: </prompt><userinput><replaceable>secret</replaceable></userinput>
882 </screen>
883                 For <replaceable>secret</replaceable>, type the old value here or press return if
884                 there is no old password.
885 <screen>
886 <prompt>New SMB Password: </prompt><userinput><replaceable>new secret</replaceable></userinput>
887 <prompt>Repeat New SMB Password: </prompt><userinput><replaceable>new secret</replaceable></userinput>
888 </screen>
889                 </para>
891                 <para>
892                 If the old value does not match the current value stored for that user, or the two
893                 new values do not match each other, then the password will not be changed.
894                 </para>
896                 <para>
897 <indexterm><primary>SMB password</primary></indexterm>
898                 When invoked by an ordinary user, the command will allow only the user to change his or her own
899                 SMB password.
900                 </para>
902                 <para>
903 <indexterm><primary>smbpasswd</primary></indexterm>
904 <indexterm><primary>SMB password</primary></indexterm>
905                 When run by root, <command>smbpasswd</command> may take an optional argument specifying
906                 the username whose SMB password you wish to change. When run as root, <command>smbpasswd</command>
907                 does not prompt for or check the old password value, thus allowing root to set passwords
908                 for users who have forgotten their passwords.
909                 </para>
911                 <para>
912 <indexterm><primary>smbpasswd</primary></indexterm>
913 <indexterm><primary>passwd</primary></indexterm>
914 <indexterm><primary>yppasswd</primary></indexterm>
915 <indexterm><primary>change capabilities</primary></indexterm>
916                 <command>smbpasswd</command> is designed to work in the way familiar to UNIX
917                 users who use the <command>passwd</command> or <command>yppasswd</command> commands.
918                 While designed for administrative use, this tool provides essential user-level
919                 password change capabilities.
920                 </para>
922                 <para>
923 <indexterm><primary>smbpasswd</primary></indexterm>
924                 For more details on using <command>smbpasswd</command>, refer to the man page (the
925                 definitive reference).
926                 </para>
927         </sect2>
929         <sect2 id="pdbeditthing">
930         <title>The <command>pdbedit</command> Tool</title>
932                 <para>
933                 <indexterm><primary>pdbedit</primary></indexterm>
934                 <indexterm><primary>User Management</primary></indexterm>
935                 <indexterm><primary>account policy</primary></indexterm>
936                 <indexterm><primary>User Accounts</primary><secondary>Adding/Deleting</secondary></indexterm>
937                 <command>pdbedit</command> is a tool that can be used only by root. It is used to
938                 manage the passdb backend, as well as domain-wide account policy settings. <command>pdbedit</command>
939                 can be used to:
940                 </para>
942                 <itemizedlist>
943                         <listitem><para>add, remove, or modify user accounts.</para></listitem>
944                         <listitem><para>list user accounts.</para></listitem>
945                         <listitem><para>migrate user accounts.</para></listitem>
946                         <listitem><para>migrate group accounts.</para></listitem>
947                         <listitem><para>manage account policies.</para></listitem>
948                         <listitem><para>manage domain access policy settings.</para></listitem>
949                 </itemizedlist>
951                 <para>
952                 <indexterm><primary>Sarbanes-Oxley</primary></indexterm>
953                 Under the terms of the Sarbanes-Oxley Act of 2002, American businesses and organizations are mandated to
954                 implement a series of <literal>internal controls</literal> and procedures to communicate, store,
955                 and protect financial data. The Sarbanes-Oxley Act has far reaching implications in respect of:
956                 </para>
958                 <orderedlist>
959                         <listitem><para>Who has access to information systems that store financial data.</para></listitem>
960                         <listitem><para>How personal and financial information is treated among employees and business
961                                 partners.</para></listitem>
962                         <listitem><para>How security vulnerabilities are managed.</para></listitem>
963                         <listitem><para>Security and patch level maintenance for all information systems.</para></listitem>
964                         <listitem><para>How information systems changes are documented and tracked.</para></listitem>
965                         <listitem><para>How information access controls are implemented and managed.</para></listitem>
966                         <listitem><para>Auditability of all information systems in respect of change and security.</para></listitem>
967                         <listitem><para>Disciplinary procedures and controls to ensure privacy.</para></listitem>
968                 </orderedlist>
970                 <para>
971                 <indexterm><primary>accountability</primary></indexterm>
972                 <indexterm><primary>compliance</primary></indexterm>
973                 In short, the Sarbanes-Oxley Act of 2002 is an instrument that enforces accountability in respect of
974                 business related information systems so as to ensure the compliance of all information systems that
975                 are used to store personal information and particularly for financial records processing. Similar
976                 accountabilities are being demanded around the world.
977                 </para>
979                 <para>
980                 <indexterm><primary>laws</primary></indexterm>
981                 <indexterm><primary>regulations</primary></indexterm>
982                 <indexterm><primary>pdbedit</primary></indexterm>
983                 <indexterm><primary>access controls</primary></indexterm>
984                 <indexterm><primary>manage accounts</primary></indexterm>
985                 The need to be familiar with the Samba tools and facilities that permit information systems operation
986                 in compliance with government laws and regulations is clear to all. The <command>pdbedit</command> is
987                 currently the only Samba tool that provides the capacity to manage account and systems access controls
988                 and policies. During the remaining life-cycle of the Samba-3 series it is possible the new tools may
989                 be implemented to aid in this important area.
990                 </para>
992                 <para>
993                 Domain global policy controls available in Windows NT4 compared with Samba
994                 is shown in <link linkend="policycontrols">NT4 Domain v's Samba Policy Controls</link>.
995                 </para>
997                 <table id="policycontrols">
998                 <title>NT4 Domain v's Samba Policy Controls</title>
999             <tgroup cols="5">
1000                 <colspec align="left" colwidth="2*"/>
1001                 <colspec align="left" colwidth="2*"/>
1002                 <colspec align="center" colwidth="1*"/>
1003                 <colspec align="center" colwidth="1*"/>
1004                 <colspec align="center" colwidth="1*"/>
1005                 <thead>
1006                     <row>
1007                         <entry><para>NT4 policy Name</para></entry>
1008                         <entry><para>Samba Policy Name</para></entry>
1009                         <entry><para>NT4 Range</para></entry>
1010                         <entry><para>Samba Range</para></entry>
1011                         <entry><para>Samba Default</para></entry>
1012                     </row>
1013                 </thead>
1014                 <tbody>
1015                     <row>
1016                                         <entry><para>Maximum Password Age</para></entry>
1017                                         <entry><para>maximum password age</para></entry>
1018                                         <entry><para>0 - 999 (days)</para></entry>
1019                                         <entry><para>0 - 4294967295 (sec)</para></entry>
1020                                         <entry><para>4294967295</para></entry>
1021                     </row>
1022                     <row>
1023                                         <entry><para>Minimum Password Age</para></entry>
1024                                         <entry><para>minimum password age</para></entry>
1025                                         <entry><para>0 - 999 (days)</para></entry>
1026                                         <entry><para>0 - 4294967295 (sec)</para></entry>
1027                                         <entry><para>0</para></entry>
1028                     </row>
1029                     <row>
1030                                         <entry><para>Minimum Password Length</para></entry>
1031                                         <entry><para>min password length</para></entry>
1032                                         <entry><para>1 - 14 (Chars)</para></entry>
1033                                         <entry><para>0 - 4294967295 (Chars)</para></entry>
1034                                         <entry><para>5</para></entry>
1035                     </row>
1036                     <row>
1037                                         <entry><para>Password Uniqueness</para></entry>
1038                                         <entry><para>password history</para></entry>
1039                                         <entry><para>0 - 23 (#)</para></entry>
1040                                         <entry><para>0 - 4294967295 (#)</para></entry>
1041                                         <entry><para>0</para></entry>
1042                     </row>
1043                     <row>
1044                                         <entry><para>Account Lockout - Reset count after</para></entry>
1045                                         <entry><para>reset count minutes</para></entry>
1046                                         <entry><para>1 - 99998 (min)</para></entry>
1047                                         <entry><para>0 - 4294967295 (min)</para></entry>
1048                                         <entry><para>30</para></entry>
1049                     </row>
1050                     <row>
1051                                         <entry><para>Lockout after bad logon attempts</para></entry>
1052                                         <entry><para>bad lockout attempt</para></entry>
1053                                         <entry><para>0 - 998 (#)</para></entry>
1054                                         <entry><para>0 - 4294967295 (#)</para></entry>
1055                                         <entry><para>0</para></entry>
1056                     </row>
1057                     <row>
1058                                         <entry><para>*** Not Known ***</para></entry>
1059                                         <entry><para>disconnect time</para></entry>
1060                                         <entry><para>TBA</para></entry>
1061                                         <entry><para>0 - 4294967295</para></entry>
1062                                         <entry><para>0</para></entry>
1063                     </row>
1064                     <row>
1065                                         <entry><para>Lockout Duration</para></entry>
1066                                         <entry><para>lockout duration</para></entry>
1067                                         <entry><para>1 - 99998 (min)</para></entry>
1068                                         <entry><para>0 - 4294967295 (min)</para></entry>
1069                                         <entry><para>30</para></entry>
1070                     </row>
1071                     <row>
1072                                         <entry><para>Users must log on in order to change password</para></entry>
1073                                         <entry><para>user must logon to change password</para></entry>
1074                                         <entry><para>0/1</para></entry>
1075                                         <entry><para>0 - 4294967295</para></entry>
1076                                         <entry><para>0</para></entry>
1077                     </row>
1078                     <row>
1079                                         <entry><para>*** Registry Setting ***</para></entry>
1080                                         <entry><para>refuse machine password change</para></entry>
1081                                         <entry><para>0/1</para></entry>
1082                                         <entry><para>0 - 4294967295</para></entry>
1083                                         <entry><para>0</para></entry>
1084                     </row>
1085                                 </tbody>
1086                         </tgroup>
1087                 </table>
1089                 <para>
1090                 <indexterm><primary>pdbedit</primary></indexterm>
1091 <indexterm><primary>policy settings</primary></indexterm>
1092 <indexterm><primary>account security</primary></indexterm>
1093 <indexterm><primary>smbpasswd</primary></indexterm>
1094                 The <command>pdbedit</command> tool is the only one that can manage the account
1095                 security and policy settings. It is capable of all operations that smbpasswd can
1096                 do as well as a superset of them.
1097                 </para>
1099                 <para>
1100                 <indexterm><primary>pdbedit</primary></indexterm>
1101 <indexterm><primary>account import/export</primary></indexterm>
1102 <indexterm><primary>passdb backend</primary></indexterm>
1103                 One particularly important purpose of the <command>pdbedit</command> is to allow
1104                 the import/export of account information from one passdb backend to another.
1105                 </para>
1107                 <sect3>
1108                 <title>User Account Management</title>
1110                 <para>
1111 <indexterm><primary>pdbedit</primary></indexterm>
1112 <indexterm><primary>smbpasswd</primary></indexterm>
1113 <indexterm><primary>system accounts</primary></indexterm>
1114 <indexterm><primary>user account</primary></indexterm>
1115 <indexterm><primary>domain user manager</primary></indexterm>
1116 <indexterm><primary>add user script</primary></indexterm>
1117 <indexterm><primary>interface scripts</primary></indexterm>
1118                 The <command>pdbedit</command> tool, like the <command>smbpasswd</command> tool, requires
1119                 that a POSIX user account already exists in the UNIX/Linux system accounts database (backend).
1120                 Neither tool will call out to the operating system to create a user account because this is
1121                 considered to be the responsibility of the system administrator. When the Windows NT4 domain
1122                 user manager is used to add an account, Samba will implement the <literal>add user script</literal>
1123                 (as well as the other interface scripts) to ensure that user, group and machine accounts are
1124                 correctly created and changed. The use of the <command>pdbedit</command> tool does not
1125                 make use of these interface scripts.
1126                 </para>
1128                 <para>
1129 <indexterm><primary>pdbedit</primary></indexterm>
1130 <indexterm><primary>POSIX account</primary></indexterm>
1131                 Before attempting to use the <command>pdbedit</command> tool to manage user and machine
1132                 accounts, make certain that a system (POSIX) account has already been created.
1133                 </para>
1135                 <sect4>
1136                 <title>Listing User and Machine Accounts</title>
1138                 <para>
1139 <indexterm><primary>tdbsam</primary></indexterm>
1140 <indexterm><primary>password backend</primary></indexterm>
1141                 The following is an example of the user account information that is stored in
1142                 a tdbsam password backend. This listing was produced by running:
1143 <screen>
1144 &prompt;<userinput>pdbedit -Lv met</userinput>
1145 UNIX username:        met
1146 NT username:          met
1147 Account Flags:        [U          ]
1148 User SID:             S-1-5-21-1449123459-1407424037-3116680435-2004
1149 Primary Group SID:    S-1-5-21-1449123459-1407424037-3116680435-1201
1150 Full Name:            Melissa E Terpstra
1151 Home Directory:       \\frodo\met\Win9Profile
1152 HomeDir Drive:        H:
1153 Logon Script:         scripts\logon.bat
1154 Profile Path:         \\frodo\Profiles\met
1155 Domain:               &example.workgroup;
1156 Account desc:
1157 Workstations:         melbelle
1158 Munged dial:
1159 Logon time:           0
1160 Logoff time:          Mon, 18 Jan 2038 20:14:07 GMT
1161 Kickoff time:         Mon, 18 Jan 2038 20:14:07 GMT
1162 Password last set:    Sat, 14 Dec 2002 14:37:03 GMT
1163 Password can change:  Sat, 14 Dec 2002 14:37:03 GMT
1164 Password must change: Mon, 18 Jan 2038 20:14:07 GMT
1165 </screen>
1166                 </para>
1168                 <para>
1169 <indexterm><primary>smbpasswd format</primary></indexterm>
1170                 Accounts can also be listed in the older <literal>smbpasswd</literal> format:
1171 <screen>
1172 &rootprompt;<userinput>pdbedit -Lw</userinput>
1173 root:0:84B0D8E14D158FF8417EAF50CFAC29C3:
1174      AF6DD3FD4E2EA8BDE1695A3F05EFBF52:[U          ]:LCT-42681AB8:
1175 jht:1000:6BBC4159020A52741486235A2333E4D2:
1176      CC099521AD554A3C3CF2556274DBCFBC:[U          ]:LCT-40D75B5B:
1177 rcg:1002:E95D4331A6F23AF8AAD3B435B51404EE:
1178      BB0F2C39B04CA6100F0E535DF8314B43:[U          ]:LCT-40D7C5A3:
1179 afw:1003:1AAFA7F9F6DC1DEAAAD3B435B51404EE:
1180      CE92C2F9471594CDC4E7860CA6BC62DB:[T          ]:LCT-40DA501F:
1181 met:1004:A2848CB7E076B435AAD3B435B51404EE:
1182      F25F5D3405085C555236B80B7B22C0D2:[U          ]:LCT-4244FAB8:
1183 aurora$:1005:060DE593EA638B8ACC4A19F14D2FF2BB:
1184      060DE593EA638B8ACC4A19F14D2FF2BB:[W          ]:LCT-4173E5CC:
1185 temptation$:1006:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:
1186      A96703C014E404E33D4049F706C45EE9:[W          ]:LCT-42BF0C57:
1187 vaioboss$:1001:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:
1188      88A30A095160072784C88F811E89F98A:[W          ]:LCT-41C3878D:
1189 frodo$:1008:15891DC6B843ECA41249940C814E316B:
1190      B68EADCCD18E17503D3DAD3E6B0B9A75:[W          ]:LCT-42B7979F:
1191 marvel$:1011:BF709959C3C94E0B3958B7B84A3BB6F3:
1192      C610EFE9A385A3E8AA46ADFD576E6881:[W          ]:LCT-40F07A4
1193 </screen>
1194 <indexterm><primary>login id</primary></indexterm>
1195 <indexterm><primary>UID</primary></indexterm>
1196 <indexterm><primary>LanManger password</primary></indexterm>
1197 <indexterm><primary>NT password</primary></indexterm>
1198 <indexterm><primary>Account Flags</primary></indexterm>
1199 <indexterm><primary>LCT</primary><see>last change time</see></indexterm>
1200                 The account information that was returned by this command in order from left to right
1201                 consists of the following colon separated data:
1202                 </para>
1204                 <itemizedlist>
1205                         <listitem><para>Login ID.</para></listitem>
1206                         <listitem><para>UNIX UID.</para></listitem>
1207                         <listitem>
1208                                 <para>Microsoft LanManager password hash (password converted to upper-case then hashed).</para>
1209                         </listitem>
1210                         <listitem><para>Microsoft NT password hash (hash of the case-preserved password).</para></listitem>
1211                         <listitem><para>Samba SAM Account Flags.</para></listitem>
1212                         <listitem><para>The LCT data (password last change time).</para></listitem>
1213                 </itemizedlist>
1215                 <para>
1216 <indexterm><primary>Account Flags</primary></indexterm>
1217 <indexterm><primary>pdbedit</primary></indexterm>
1218                 The Account Flags parameters are documented in the <command>pdbedit</command> man page, and are
1219                 briefly documented in <link linkend="TOSHARG-acctflags">the Account Flags Management section</link>.
1220                 </para>
1222                 <para>
1223 <indexterm><primary>last change time</primary></indexterm>
1224                 The LCT data consists of 8 hexadecimal characters representing the time since January 1, 1970, of
1225                 the time when the password was last changed.
1226                 </para>
1228                 </sect4>
1230                 <sect4>
1231                 <title>Adding User Accounts</title>
1233                 <para>
1234 <indexterm><primary>pdbedit</primary></indexterm>
1235 <indexterm><primary>add a user account</primary></indexterm>
1236 <indexterm><primary>standalone server</primary></indexterm>
1237 <indexterm><primary>domain</primary></indexterm>
1238 <indexterm><primary>SambaSAMAccount</primary></indexterm>
1239                 The <command>pdbedit</command> can be used to add a user account to a standalone server
1240                 or to a domain. In the example shown here the account for the user <literal>vlaan</literal>
1241                 has been created before attempting to add the SambaSAMAccount.
1242 <screen>
1243 &rootprompt; pdbedit -a vlaan
1244 new password: secretpw
1245 retype new password: secretpw
1246 Unix username:        vlaan
1247 NT username:          vlaan
1248 Account Flags:        [U          ]
1249 User SID:             S-1-5-21-726309263-4128913605-1168186429-3014
1250 Primary Group SID:    S-1-5-21-726309263-4128913605-1168186429-513
1251 Full Name:            Victor Laan
1252 Home Directory:       \\frodo\vlaan
1253 HomeDir Drive:        H:
1254 Logon Script:         scripts\logon.bat
1255 Profile Path:         \\frodo\profiles\vlaan
1256 Domain:               &example.workgroup;
1257 Account desc:         Guest User
1258 Workstations:
1259 Munged dial:
1260 Logon time:           0
1261 Logoff time:          Mon, 18 Jan 2038 20:14:07 GMT
1262 Kickoff time:         Mon, 18 Jan 2038 20:14:07 GMT
1263 Password last set:    Wed, 29 Jun 2005 19:35:12 GMT
1264 Password can change:  Wed, 29 Jun 2005 19:35:12 GMT
1265 Password must change: Mon, 18 Jan 2038 20:14:07 GMT
1266 Last bad password   : 0
1267 Bad password count  : 0
1268 Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
1269 </screen>
1270                 </para>
1272                 </sect4>
1274                 <sect4>
1275                 <title>Deleting Accounts</title>
1277                 <para>
1278 <indexterm><primary>account deleted</primary></indexterm>
1279 <indexterm><primary>SambaSAMAccount</primary></indexterm>
1280 <indexterm><primary>pdbedit</primary></indexterm>
1281 <indexterm><primary>passdb backend</primary></indexterm>
1282                 An account can be deleted from the SambaSAMAccount database
1283 <screen>
1284 &rootprompt; pdbedit -x vlaan
1285 </screen>
1286                 The account is removed without further screen output. The account is removed only from the
1287                 SambaSAMAccount (passdb backend) database, it is not removed from the UNIX account backend.
1288                 </para>
1290                 <para>
1291 <indexterm><primary>delete user script</primary></indexterm>
1292 <indexterm><primary>pdbedit</primary></indexterm>
1293                 The use of the NT4 domain user manager to delete an account will trigger the <parameter>delete user
1294                 script</parameter>, but not the <command>pdbedit</command> tool.
1295                 </para>
1297                 </sect4>
1299                 <sect4>
1300                 <title>Changing User Accounts</title>
1302                 <para>
1303 <indexterm><primary>pdbedit</primary></indexterm>
1304                 Refer to the <command>pdbedit</command> man page for a full synopsis of all operations
1305                 that are available with this tool.
1306                 </para>
1308                 <para>
1309 <indexterm><primary>pdbedit</primary></indexterm>
1310                 An example of a simple change in the user account information is the change of the full name
1311                 information shown here:
1312 <screen>
1313 &rootprompt; pdbedit -r --fullname="Victor Aluicious Laan" vlaan
1315 Primary Group SID:    S-1-5-21-726309263-4128913605-1168186429-513
1316 Full Name:            Victor Aluicious Laan
1317 Home Directory:       \\frodo\vlaan
1319 </screen>
1320                 </para>
1322                 <para>
1323 <indexterm><primary>grace time</primary></indexterm>
1324 <indexterm><primary>password expired</primary></indexterm>
1325 <indexterm><primary>expired password</primary></indexterm>
1326                 Let us assume for a moment that a user's password has expired and the user is unable to
1327                 change the password at this time. It may be necessary to give the user additional grace time
1328                 so that it is possible to continue to work with the account and the original password. This
1329                 demonstrates how the password expiration settings may be updated
1330 <screen>
1331 &rootprompt; pdbedit -Lv vlaan
1333 Password last set:    Sun, 09 Sep 2001 22:21:40 GMT
1334 Password can change:  Thu, 03 Jan 2002 15:08:35 GMT
1335 Password must change: Thu, 03 Jan 2002 15:08:35 GMT
1336 Last bad password   : Thu, 03 Jan 2002 15:08:35 GMT
1337 Bad password count  : 2
1339 </screen>
1340 <indexterm><primary>bad logon attempts</primary></indexterm>
1341 <indexterm><primary>lock the account</primary></indexterm>
1342                 The user has recorded 2 bad logon attempts and the next will lock the account, but the
1343                 password is also expired. Here is how this account can be reset:
1344 <screen>
1345 &rootprompt; pdbedit -z vlaan
1347 Password last set:    Sun, 09 Sep 2001 22:21:40 GMT
1348 Password can change:  Thu, 03 Jan 2002 15:08:35 GMT
1349 Password must change: Thu, 03 Jan 2002 15:08:35 GMT
1350 Last bad password   : 0
1351 Bad password count  : 0
1353 </screen>
1354                 The <literal>Password must change:</literal> parameter can be reset like this:
1355 <screen>
1356 &rootprompt; pdbedit --pwd-must-change-time=1200000000 vlaan
1358 Password last set:    Sun, 09 Sep 2001 22:21:40 GMT
1359 Password can change:  Thu, 03 Jan 2002 15:08:35 GMT
1360 Password must change: Thu, 10 Jan 2008 14:20:00 GMT
1362 </screen>
1363                 Another way to use this tools is to set the date like this:
1364 <screen>
1365 &rootprompt; pdbedit --pwd-must-change-time="2010-01-01" \
1366               --time-format="%Y-%m-%d" vlaan
1368 Password last set:    Sun, 09 Sep 2001 22:21:40 GMT
1369 Password can change:  Thu, 03 Jan 2002 15:08:35 GMT
1370 Password must change: Fri, 01 Jan 2010 00:00:00 GMT
1372 </screen>
1373 <indexterm><primary>strptime</primary></indexterm>
1374 <indexterm><primary>time format</primary></indexterm>
1375                 Refer to the strptime man page for specific time format information.
1376                 </para>
1378                 <para>
1379 <indexterm><primary>pdbedit</primary></indexterm>
1380 <indexterm><primary>SambaSAMAccount</primary></indexterm>
1381                 Please refer to the pdbedit man page for further information relating to SambaSAMAccount
1382                 management.
1383                 </para>
1385                 <sect5 id="TOSHARG-acctflags">
1386                 <title>Account Flags Management</title>
1388                 <para>
1389 <indexterm><primary>Samba SAM account flags</primary></indexterm>
1390 <indexterm><primary>account control block</primary><see>ACB</see></indexterm>
1391 <indexterm><primary>account encode_bits</primary></indexterm>
1392 <indexterm><primary>account control flags</primary></indexterm>
1393                 The Samba SAM account flags are properly called the ACB (account control block) within
1394                 the Samba source code. In some parts of the Samba source code they are referred to as the
1395                 account encode_bits, and also as the account control flags.
1396                 </para>
1398                 <para>
1399 <indexterm><primary>pdbedit</primary></indexterm>
1400 <indexterm><primary>user account</primary></indexterm>
1401 <indexterm><primary>machine account</primary></indexterm>
1402 <indexterm><primary>trust account</primary></indexterm>
1403 <indexterm><primary>damaged data</primary></indexterm>
1404                 The manual adjustment of user, machine (workstation or server) or an inter-domain trust
1405                 account account flgas should not be necessary under normal conditions of use of Samba. On the other hand,
1406                 where this information becomes corrupted for some reason, the ability to correct the damaged data is certainly
1407                 useful. The tool of choice by which such correction can be affected is the <command>pdbedit</command> utility.
1408                 </para>
1410                 <para>
1411 <indexterm><primary>account flags</primary></indexterm>
1412 <indexterm><primary>LDAP directory</primary></indexterm>
1413                 There have been a few requests for information regarding the account flags from developers
1414                 who are creating their own Samba management tools. An example of a need for information regarding
1415                 the proper management of the account flags is evident when developing scripts that will be used
1416                 to manage an LDAP directory.
1417                 </para>
1419                 <para>
1420 <indexterm><primary>pdbedit</primary></indexterm>
1421 <indexterm><primary>account flag order</primary></indexterm>
1422                 The account flag field can contain up to 16 characters. Presently, only 11 are in use.
1423                 These are listed in <link linkend="accountflags">Samba SAM Account Control Block Flags</link>.
1424                 The order in which the flags are specified to the <command>pdbedit</command> command is not important.
1425                 In fact, they can be set without problem in any order in the SambaAcctFlags record in the LDAP directory.
1426                 </para>
1428                 <table frame="all" id="accountflags">
1429                 <title>Samba SAM Account Control Block Flags</title>
1430         <tgroup cols="2" align="center">
1431             <thead>
1432             <row><entry align="center">Flag</entry><entry>Description</entry></row>
1433             </thead>
1434             <tbody>
1435             <row>
1436                                 <entry align="center">D</entry>
1437                                 <entry align="left">Account is disabled.</entry>
1438                         </row>
1439             <row>
1440                                 <entry align="center">H</entry>
1441                                 <entry align="left">A home directory is required.</entry>
1442                         </row>
1443             <row>
1444                                 <entry align="center">I</entry>
1445                                 <entry align="left">An inter-domain trust account.</entry>
1446                         </row>
1447             <row>
1448                                 <entry align="center">L</entry>
1449                                 <entry align="left">Account has been auto-locked.</entry>
1450                         </row>
1451             <row>
1452                                 <entry align="center">M</entry>
1453                                 <entry align="left">An MNS (Microsoft network service) logon account.</entry>
1454                         </row>
1455             <row>
1456                                 <entry align="center">N</entry>
1457                                 <entry align="left">Password not required.</entry>
1458                         </row>
1459             <row>
1460                                 <entry align="center">S</entry>
1461                                 <entry align="left">A server trust account.</entry>
1462                         </row>
1463             <row>
1464                                 <entry align="center">T</entry>
1465                                 <entry align="left">Temporary duplicate account entry.</entry>
1466                         </row>
1467             <row>
1468                                 <entry align="center">U</entry>
1469                                 <entry align="left">A normal user account.</entry>
1470                         </row>
1471             <row>
1472                                 <entry align="center">W</entry>
1473                                 <entry align="left">A workstation trust account.</entry>
1474                         </row>
1475             <row>
1476                                 <entry align="center">X</entry>
1477                                 <entry align="left">Password does not expire.</entry>
1478                         </row>
1479             </tbody>
1480         </tgroup>
1481         </table>
1483                 <para>
1484 <indexterm><primary>pdbedit</primary></indexterm>
1485 <indexterm><primary>account control flags</primary></indexterm>
1486                 An example of use of the <command>pdbedit</command> utility to set the account control flags
1487                 is shown here:
1488 <screen>
1489 &rootprompt; pdbedit -r -c "[DLX]" jht
1490 Unix username:        jht
1491 NT username:          jht
1492 Account Flags:        [DHULX      ]
1493 User SID:             S-1-5-21-729263-4123605-1186429-3000
1494 Primary Group SID:    S-1-5-21-729263-4123605-1186429-513
1495 Full Name:            John H Terpstra,Utah Office
1496 Home Directory:       \\aurora\jht
1497 HomeDir Drive:        H:
1498 Logon Script:         scripts\logon.bat
1499 Profile Path:         \\aurora\profiles\jht
1500 Domain:               MIDEARTH
1501 Account desc:         BluntObject
1502 Workstations:
1503 Logon time:           0
1504 Logoff time:          Mon, 18 Jan 2038 20:14:07 GMT
1505 Kickoff time:         0
1506 Password last set:    Sun, 03 Jul 2005 23:19:18 GMT
1507 Password can change:  Sun, 03 Jul 2005 23:19:18 GMT
1508 Password must change: Mon, 18 Jan 2038 20:14:07 GMT
1509 Last bad password   : 0
1510 Bad password count  : 0
1511 Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
1512 </screen>
1513 <indexterm><primary>default settings</primary></indexterm>
1514         The flags can be reset to the default settings by executing:
1515 <screen>
1516 &rootprompt; pdbedit -r -c "[]" jht
1517 Unix username:        jht
1518 NT username:          jht
1519 Account Flags:        [U          ]
1520 User SID:             S-1-5-21-729263-4123605-1186429-3000
1521 Primary Group SID:    S-1-5-21-729263-4123605-1186429-513
1522 Full Name:            John H Terpstra,Utah Office
1523 Home Directory:       \\aurora\jht
1524 HomeDir Drive:        H:
1525 Logon Script:         scripts\logon.bat
1526 Profile Path:         \\aurora\profiles\jht
1527 Domain:               MIDEARTH
1528 Account desc:         BluntObject
1529 Workstations:
1530 Logon time:           0
1531 Logoff time:          Mon, 18 Jan 2038 20:14:07 GMT
1532 Kickoff time:         0
1533 Password last set:    Sun, 03 Jul 2005 23:19:18 GMT
1534 Password can change:  Sun, 03 Jul 2005 23:19:18 GMT
1535 Password must change: Mon, 18 Jan 2038 20:14:07 GMT
1536 Last bad password   : 0
1537 Bad password count  : 0
1538 Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
1539 </screen>
1540                 </para>
1542                 </sect5>
1544                 </sect4>
1546                 <sect4>
1547                 <title>Domain Account Policy Managment</title>
1549                 <para>
1550 <indexterm><primary>domain account access policies</primary></indexterm>
1551 <indexterm><primary>access policies</primary></indexterm>
1552                 To view the domain account access policies that may be configured execute:
1553 <screen>
1554 &rootprompt; pdbedit -P ?
1555 No account policy by that name
1556 Account policy names are :
1557 min password length
1558 password history
1559 user must logon to change password
1560 maximum password age
1561 minimum password age
1562 lockout duration
1563 reset count minutes
1564 bad lockout attempt
1565 disconnect time
1566 refuse machine password change
1567 </screen>
1568                 </para>
1570                 <para>
1571                 Commands will be executed to establish controls for our domain as follows:
1572                 </para>
1574                 <orderedlist>
1575                         <listitem><para>min password length = 8 characters.</para></listitem>
1576                         <listitem><para>password history = last 4 passwords.</para></listitem>
1577                         <listitem><para>maximum password age = 90 days.</para></listitem>
1578                         <listitem><para>minimum password age = 7 days.</para></listitem>
1579                         <listitem><para>bad lockout attempt = 8 bad logon attempts.</para></listitem>
1580                         <listitem><para>lockout duration = forever, account must be manually reenabled.</para></listitem>
1581                 </orderedlist>
1583                 <para>
1584                 The following command execution will achieve these settings:
1585 <screen>
1586 &rootprompt; pdbedit -P "min password length" -C 8
1587 account policy value for min password length was 5
1588 account policy value for min password length is now 8
1589 &rootprompt; pdbedit -P "password history" -C 4
1590 account policy value for password history was 0
1591 account policy value for password history is now 4
1592 &rootprompt; pdbedit -P "maximum password age" -C 7776000
1593 account policy value for maximum password age was 4294967295
1594 account policy value for maximum password age is now 7776000
1595 &rootprompt; pdbedit -P "minimum password age" -C 604800
1596 account policy value for minimum password age was 0
1597 account policy value for minimum password age is now 7
1598 &rootprompt; pdbedit -P "bad lockout attempt" -C 8
1599 account policy value for bad lockout attempt was 0
1600 account policy value for bad lockout attempt is now 8
1601 &rootprompt; pdbedit -P "lockout duration" -C -1
1602 account policy value for lockout duration was 30
1603 account policy value for lockout duration is now 4294967295
1604 </screen>
1605                 </para>
1607 <note><para>
1608 To set the maximum (infinite) lockout time use the value of -1.
1609 </para></note>
1611 <warning><para>
1612 Account policies must be set individually on each PDC and BDC. At this time (Samba 3.0.11 to Samba 3.0.14a)
1613 account policies are not replicated automatically. This may be fixed before Samba 3.0.20 ships or some
1614 time there after. Please check the WHATSNEW.txt file in the Samba-3 tarball for specific update notiations
1615 regarding this facility.
1616 </para></warning>
1618                 </sect4>
1620                 </sect3>
1622                 <sect3>
1623                 <title>Account Import/Export</title>
1625                 <para>
1626                 <indexterm><primary>pdbedit</primary></indexterm>
1627 <indexterm><primary>account import/export</primary></indexterm>
1628 <indexterm><primary>authentication</primary></indexterm>
1629                 The <command>pdbedit</command> tool allows import/export of authentication (account)
1630                 databases from one backend to another. For example, to import/export accounts from an
1631                 old <filename>smbpasswd</filename> database to a <parameter>tdbsam</parameter>
1632                 backend:
1633                 </para>
1635                 <procedure>
1636                         <step><para>
1637 <indexterm><primary>pdbedit</primary></indexterm>
1638 <screen>
1639 &rootprompt;<userinput>pdbedit -i smbpasswd -e tdbsam</userinput>
1640 </screen>
1641                         </para></step>
1643                         <step><para>
1644 <indexterm><primary>smbpasswd</primary></indexterm>
1645                         Replace the <parameter>smbpasswd</parameter> with <parameter>tdbsam</parameter> in the
1646                         <parameter>passdb backend</parameter> configuration in &smb.conf;.
1647                         </para></step>
1648                 </procedure>
1650         </sect3>
1651         </sect2>
1652 </sect1>
1654 <sect1>
1655 <title>Password Backends</title>
1657 <para>
1658 <indexterm><primary>account database</primary></indexterm>
1659 <indexterm><primary>SMB/CIFS server</primary></indexterm>
1660 Samba offers flexibility in backend account database design. The flexibility is immediately obvious as one
1661 begins to explore this capability. Recent changes to Samba (since 3.0.23) have removed the mulitple backend
1662 feature in order to simplify problems that broke some installations. This removal has made the internal
1663 operation of Samba-3 more consistent and predictable.
1664 </para>
1666 <para>
1667 <indexterm><primary>multiple backends</primary></indexterm>
1668 <indexterm><primary>tdbsam databases</primary></indexterm>
1669 Beginning with Samba 3.0.23 it is no longer possible to specify use of mulitple passdb backends. Earlier
1670 versions of Samba-3 made it possible to specify multiple password backends, and even multiple
1671 backends of the same type. The multiple passdb backend capability caused many problems with name to SID and
1672 SID to name ID resolution.  The Samba team wrestled with the challenges and decided that this feature needed
1673 to be removed.
1674 </para>
1676         <sect2>
1677         <title>Plaintext</title>
1679                 <para>
1680 <indexterm><primary>user database</primary></indexterm>
1681 <indexterm><primary>/etc/samba/smbpasswd</primary></indexterm>
1682 <indexterm><primary>/etc/smbpasswd</primary></indexterm>
1683 <indexterm><primary>password encryption</primary></indexterm>
1684 <indexterm><primary>/etc/passwd</primary></indexterm>
1685 <indexterm><primary>PAM</primary></indexterm>
1686                 Older versions of Samba retrieved user information from the UNIX user database
1687                 and eventually some other fields from the file <filename>/etc/samba/smbpasswd</filename>
1688                 or <filename>/etc/smbpasswd</filename>. When password encryption is disabled, no
1689                 SMB-specific data is stored at all. Instead, all operations are conducted via the way
1690                 that the Samba host OS will access its <filename>/etc/passwd</filename> database.
1691                 On most Linux systems, for example, all user and group resolution is done via PAM.
1692                 </para>
1694         </sect2>
1696         <sect2>
1697         <title>smbpasswd: Encrypted Password Database</title>
1699                 <para>
1700                 <indexterm><primary>SAM backend</primary><secondary>smbpasswd</secondary></indexterm>
1701 <indexterm><primary>user account</primary></indexterm>
1702 <indexterm><primary>LM/NT password hashes</primary></indexterm>
1703 <indexterm><primary>smbpasswd</primary></indexterm>
1704                 Traditionally, when configuring <smbconfoption name="encrypt passwords">yes</smbconfoption>
1705                 in Samba's &smb.conf; file, user account information such as username, LM/NT password hashes,
1706                 password change times, and account flags have been stored in the <filename>smbpasswd(5)</filename>
1707                 file. There are several disadvantages to this approach for sites with large numbers of users
1708                 (counted in the thousands).
1709                 </para>
1711                 <itemizedlist>
1712                 <listitem><para>
1713 <indexterm><primary>lookups</primary></indexterm>
1714                 The first problem is that all lookups must be performed sequentially. Given that
1715                 there are approximately two lookups per domain logon (one during initial logon validation
1716                 and one for a session connection setup, such as when mapping a network drive or printer), this
1717                 is a performance bottleneck for large sites. What is needed is an indexed approach
1718                 such as that used in databases.
1719                 </para></listitem>
1721                 <listitem><para>
1722 <indexterm><primary>smbpasswd</primary></indexterm>
1723 <indexterm><primary>replicate</primary></indexterm>
1724 <indexterm><primary>rsync</primary></indexterm>
1725 <indexterm><primary>ssh</primary></indexterm>
1726 <indexterm><primary>custom scripts</primary></indexterm>
1727                 The second problem is that administrators who desire to replicate an smbpasswd file
1728                 to more than one Samba server are left to use external tools such as
1729                 <command>rsync(1)</command> and <command>ssh(1)</command> and write custom,
1730                 in-house scripts.
1731                 </para></listitem>
1733                 <listitem><para>
1734 <indexterm><primary>smbpasswd</primary></indexterm>
1735 <indexterm><primary>home directory</primary></indexterm>
1736 <indexterm><primary>password expiration</primary></indexterm>
1737 <indexterm><primary>relative identifier</primary></indexterm>
1738 <indexterm><primary>relative identifier</primary><see>RID</see></indexterm>
1739                 Finally, the amount of information that is stored in an smbpasswd entry leaves
1740                 no room for additional attributes such as a home directory, password expiration time,
1741                 or even a relative identifier (RID).
1742                 </para></listitem>
1743                 </itemizedlist>
1745                 <para>
1746 <indexterm><primary>user attributes</primary></indexterm>
1747 <indexterm><primary>smbd</primary></indexterm>
1748 <indexterm><primary>API</primary></indexterm>
1749 <indexterm><primary>samdb interface</primary></indexterm>
1750                 As a result of these deficiencies, a more robust means of storing user attributes
1751                 used by smbd was developed. The API that defines access to user accounts
1752                 is commonly referred to as the samdb interface (previously, this was called the passdb
1753                 API and is still so named in the Samba source code trees).
1754                 </para>
1756                 <para>
1757 <indexterm><primary>passdb backends</primary></indexterm>
1758 <indexterm><primary>smbpasswd plaintext database</primary></indexterm>
1759 <indexterm><primary>tdbsam</primary></indexterm>
1760 <indexterm><primary>ldapsam</primary></indexterm>
1761 <indexterm><primary>enterprise</primary></indexterm>
1762                 Samba provides an enhanced set of passdb backends that overcome the deficiencies
1763                 of the smbpasswd plaintext database. These are tdbsam and ldapsam.
1764                 Of these, ldapsam will be of most interest to large corporate or enterprise sites.
1765                 </para>
1767         </sect2>
1769         <sect2>
1770         <title>tdbsam</title>
1772                 <para>
1773                 <indexterm><primary>SAM backend</primary><secondary>tdbsam</secondary></indexterm>
1774 <indexterm><primary>trivial database</primary><see>TDB</see></indexterm>
1775 <indexterm><primary>machine account</primary></indexterm>
1776                 Samba can store user and machine account data in a <quote>TDB</quote> (trivial database).
1777                 Using this backend does not require any additional configuration. This backend is
1778                 recommended for new installations that do not require LDAP.
1779                 </para>
1781                 <para>
1782 <indexterm><primary>tdbsam</primary></indexterm>
1783 <indexterm><primary>PDC</primary></indexterm>
1784 <indexterm><primary>BDC</primary></indexterm>
1785 <indexterm><primary>scalability</primary></indexterm>
1786                 As a general guide, the Samba Team does not recommend using the tdbsam backend for sites
1787                 that have 250 or more users. Additionally, tdbsam is not capable of scaling for use
1788                 in sites that require PDB/BDC implementations that require replication of the account
1789                 database. Clearly, for reason of scalability, the use of ldapsam should be encouraged.
1790                 </para>
1792                 <para>
1793 <indexterm><primary>250-user limit</primary></indexterm>
1794 <indexterm><primary>performance-based</primary></indexterm>
1795 <indexterm><primary>tdbsam</primary></indexterm>
1796                 The recommendation of a 250-user limit is purely based on the notion that this
1797                 would generally involve a site that has routed networks, possibly spread across
1798                 more than one physical location. The Samba Team has not at this time established
1799                 the performance-based scalability limits of the tdbsam architecture.
1800                 </para>
1802                 <para>
1803 <indexterm><primary>4,500 user accounts</primary></indexterm>
1804 <indexterm><primary>passdb backend</primary></indexterm>
1805 <indexterm><primary>tdbsam</primary></indexterm>
1806 <indexterm><primary>SambaSAMAccount</primary></indexterm>
1807                 There are sites that have thousands of users and yet require only one server.
1808                 One site recently reported having 4,500 user accounts on one UNIX system and
1809                 reported excellent performance with the <literal>tdbsam</literal> passdb backend.
1810                 The limitation of where the <literal>tdbsam</literal> passdb backend can be used
1811                 is not one pertaining to a limitation in the TDB storage system, it is based
1812                 only on the need for a reliable distribution mechanism for the SambaSAMAccount
1813                 backend.
1814                 </para>
1816         </sect2>
1818         <sect2>
1819         <title>ldapsam</title>
1821                 <para>
1822 <indexterm><primary>LDAP</primary></indexterm>
1823 <indexterm><primary>ldapsam</primary></indexterm>
1824                 <indexterm><primary>SAM backend</primary><secondary>ldapsam</secondary></indexterm>
1825                 There are a few points to stress that the ldapsam does not provide. The LDAP
1826                 support referred to in this documentation does not include:
1827                 </para>
1829                 <itemizedlist>
1830                         <listitem><para>A means of retrieving user account information from
1831                         a Windows 200x Active Directory server.</para></listitem>
1832                         <listitem><para>A means of replacing /etc/passwd.</para></listitem>
1833                 </itemizedlist>
1835                 <para>
1836 <indexterm><primary>LDAP</primary></indexterm>
1837 <indexterm><primary>NSS</primary></indexterm>
1838 <indexterm><primary>PAM</primary></indexterm>
1839 <indexterm><primary>LGPL</primary></indexterm>
1840                 The second item can be accomplished by using LDAP NSS and PAM modules. LGPL versions of these libraries can be
1841                 obtained from <ulink url="http://www.padl.com/">PADL Software</ulink>.  More information about the
1842                 configuration of these packages may be found in <ulink url="http://safari.oreilly.com/?XmlId=1-56592-491-6">
1843                 <emphasis>LDAP, System Administration</emphasis> by Gerald Carter, Chapter 6, Replacing NIS"</ulink>.
1844                 </para>
1846                 <para>
1847 <indexterm><primary>LDAP directory</primary></indexterm>
1848 <indexterm><primary>smbpasswd</primary></indexterm>
1849 <indexterm><primary>directory server</primary></indexterm>
1850                 This document describes how to use an LDAP directory for storing Samba user
1851                 account information traditionally stored in the smbpasswd(5) file. It is
1852                 assumed that the reader already has a basic understanding of LDAP concepts
1853                 and has a working directory server already installed. For more information
1854                 on LDAP architectures and directories, please refer to the following sites:
1855                 </para>
1857                 <itemizedlist>
1858                         <listitem><para><ulink url="http://www.openldap.org/">OpenLDAP</ulink></para></listitem>
1859                         <listitem><para><ulink url="http://www.sun.com/software/products/directory_srvr_ee/index.xml">
1860                                 Sun One Directory Server</ulink></para></listitem>
1861                         <listitem><para><ulink url="http://www.novell.com/products/edirectory/">Novell eDirectory</ulink></para></listitem>
1862                         <listitem><para><ulink url="http://www-306.ibm.com/software/tivoli/products/directory-server/">IBM
1863                                 Tivoli Directory Server</ulink></para></listitem>
1864                         <listitem><para><ulink url="http://www.redhat.com/software/rha/directory/">Red Hat Directory
1865                                 Server</ulink></para></listitem>
1866                         <listitem><para><ulink url="http://www.linuxsecurity.com/content/view/119229">Fedora Directory
1867                                 Server</ulink></para></listitem>
1868                 </itemizedlist>
1870                 <para>
1871                 Two additional Samba resources that may prove to be helpful are:
1872                 </para>
1874                 <itemizedlist>
1875                         <listitem><para>
1876 <indexterm><primary>Samba-PDC-LDAP-HOWTO</primary></indexterm>
1877                         The <ulink url="http://www.unav.es/cti/ldap-smb/ldap-smb-3-howto.html">Samba-PDC-LDAP-HOWTO</ulink>
1878                         maintained by Ignacio Coupeau.
1879                         </para></listitem>
1881                         <listitem><para>
1882 <indexterm><primary>IDEALX</primary></indexterm>
1883 <indexterm><primary>NT migration scripts</primary></indexterm>
1884 <indexterm><primary>smbldap-tools</primary></indexterm>
1885                         The NT migration scripts from <ulink url="http://samba.idealx.org/">IDEALX</ulink> that are
1886                         geared to manage users and groups in such a Samba-LDAP domain controller configuration.
1887                         Idealx also produced the smbldap-tools and the Interactive Console Management tool.
1888                         </para></listitem>
1889                 </itemizedlist>
1891                 <sect3>
1892                 <title>Supported LDAP Servers</title>
1894                         <para>
1895 <indexterm><primary>LDAP</primary></indexterm>
1896 <indexterm><primary>ldapsam</primary></indexterm>
1897 <indexterm><primary>OpenLDAP</primary></indexterm>
1898 <indexterm><primary>Netscape's Directory Server</primary></indexterm>
1899                         The LDAP ldapsam code was developed and tested using the OpenLDAP 2.x server and
1900                         client libraries. The same code should work with Netscape's Directory Server and client SDK.
1901                         However, there are bound to be compile errors and bugs. These should not be hard to fix.
1902                         Please submit fixes via the process outlined in <link linkend="bugreport">Reporting Bugs</link>.
1903                         </para>
1905                         <para>
1906                         Samba is capable of working with any standards-compliant LDAP server.
1907                         </para>
1909                 </sect3>
1911                 <sect3>
1912                 <title>Schema and Relationship to the RFC 2307 posixAccount</title>
1915                         <para>
1916                         Samba-3.0 includes the necessary schema file for OpenLDAP 2.x in the
1917                         <filename>examples/LDAP/samba.schema</filename> directory of the source code distribution
1918                         tarball. The schema entry for the sambaSamAccount ObjectClass is shown here:
1919 <programlisting>
1920 ObjectClass (1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY
1921     DESC 'Samba-3.0 Auxiliary SAM Account'
1922     MUST ( uid $ sambaSID )
1923     MAY  ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $
1924           sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $
1925           sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $
1926           displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $
1927           sambaProfilePath $ description $ sambaUserWorkstations $
1928           sambaPrimaryGroupSID $ sambaDomainName ))
1929 </programlisting>
1930                         </para>
1932                         <para>
1933 <indexterm><primary>samba.schema</primary></indexterm>
1934 <indexterm><primary>OpenLDAP</primary></indexterm>
1935 <indexterm><primary>OID</primary></indexterm>
1936                         The <filename>samba.schema</filename> file has been formatted for OpenLDAP 2.0/2.1.
1937                         The Samba Team owns the OID space used by the above schema and recommends its use.
1938                         If you translate the schema to be used with Netscape DS, please submit the modified
1939                         schema file as a patch to <ulink url="mailto:jerry@samba.org">jerry@samba.org</ulink>.
1940                         </para>
1942                         <para>
1943 <indexterm><primary>smbpasswd</primary></indexterm>
1944 <indexterm><primary>/etc/passwd</primary></indexterm>
1945 <indexterm><primary>sambaSamAccount</primary></indexterm>
1946 <indexterm><primary>AUXILIARY</primary></indexterm>
1947 <indexterm><primary>ObjectClass</primary></indexterm>
1948 <indexterm><primary>LDAP</primary></indexterm>
1949 <indexterm><primary>RFC 2307.</primary></indexterm>
1950                         Just as the smbpasswd file is meant to store information that provides information
1951                         additional to  a user's <filename>/etc/passwd</filename> entry, so is the sambaSamAccount
1952                         object meant to supplement the UNIX user account information. A sambaSamAccount is an
1953                         <constant>AUXILIARY</constant> ObjectClass, so it can be used to augment existing
1954                         user account information in the LDAP directory, thus providing information needed
1955                         for Samba account handling. However, there are several fields (e.g., uid) that overlap
1956                         with the posixAccount ObjectClass outlined in RFC 2307. This is by design.
1957                         </para>
1959                         <para>
1960 <indexterm><primary>account information</primary></indexterm>
1961 <indexterm><primary>sambaSamAccount</primary></indexterm>
1962 <indexterm><primary>posixAccount</primary></indexterm>
1963 <indexterm><primary>ObjectClasses</primary></indexterm>
1964 <indexterm><primary>smbd</primary></indexterm>
1965 <indexterm><primary>getpwnam</primary></indexterm>
1966 <indexterm><primary>LDAP</primary></indexterm>
1967 <indexterm><primary>NIS</primary></indexterm>
1968 <indexterm><primary>NSS</primary></indexterm>
1969                         In order to store all user account information (UNIX and Samba) in the directory,
1970                         it is necessary to use the sambaSamAccount and posixAccount ObjectClasses in
1971                         combination. However, <command>smbd</command> will still obtain the user's UNIX account
1972                         information via the standard C library calls, such as getpwnam().
1973                         This means that the Samba server must also have the LDAP NSS library installed
1974                         and functioning correctly. This division of information makes it possible to
1975                         store all Samba account information in LDAP, but still maintain UNIX account
1976                         information in NIS while the network is transitioning to a full LDAP infrastructure.
1977                         </para>
1978                 </sect3>
1980                 <sect3>
1981                 <title>OpenLDAP Configuration</title>
1983                 <para>
1984 <indexterm><primary>sambaSamAccount</primary></indexterm>
1985 <indexterm><primary>OpenLDAP</primary></indexterm>
1986 <indexterm><primary>slapd</primary></indexterm>
1987 <indexterm><primary>samba.schema</primary></indexterm>
1988                 To include support for the sambaSamAccount object in an OpenLDAP directory
1989                 server, first copy the samba.schema file to slapd's configuration directory.
1990                 The samba.schema file can be found in the directory <filename>examples/LDAP</filename>
1991                 in the Samba source distribution.
1992 <screen>
1993 &rootprompt;<userinput>cp samba.schema /etc/openldap/schema/</userinput>
1994 </screen>
1995                 </para>
1997                 <para>
1998 <indexterm><primary>samba.schema</primary></indexterm>
1999 <indexterm><primary>slapd.conf</primary></indexterm>
2000 <indexterm><primary>sambaSamAccount</primary></indexterm>
2001 <indexterm><primary>cosine.schema</primary></indexterm>
2002 <indexterm><primary>uid</primary></indexterm>
2003 <indexterm><primary>inetorgperson.schema</primary></indexterm>
2004 <indexterm><primary>displayName</primary></indexterm>
2005 <indexterm><primary>attribute</primary></indexterm>
2006                 Next, include the <filename>samba.schema</filename> file in <filename>slapd.conf</filename>.
2007                 The sambaSamAccount object contains two attributes that depend on other schema
2008                 files. The <parameter>uid</parameter> attribute is defined in <filename>cosine.schema</filename> and
2009                 the <parameter>displayName</parameter> attribute is defined in the <filename>inetorgperson.schema</filename>
2010                 file. Both of these must be included before the <filename>samba.schema</filename> file.
2011 <programlisting>
2012 ## /etc/openldap/slapd.conf
2014 ## schema files (core.schema is required by default)
2015 include            /etc/openldap/schema/core.schema
2017 ## needed for sambaSamAccount
2018 include            /etc/openldap/schema/cosine.schema
2019 include            /etc/openldap/schema/inetorgperson.schema
2020 include            /etc/openldap/schema/nis.schema
2021 include            /etc/openldap/schema/samba.schema
2022 ....
2023 </programlisting>
2024                 </para>
2026                 <para>
2027 <indexterm><primary>sambaSamAccount</primary></indexterm>
2028 <indexterm><primary>posixAccount</primary></indexterm>
2029 <indexterm><primary>posixGroup</primary></indexterm>
2030 <indexterm><primary>ObjectClasses</primary></indexterm>
2031                 It is recommended that you maintain some indices on some of the most useful attributes,
2032                 as in the following example, to speed up searches made on sambaSamAccount ObjectClasses
2033                 (and possibly posixAccount and posixGroup as well):
2034                 </para>
2036 <para>
2037 <programlisting>
2038 # Indices to maintain
2039 ## required by OpenLDAP
2040 index objectclass             eq
2042 index cn                      pres,sub,eq
2043 index sn                      pres,sub,eq
2044 ## required to support pdb_getsampwnam
2045 index uid                     pres,sub,eq
2046 ## required to support pdb_getsambapwrid()
2047 index displayName             pres,sub,eq
2049 ## uncomment these if you are storing posixAccount and
2050 ## posixGroup entries in the directory as well
2051 ##index uidNumber               eq
2052 ##index gidNumber               eq
2053 ##index memberUid               eq
2055 index   sambaSID              eq
2056 index   sambaPrimaryGroupSID  eq
2057 index   sambaDomainName       eq
2058 index   default               sub
2059 </programlisting>
2060 </para>
2062                 <para>
2063                 Create the new index by executing:
2064 <screen>
2065 &rootprompt;./sbin/slapindex -f slapd.conf
2066 </screen>
2067                 </para>
2069                 <para>
2070                 Remember to restart slapd after making these changes:
2071 <screen>
2072 &rootprompt;<userinput>/etc/init.d/slapd restart</userinput>
2073 </screen>
2074                 </para>
2076                 </sect3>
2078                 <sect3>
2079                 <title>Initialize the LDAP Database</title>
2081                 <para>
2082 <indexterm><primary>LDAP database</primary></indexterm>
2083 <indexterm><primary>account containers</primary></indexterm>
2084 <indexterm><primary>LDIF file</primary></indexterm>
2085 <indexterm><primary>DNS</primary></indexterm>
2086                 Before you can add accounts to the LDAP database, you must create the account containers
2087                 that they will be stored in. The following LDIF file should be modified to match your
2088                 needs (DNS entries, and so on):
2089 <programlisting>
2090 # Organization for Samba Base
2091 dn: dc=quenya,dc=org
2092 objectclass: dcObject
2093 objectclass: organization
2094 dc: quenya
2095 o: Quenya Org Network
2096 description: The Samba-3 Network LDAP Example
2098 # Organizational Role for Directory Management
2099 dn: cn=Manager,dc=quenya,dc=org
2100 objectclass: organizationalRole
2101 cn: Manager
2102 description: Directory Manager
2104 # Setting up container for Users OU
2105 dn: ou=People,dc=quenya,dc=org
2106 objectclass: top
2107 objectclass: organizationalUnit
2108 ou: People
2110 # Setting up admin handle for People OU
2111 dn: cn=admin,ou=People,dc=quenya,dc=org
2112 cn: admin
2113 objectclass: top
2114 objectclass: organizationalRole
2115 objectclass: simpleSecurityObject
2116 userPassword: {SSHA}c3ZM9tBaBo9autm1dL3waDS21+JSfQVz
2118 # Setting up container for groups
2119 dn: ou=Groups,dc=quenya,dc=org
2120 objectclass: top
2121 objectclass: organizationalUnit
2122 ou: Groups
2124 # Setting up admin handle for Groups OU
2125 dn: cn=admin,ou=Groups,dc=quenya,dc=org
2126 cn: admin
2127 objectclass: top
2128 objectclass: organizationalRole
2129 objectclass: simpleSecurityObject
2130 userPassword: {SSHA}c3ZM9tBaBo9autm1dL3waDS21+JSfQVz
2132 # Setting up container for computers
2133 dn: ou=Computers,dc=quenya,dc=org
2134 objectclass: top
2135 objectclass: organizationalUnit
2136 ou: Computers
2138 # Setting up admin handle for Computers OU
2139 dn: cn=admin,ou=Computers,dc=quenya,dc=org
2140 cn: admin
2141 objectclass: top
2142 objectclass: organizationalRole
2143 objectclass: simpleSecurityObject
2144 userPassword: {SSHA}c3ZM9tBaBo9autm1dL3waDS21+JSfQVz
2145 </programlisting>
2146                 </para>
2148                 <para>
2149 <indexterm><primary>userPassword</primary></indexterm>
2150 <indexterm><primary>slappasswd</primary></indexterm>
2151                 The userPassword shown above should be generated using <command>slappasswd</command>.
2152                 </para>
2154                 <para>
2155 <indexterm><primary>LDIF</primary></indexterm>
2156 <indexterm><primary>LDAP</primary></indexterm>
2157                 The following command will then load the contents of the LDIF file into the LDAP
2158                 database.
2159 <indexterm><primary>slapadd</primary></indexterm>
2160 <screen>
2161 &prompt;<userinput>slapadd -v -l initldap.dif</userinput>
2162 </screen>
2163                 </para>
2165                 <para>
2166                 Do not forget to secure your LDAP server with an adequate access control list
2167                 as well as an admin password.
2168                 </para>
2170                 <note><para>
2171 <indexterm><primary>secrets.tdb</primary></indexterm>
2172                 Before Samba can access the LDAP server, you need to store the LDAP admin password
2173                 in the Samba-3 <filename>secrets.tdb</filename> database by:
2174 <indexterm><primary>smbpasswd</primary></indexterm>
2175 <screen>
2176 &rootprompt;<userinput>smbpasswd -w <replaceable>secret</replaceable></userinput>
2177 </screen>
2178                 </para></note>
2180                 </sect3>
2182                 <sect3>
2183                 <title>Configuring Samba</title>
2185                         <para>
2186 <indexterm><primary>LDAP</primary></indexterm>
2187 <indexterm><primary>smbd</primary></indexterm>
2188                         The following parameters are available in &smb.conf; only if your version of Samba was built with
2189                         LDAP support. Samba automatically builds with LDAP support if the LDAP libraries are found. The
2190                         best method to verify that Samba was built with LDAP support is:
2191 <screen>
2192 &rootprompt; smbd -b | grep LDAP
2193    HAVE_LDAP_H
2194    HAVE_LDAP
2195    HAVE_LDAP_DOMAIN2HOSTLIST
2196    HAVE_LDAP_INIT
2197    HAVE_LDAP_INITIALIZE
2198    HAVE_LDAP_SET_REBIND_PROC
2199    HAVE_LIBLDAP
2200    LDAP_SET_REBIND_PROC_ARGS
2201 </screen>
2202                         If the build of the <command>smbd</command> command you are using does not produce output
2203                         that includes <literal>HAVE_LDAP_H</literal> it is necessary to discover why the LDAP headers
2204                         and libraries were not found during compilation.
2205                         </para>
2207                         <para>LDAP-related smb.conf options include these:
2208                         <smbconfblock>
2209                         <smbconfoption name="passdb backend">ldapsam:url</smbconfoption>
2210                         <smbconfoption name="ldap admin dn"/>
2211                         <smbconfoption name="ldap delete dn"/>
2212                         <smbconfoption name="ldap filter"/>
2213                         <smbconfoption name="ldap group suffix"/>
2214                         <smbconfoption name="ldap idmap suffix"/>
2215                         <smbconfoption name="ldap machine suffix"/>
2216                         <smbconfoption name="ldap passwd sync"/>
2217                         <smbconfoption name="ldap ssl"/>
2218                         <smbconfoption name="ldap suffix"/>
2219                         <smbconfoption name="ldap user suffix"/>
2220                         <smbconfoption name="ldap replication sleep"/>
2221                         <smbconfoption name="ldap timeout"/>
2222                         <smbconfoption name="ldap page size"/>
2223                         </smbconfblock>
2224                         </para>
2226                         <para>
2227                         These are described in the &smb.conf; man page and so are not repeated here. However, an example
2228                         for use with an LDAP directory is shown in <link linkend="confldapex">the Configuration with LDAP.</link>
2229                         </para>
2231 <example id="confldapex">
2232 <title>Configuration with LDAP</title>
2233 <smbconfblock>
2234 <smbconfsection name="[global]"/>
2235 <smbconfoption name="security">user</smbconfoption>
2236 <smbconfoption name="encrypt passwords">yes</smbconfoption>
2237 <smbconfoption name="netbios name">MORIA</smbconfoption>
2238 <smbconfoption name="workgroup">NOLDOR</smbconfoption>
2240 <smbconfcomment>LDAP related parameters:</smbconfcomment>
2242 <smbconfcomment>Define the DN used when binding to the LDAP servers.</smbconfcomment>
2243 <smbconfcomment>The password for this DN is not stored in smb.conf</smbconfcomment>
2244 <smbconfcomment>Set it using 'smbpasswd -w secret' to store the</smbconfcomment>
2245 <smbconfcomment>passphrase in the secrets.tdb file.</smbconfcomment>
2246 <smbconfcomment>If the "ldap admin dn" value changes, it must be reset.</smbconfcomment>
2247 <smbconfoption name="ldap admin dn">"cn=Manager,dc=quenya,dc=org"</smbconfoption>
2249 <smbconfcomment>SSL directory connections can be configured by:</smbconfcomment>
2250 <smbconfcomment>('off', 'start tls', or 'on' (default))</smbconfcomment>
2251 <smbconfoption name="ldap ssl">start tls</smbconfoption>
2253 <smbconfcomment>syntax: passdb backend = ldapsam:ldap://server-name[:port]</smbconfcomment>
2254 <smbconfoption name="passdb backend">ldapsam:ldap://frodo.quenya.org</smbconfoption>
2256 <smbconfcomment>smbpasswd -x delete the entire dn-entry</smbconfcomment>
2257 <smbconfoption name="ldap delete dn">no</smbconfoption>
2259 <smbconfcomment>The machine and user suffix are added to the base suffix</smbconfcomment>
2260 <smbconfcomment>wrote WITHOUT quotes. NULL suffixes by default</smbconfcomment>
2261 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
2262 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
2263 <smbconfoption name="ldap machine suffix">ou=Computers</smbconfoption>
2265 <smbconfcomment>Trust UNIX account information in LDAP</smbconfcomment>
2266 <smbconfcomment> (see the smb.conf man page for details)</smbconfcomment>
2268 <smbconfcomment>Specify the base DN to use when searching the directory</smbconfcomment>
2269 <smbconfoption name="ldap suffix">dc=quenya,dc=org</smbconfoption>
2270 </smbconfblock>
2271 </example>
2273                 </sect3>
2275                 <sect3>
2276                 <title>Accounts and Groups Management</title>
2278                         <para>
2279                         <indexterm><primary>User Management</primary></indexterm>
2280                         <indexterm><primary>User Accounts</primary><secondary>Adding/Deleting</secondary></indexterm>
2281                         Because user accounts are managed through the sambaSamAccount ObjectClass, you should
2282                         modify your existing administration tools to deal with sambaSamAccount attributes.
2283                         </para>
2285                         <para>
2286 <indexterm><primary>sambaSamAccount</primary></indexterm>
2287 <indexterm><primary>/etc/openldap/sldap.conf</primary></indexterm>
2288 <indexterm><primary>NSS</primary></indexterm>
2289                         Machine accounts are managed with the sambaSamAccount ObjectClass, just
2290                         like user accounts. However, it is up to you to store those accounts
2291                         in a different tree of your LDAP namespace. You should use
2292                         <quote>ou=Groups,dc=quenya,dc=org</quote> to store groups and
2293                         <quote>ou=People,dc=quenya,dc=org</quote> to store users. Just configure your
2294                         NSS and PAM accordingly (usually, in the <filename>/etc/openldap/sldap.conf</filename>
2295                         configuration file).
2296                         </para>
2298                         <para>
2299 <indexterm><primary>POSIX</primary></indexterm>
2300 <indexterm><primary>posixGroup</primary></indexterm>
2301 <indexterm><primary>Domain Groups</primary></indexterm>
2302 <indexterm><primary>ADS</primary></indexterm>
2303                         In Samba-3, the group management system is based on POSIX
2304                         groups. This means that Samba makes use of the posixGroup ObjectClass.
2305                         For now, there is no NT-like group system management (global and local
2306                         groups). Samba-3 knows only about <constant>Domain Groups</constant>
2307                         and, unlike MS Windows 2000 and Active Directory, Samba-3 does not
2308                         support nested groups.
2309                         </para>
2311                 </sect3>
2313                 <sect3>
2314                 <title>Security and sambaSamAccount</title>
2317                         <para>
2318 <indexterm><primary>sambaSAMAccount</primary></indexterm>
2319                         There are two important points to remember when discussing the security
2320                         of sambaSAMAccount entries in the directory.
2321                         </para>
2323                         <itemizedlist>
2324                                 <listitem><para><emphasis>Never</emphasis> retrieve the SambaLMPassword or
2325 <indexterm><primary>SambaNTPassword</primary></indexterm>
2326                                 SambaNTPassword attribute values over an unencrypted LDAP session.</para></listitem>
2327                                 <listitem><para><emphasis>Never</emphasis> allow non-admin users to
2328                                 view the SambaLMPassword or SambaNTPassword attribute values.</para></listitem>
2329                         </itemizedlist>
2331                         <para>
2332 <indexterm><primary>clear-text</primary></indexterm>
2333 <indexterm><primary>impersonate</primary></indexterm>
2334 <indexterm><primary>LM/NT password hashes</primary></indexterm>
2335                         These password hashes are clear-text equivalents and can be used to impersonate
2336                         the user without deriving the original clear-text strings. For more information
2337                         on the details of LM/NT password hashes, refer to <link linkend="passdb">the
2338                         Account Information Database section</link>.
2339                         </para>
2341                         <para>
2342 <indexterm><primary>encrypted session</primary></indexterm>
2343 <indexterm><primary>StartTLS</primary></indexterm>
2344 <indexterm><primary>LDAPS</primary></indexterm>
2345 <indexterm><primary>secure communications</primary></indexterm>
2346                         To remedy the first security issue, the <smbconfoption name="ldap ssl"/> &smb.conf;
2347                         parameter defaults to require an encrypted session (<smbconfoption name="ldap
2348                         ssl">on</smbconfoption>) using the default port of <constant>636</constant> when
2349                         contacting the directory server. When using an OpenLDAP server, it
2350                         is possible to use the StartTLS LDAP extended operation in the place of LDAPS.
2351                         In either case, you are strongly encouraged to use secure communications protocols
2352                         (so do not set <smbconfoption name="ldap ssl">off</smbconfoption>).
2353                         </para>
2355                         <para>
2356 <indexterm><primary>LDAPS</primary></indexterm>
2357 <indexterm><primary>StartTLS</primary></indexterm>
2358 <indexterm><primary>LDAPv3</primary></indexterm>
2359                         Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS
2360                         extended operation. However, the OpenLDAP library still provides support for
2361                         the older method of securing communication between clients and servers.
2362                         </para>
2364                         <para>
2365 <indexterm><primary>harvesting password hashes</primary></indexterm>
2366 <indexterm><primary>ACL</primary></indexterm>
2367 <indexterm><primary>slapd.conf</primary></indexterm>
2368                         The second security precaution is to prevent non-administrative users from
2369                         harvesting password hashes from the directory. This can be done using the
2370                         following ACL in <filename>slapd.conf</filename>:
2371                         </para>
2373 <para>
2374 <programlisting>
2375 ## allow the "ldap admin dn" access, but deny everyone else
2376 access to attrs=SambaLMPassword,SambaNTPassword
2377      by dn="cn=Samba Admin,ou=People,dc=quenya,dc=org" write
2378      by * none
2379 </programlisting>
2380 </para>
2382                 </sect3>
2384                 <sect3>
2385                 <title>LDAP Special Attributes for sambaSamAccounts</title>
2387                         <para> The sambaSamAccount ObjectClass is composed of the attributes shown in next tables: <link
2388                         linkend="attribobjclPartA">Part A</link>, and <link linkend="attribobjclPartB">Part B</link>.
2389                         </para>
2391                         <table frame="all" id="attribobjclPartA">
2392                                 <title>Attributes in the sambaSamAccount ObjectClass (LDAP), Part A</title>
2393                         <tgroup cols="2" align="justify">
2394                                         <colspec align="left"/>
2395                                         <colspec align="justify" colwidth="1*"/>
2396                         <tbody>
2397                                 <row><entry><constant>sambaLMPassword</constant></entry><entry>The LanMan password 16-byte hash stored as a character
2398                                                 representation of a hexadecimal string.</entry></row>
2399                                 <row><entry><constant>sambaNTPassword</constant></entry><entry>The NT password 16-byte hash stored as a character
2400                                                 representation of a hexadecimal string.</entry></row>
2401                                 <row><entry><constant>sambaPwdLastSet</constant></entry><entry>The integer time in seconds since 1970 when the
2402                                                 <constant>sambaLMPassword</constant> and <constant>sambaNTPassword</constant> attributes were last set.
2403                                 </entry></row>
2405                                 <row><entry><constant>sambaAcctFlags</constant></entry><entry>String of 11 characters surrounded by square brackets [ ]
2406                                                 representing account flags such as U (user), W (workstation), X (no password expiration),
2407                                                 I (domain trust account), H (home dir required), S (server trust account),
2408                                                 and D (disabled).</entry></row>
2410                                 <row><entry><constant>sambaLogonTime</constant></entry><entry>Integer value currently unused.</entry></row>
2412                                 <row><entry><constant>sambaLogoffTime</constant></entry><entry>Integer value currently unused.</entry></row>
2414                                 <row><entry><constant>sambaKickoffTime</constant></entry><entry>Specifies the time (UNIX time format) when the user
2415                                 will be locked down and cannot login any longer. If this attribute is omitted, then the account will never expire.
2416                                 Using this attribute together with shadowExpire of the shadowAccount ObjectClass will enable accounts to
2417                                 expire completely on an exact date.</entry></row>
2419                                 <row><entry><constant>sambaPwdCanChange</constant></entry><entry>Specifies the time (UNIX time format)
2420                                 after which the user is allowed to change his password. If this attribute is not set, the user will be free
2421                                 to change his password whenever he wants.</entry></row>
2423                                 <row><entry><constant>sambaPwdMustChange</constant></entry><entry>Specifies the time (UNIX time format) when the user is
2424                                 forced to change his password. If this value is set to 0, the user will have to change his password at first login.
2425                                 If this attribute is not set, then the password will never expire.</entry></row>
2427                                 <row><entry><constant>sambaHomeDrive</constant></entry><entry>Specifies the drive letter to which to map the
2428                                 UNC path specified by sambaHomePath. The drive letter must be specified in the form <quote>X:</quote>
2429                                 where X is the letter of the drive to map. Refer to the <quote>logon drive</quote> parameter in the
2430                                 smb.conf(5) man page for more information.</entry></row>
2432                                 <row><entry><constant>sambaLogonScript</constant></entry><entry>The sambaLogonScript property specifies the path of
2433                                 the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path
2434                                 is relative to the netlogon share. Refer to the <smbconfoption name="logon script"/> parameter in the
2435                                 &smb.conf; man page for more information.</entry></row>
2437                                 <row><entry><constant>sambaProfilePath</constant></entry><entry>Specifies a path to the user's profile.
2438                                 This value can be a null string, a local absolute path, or a UNC path. Refer to the
2439                                 <smbconfoption name="logon path"/> parameter in the &smb.conf; man page for more information.</entry></row>
2441                                 <row><entry><constant>sambaHomePath</constant></entry><entry>The sambaHomePath property specifies the path of
2442                                 the home directory for the user. The string can be null. If sambaHomeDrive is set and specifies
2443                                 a drive letter, sambaHomePath should be a UNC path. The path must be a network
2444                                 UNC path of the form <filename>\\server\share\directory</filename>. This value can be a null string.
2445                                 Refer to the <command>logon home</command> parameter in the &smb.conf; man page for more information.
2446                                 </entry></row>
2447                         </tbody>
2448                         </tgroup></table>
2451                         <table frame="all" id="attribobjclPartB">
2452                                 <title>Attributes in the sambaSamAccount ObjectClass (LDAP), Part B</title>
2453                         <tgroup cols="2" align="justify">
2454                                         <colspec align="left"/>
2455                                         <colspec align="justify" colwidth="1*"/>
2456                         <tbody>
2457                                 <row><entry><constant>sambaUserWorkstations</constant></entry><entry>Here you can give a comma-separated list of machines
2458                                 on which the user is allowed to login. You may observe problems when you try to connect to a Samba domain member.
2459                                 Because domain members are not in this list, the domain controllers will reject them. Where this attribute is omitted,
2460                                 the default implies no restrictions.
2461                                 </entry></row>
2463                                 <row><entry><constant>sambaSID</constant></entry><entry>The security identifier(SID) of the user.
2464                                 The Windows equivalent of UNIX UIDs.</entry></row>
2466                                 <row><entry><constant>sambaPrimaryGroupSID</constant></entry><entry>The security identifier (SID) of the primary group
2467                                 of the user.</entry></row>
2469                                 <row><entry><constant>sambaDomainName</constant></entry><entry>Domain the user is part of.</entry></row>
2470                         </tbody>
2471                         </tgroup></table>
2474                         <para>
2475 <indexterm><primary>PDC</primary></indexterm>
2476 <indexterm><primary>sambaSamAccount</primary></indexterm>
2477                         The majority of these parameters are only used when Samba is acting as a PDC of
2478                         a domain (refer to <link linkend="samba-pdc">Domain Control</link>, for details on
2479                         how to configure Samba as a PDC). The following four attributes
2480                         are only stored with the sambaSamAccount entry if the values are non-default values:
2481                         </para>
2483                         <itemizedlist>
2484 <indexterm><primary>sambaHomePath</primary></indexterm>
2485 <indexterm><primary>sambaLogonScript</primary></indexterm>
2486 <indexterm><primary>sambaProfilePath</primary></indexterm>
2487 <indexterm><primary>sambaHomeDrive</primary></indexterm>
2488                                 <listitem><para>sambaHomePath</para></listitem>
2489                                 <listitem><para>sambaLogonScript</para></listitem>
2490                                 <listitem><para>sambaProfilePath</para></listitem>
2491                                 <listitem><para>sambaHomeDrive</para></listitem>
2492                         </itemizedlist>
2494                         <para>
2495 <indexterm><primary>sambaSamAccount</primary></indexterm>
2496 <indexterm><primary>PDC</primary></indexterm>
2497 <indexterm><primary>smbHome</primary></indexterm>
2498                         These attributes are only stored with the sambaSamAccount entry if
2499                         the values are non-default values. For example, assume MORIA has now been
2500                         configured as a PDC and that <smbconfoption name="logon home">\\%L\%u</smbconfoption> was defined in
2501                         its &smb.conf; file. When a user named <quote>becky</quote> logs on to the domain,
2502                         the <smbconfoption name="logon home"/> string is expanded to \\MORIA\becky.
2503                         If the smbHome attribute exists in the entry <quote>uid=becky,ou=People,dc=samba,dc=org</quote>,
2504                         this value is used. However, if this attribute does not exist, then the value
2505                         of the <smbconfoption name="logon home"/> parameter is used in its place. Samba
2506                         will only write the attribute value to the directory entry if the value is
2507                         something other than the default (e.g., <filename>\\MOBY\becky</filename>).
2508                         </para>
2510                 </sect3>
2512                 <sect3>
2513                 <title>Example LDIF Entries for a sambaSamAccount</title>
2515                         <para>
2516                         The following is a working LDIF that demonstrates the use of the SambaSamAccount ObjectClass:
2517 <programlisting>
2518 dn: uid=guest2, ou=People,dc=quenya,dc=org
2519 sambaLMPassword: 878D8014606CDA29677A44EFA1353FC7
2520 sambaPwdMustChange: 2147483647
2521 sambaPrimaryGroupSID: S-1-5-21-2447931902-1787058256-3961074038-513
2522 sambaNTPassword: 552902031BEDE9EFAAD3B435B51404EE
2523 sambaPwdLastSet: 1010179124
2524 sambaLogonTime: 0
2525 objectClass: sambaSamAccount
2526 uid: guest2
2527 sambaKickoffTime: 2147483647
2528 sambaAcctFlags: [UX         ]
2529 sambaLogoffTime: 2147483647
2530 sambaSID: S-1-5-21-2447931902-1787058256-3961074038-5006
2531 sambaPwdCanChange: 0
2532 </programlisting>
2533                         </para>
2535                         <para>
2536                         The following is an LDIF entry for using both the sambaSamAccount and
2537                         posixAccount ObjectClasses:
2538 <programlisting>
2539 dn: uid=gcarter, ou=People,dc=quenya,dc=org
2540 sambaLogonTime: 0
2541 displayName: Gerald Carter
2542 sambaLMPassword: 552902031BEDE9EFAAD3B435B51404EE
2543 sambaPrimaryGroupSID: S-1-5-21-2447931902-1787058256-3961074038-1201
2544 objectClass: posixAccount
2545 objectClass: sambaSamAccount
2546 sambaAcctFlags: [UX         ]
2547 userPassword: {crypt}BpM2ej8Rkzogo
2548 uid: gcarter
2549 uidNumber: 9000
2550 cn: Gerald Carter
2551 loginShell: /bin/bash
2552 logoffTime: 2147483647
2553 gidNumber: 100
2554 sambaKickoffTime: 2147483647
2555 sambaPwdLastSet: 1010179230
2556 sambaSID: S-1-5-21-2447931902-1787058256-3961074038-5004
2557 homeDirectory: /home/moria/gcarter
2558 sambaPwdCanChange: 0
2559 sambaPwdMustChange: 2147483647
2560 sambaNTPassword: 878D8014606CDA29677A44EFA1353FC7
2561 </programlisting>
2562                 </para>
2564                 </sect3>
2566                 <sect3>
2567                 <title>Password Synchronization</title>
2569                 <para>
2570                 Samba-3 and later can update the non-Samba (LDAP) password stored with an account. When
2571                 using pam_ldap, this allows changing both UNIX and Windows passwords at once.
2572                 </para>
2574                 <para>The <smbconfoption name="ldap passwd sync"/> options can have the  values shown in
2575                 <link linkend="ldappwsync">Possible <emphasis>ldap passwd sync</emphasis> Values</link>.</para>
2577                 <table frame="all" id="ldappwsync">
2578                 <title>Possible <parameter>ldap passwd sync</parameter> Values</title>
2579                 <tgroup cols="2">
2580                         <colspec align="left" colwidth="1*"/>
2581                         <colspec align="justify" colwidth="4*"/>
2582                 <thead>
2583                         <row><entry align="left">Value</entry><entry align="center">Description</entry></row>
2584                 </thead>
2585                 <tbody>
2586                 <row><entry>yes</entry><entry><para>When the user changes his password, update
2587                                <constant>SambaNTPassword</constant>, <constant>SambaLMPassword</constant>,
2588                                and the <constant>password</constant> fields.</para></entry></row>
2590                 <row><entry>no</entry><entry><para>Only update <constant>SambaNTPassword</constant> and
2591                                         <constant>SambaLMPassword</constant>.</para></entry></row>
2593                 <row><entry>only</entry><entry><para>Only update the LDAP password and let the LDAP server
2594                         worry about the other fields.  This option is only available on some LDAP servers and
2595                         only when the LDAP server supports LDAP_EXOP_X_MODIFY_PASSWD.</para></entry></row>
2596                 </tbody>
2597                 </tgroup>
2598                 </table>
2601                 <para>More information can be found in the &smb.conf; man page.</para>
2603                 </sect3>
2605                 <sect3>
2606                 <title>Using OpenLDAP Overlay for Password Synchronization</title>
2608                 <para>
2609                 Howard Chu has written a special overlay called <command>smbk5pwd</command>. This tool  modifies the
2610                 <literal>SambaNTPassword</literal>, <literal>SambaLMPassword</literal> and <literal>Heimdal</literal>
2611                 hashes in an OpenLDAP entry when an LDAP_EXOP_X_MODIFY_PASSWD operation is performed.
2612                 </para>
2614                 <para>
2615                 The overlay is shipped with OpenLDAP-2.3 and can be found in the
2616                 <filename>contrib/slapd-modules/smbk5pwd</filename> subdirectory. This module can also be used with
2617                 OpenLDAP-2.2.
2618                 </para>
2620                 </sect3>
2622         </sect2>
2624 </sect1>
2626 <sect1>
2627 <title>Common Errors</title>
2629         <sect2>
2630                 <title>Users Cannot Logon</title>
2632                 <para><quote>I've installed Samba, but now I can't log on with my UNIX account! </quote></para>
2634                 <para>Make sure your user has been added to the current Samba <smbconfoption name="passdb backend"/>.
2635                 Read the <link linkend="acctmgmttools">Account Management Tools</link> for details.</para>
2637         </sect2>
2639         <sect2>
2640         <title>Configuration of <parameter>auth methods</parameter></title>
2642         <para>
2643         When explicitly setting an <smbconfoption name="auth methods"/> parameter,
2644         <parameter>guest</parameter> must be specified as the first entry on the line &smbmdash;
2645         for example, <smbconfoption name="auth methods">guest sam</smbconfoption>.
2646         </para>
2648         </sect2>
2650 </sect1>
2652 </chapter>