Minor fixups.
[import/samba-docs-svnimport.git] / Samba3-HOWTO / TOSHARG-FastStart.xml
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="FastStart">
4 <chapterinfo>
5         &author.jht;
6 </chapterinfo>
7
8 <title>Fast Start: Cure for Impatience</title>
9
10 <para>
11 When we first asked for suggestions for inclusion in the Samba HOWTO documentation,
12 someone wrote asking for example configurations &smbmdash; and lots of them. That is remarkably
13 difficult to do without losing a lot of value that can be derived from presenting
14 many extracts from working systems. That is what the rest of this document does.
15 It does so with extensive descriptions of the configuration possibilities within the
16 context of the chapter that covers it. We hope that this chapter is the medicine 
17 that has been requested.
18 </para>
19
20 <para>
21 The information in this chapter is very sparse compared with the book <quote>Samba-3 by Example</quote>
22 that was written after the original version of this book was nearly complete. <quote>Samba-3 by Example</quote>
23 was the result of feedback from reviewers during the final copy editing of the first edition. It
24 was interesting to see that reader feedback mirrored that given by the original reviewers.
25 In any case, a month and a half was spent in doing basic research to better understand what
26 new as well as experienced network administrators would best benefit from. The book <quote>Samba-3 by Example</quote>
27 is the result of that research. What is presented in the few pages of this book is covered
28 far more comprehensively in the second edition of <quote>Samba-3 by Example</quote>. The second edition
29 of both books will be released at the same time.
30 </para>
31
32 <para>
33 So in summary, the book <quote>The Official Samba-3 HOWTO &amp; Reference Guide</quote> is intended
34 as the equivalent of an auto mechanic's repair guide. The book <quote>Samba-3 by Example</quote> is the
35 equivalent of the driver's guide that explains how to drive the car. If you want complete network
36 configuration examples, go to <ulink url="http://www.samba.org/samba/docs/Samba3-ByExample.pdf">Samba-3 by
37 Example</ulink>.
38 </para>
39
40 <sect1>
41 <title>Features and Benefits</title>
42
43 <para>
44 Samba needs very little configuration to create a basic working system.
45 In this chapter we progress from the simple to the complex, for each providing
46 all steps and configuration file changes needed to make each work. Please note
47 that a comprehensively configured system will likely employ additional smart
48 features. These additional features are covered in the remainder of this document.
49 </para>
50
51 <para>
52 The examples used here have been obtained from a number of people who made
53 requests for example configurations. All identities have been obscured to protect
54 the guilty, and any resemblance to unreal nonexistent sites is deliberate.
55 </para>
56
57 </sect1>
58
59 <sect1>
60 <title>Description of Example Sites</title>
61
62 <para>
63 In the first set of configuration examples we consider the case of exceptionally simple system requirements.
64 There is a real temptation to make something that should require little effort much too complex.
65 </para>
66
67 <para>
68 <link linkend="anon-ro"></link> documents the type of server that might be sufficient to serve CD-ROM images,
69 or reference document files for network client use. This configuration is also discussed in <link
70 linkend="StandAloneServer"></link>, <link linkend="RefDocServer"></link>.  The purpose for this configuration
71 is to provide a shared volume that is read-only that anyone, even guests, can access.
72 </para>
73
74 <para>
75 The second example shows a minimal configuration for a print server that anyone can print to as long as they
76 have the correct printer drivers installed on their computer. This is a mirror of the system described in
77 <link linkend="StandAloneServer"></link>, <link linkend="SimplePrintServer"></link>.
78 </para>
79
80 <para>
81 The next example is of a secure office file and print server that will be accessible only to users who have an
82 account on the system. This server is meant to closely resemble a workgroup file and print server, but has to
83 be more secure than an anonymous access machine.  This type of system will typically suit the needs of a small
84 office. The server provides no network logon facilities, offers no domain control; instead it is just a
85 network-attached storage (NAS) device and a print server.
86 </para>
87
88 <para>
89 The later example consider more complex systems that will either integrate into existing MS Windows networks
90 or replace them entirely. These cover domain member servers as well as Samba domain control (PDC/BDC) and
91 finally describes in detail a large distributed network with branch offices in remote locations.
92 </para>
93
94 </sect1>
95
96 <sect1>
97 <title>Worked Examples</title>
98
99 <para>
100 The configuration examples are designed to cover everything necessary to get Samba 
101 running. They do not cover basic operating system platform configuration, which is
102 clearly beyond the scope of this text.
103 </para>
104
105 <para>
106 It is also assumed that Samba has been correctly installed, either by way of installation
107 of the packages that are provided by the operating system vendor or through other means.
108 </para>
109
110         <sect2>
111         <title>Standalone Server</title>
112
113         <para>
114         <indexterm><primary>Server Type</primary><secondary>Stand-alone</secondary></indexterm>
115         A standalone server implies no more than the fact that it is not a domain controller
116         and it does not participate in domain control. It can be a simple, workgroup-like
117         server, or it can be a complex server that is a member of a domain security context.
118         </para>
119
120         <para>
121         As the examples are developed, every attempt is made to progress the system toward greater capability, just as
122         one might expect would happen in a real business office as that office grows in size and its needs change.
123         </para>
124
125                 <sect3 id="anon-ro">
126                 <title>Anonymous Read-Only Document Server</title>
127
128                 <para>
129                 <indexterm><primary>read only</primary><secondary>server</secondary></indexterm>
130                 The purpose of this type of server is to make available to any user
131                 any documents or files that are placed on the shared resource. The
132                 shared resource could be a CD-ROM drive, a CD-ROM image, or a file
133                 storage area.
134                 </para>
135
136                 <itemizedlist>
137                         <listitem><para>
138                         The file system share point will be <filename>/export</filename>.
139                         </para></listitem>
140
141                         <listitem><para>
142                         All files will be owned by a user called Jack Baumbach.
143                         Jack's login name will be <emphasis>jackb</emphasis>. His password will be
144                         <emphasis>m0r3pa1n</emphasis> &smbmdash; of course, that's just the example we are
145                         using; do not use this in a production environment because
146                         all readers of this document will know it.
147                         </para></listitem>
148                 </itemizedlist>
149
150                 <procedure>
151                 <title>Installation Procedure: Read-Only Server</title>
152                         <step><para>
153                         Add user to system (with creation of the user's home directory):
154 <screen>
155 &rootprompt;<userinput>useradd -c "Jack Baumbach" -m -g users -p m0r3pa1n jackb</userinput>
156 </screen>
157                         </para></step>
158
159                         <step><para>
160                         Create directory, and set permissions and ownership:
161 <screen>
162 &rootprompt;<userinput>mkdir /export</userinput>
163 &rootprompt;<userinput>chmod u+rwx,g+rx,o+rx /export</userinput>
164 &rootprompt;<userinput>chown jackb.users /export</userinput>
165 </screen>
166                         </para></step>
167
168                         <step><para>
169                         Copy the files that should be shared to the <filename>/export</filename>
170                         directory.
171                         </para></step>
172
173                         <step><para>
174                         Install the Samba configuration file (<filename>/etc/samba/smb.conf</filename>)
175                         as shown in <link linkend="anon-example">Anonymous Read-Only Server Configuration</link>.
176                         </para></step>
177
178 <example id="anon-example">
179 <title>Anonymous Read-Only Server Configuration</title>
180 <smbconfblock>
181 <smbconfcomment>Global parameters</smbconfcomment>
182 <smbconfsection name="[global]"/>
183 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
184 <smbconfoption name="netbios name">HOBBIT</smbconfoption>
185 <smbconfoption name="security">share</smbconfoption>
186
187 <smbconfsection name="[data]"/>
188 <smbconfoption name="comment">Data</smbconfoption>
189 <smbconfoption name="path">/export</smbconfoption>
190 <smbconfoption name="read only">Yes</smbconfoption>
191 <smbconfoption name="guest ok">Yes</smbconfoption>
192 </smbconfblock>
193 </example>
194
195                         <step><para>
196                         Test the configuration file by executing the following command:
197 <screen>
198 &rootprompt;<userinput>testparm</userinput>
199 </screen>
200                         Alternatively, where you are operating from a master configuration file called
201                         <filename>smb.conf.master</filename>, the following sequence of commands might prove
202                         more appropriate:
203 <screen>
204 &rootprompt; cd /etc/samba
205 &rootprompt; testparm -s smb.conf.master > smb.conf
206 &rootprompt; testparm
207 </screen>
208                         Note any error messages that might be produced. Proceed only if error-free output has been
209                         obtained. An example of typical output that should be generated from the above configuration
210                         file is shown here:
211 <screen>
212 Load smb config files from /etc/samba/smb.conf
213 Processing section "[data]"
214 Loaded services file OK.
215 Server role: ROLE_STANDALONE
216 Press enter to see a dump of your service definitions
217 <userinput>[Press enter]</userinput>
218
219 # Global parameters
220 [global]
221         workgroup = MIDEARTH
222         netbios name = HOBBIT
223         security = share
224
225 [data]
226         comment = Data
227         path = /export
228         read only = Yes
229         guest only = Yes
230 </screen>
231                         </para></step>
232
233                         <step><para>
234                         Start Samba using the method applicable to your operating system platform. The method that
235                         should be used is platform dependent. Refer to <link linkend="startingSamba">Starting Samba</link>
236                         for further information regarding the starting of Samba.
237                         </para></step>
238
239                         <step><para>
240                         Configure your MS Windows client for workgroup <emphasis>MIDEARTH</emphasis>,
241                         set the machine name to ROBBINS, reboot, wait a few (2 - 5) minutes,
242                         then open Windows Explorer and visit the Network Neighborhood.
243                         The machine HOBBIT should be visible. When you click this machine
244                         icon, it should open up to reveal the <emphasis>data</emphasis> share. After
245                         you click the share, it should open up to reveal the files previously
246                         placed in the <filename>/export</filename> directory.
247                         </para></step>
248                 </procedure>
249
250                 <para>
251                 The information above (following # Global parameters) provides the complete
252                 contents of the <filename>/etc/samba/smb.conf</filename> file.
253                 </para>
254
255                 </sect3>
256
257                 <sect3>
258                 <title>Anonymous Read-Write Document Server</title>
259
260                 <para>
261                 <indexterm><primary>anonymous</primary><secondary>read-write server</secondary></indexterm>
262                 We should view this configuration as a progression from the previous example.
263                 The difference is that shared access is now forced to the user identity of jackb
264                 and to the primary group jackb belongs to. One other refinement we can make is to
265                 add the user <emphasis>jackb</emphasis> to the <filename>smbpasswd</filename> file.
266                 To do this, execute:
267 <screen>
268 &rootprompt;<userinput>smbpasswd -a jackb</userinput>
269 New SMB password: <userinput>m0r3pa1n</userinput>
270 Retype new SMB password: <userinput>m0r3pa1n</userinput>
271 Added user jackb.
272 </screen>
273                 Addition of this user to the <filename>smbpasswd</filename> file allows all files
274                 to be displayed in the Explorer Properties boxes as belonging to <emphasis>jackb</emphasis>
275                 instead of to <emphasis>User Unknown</emphasis>.
276                 </para>
277
278                 <para>
279                 The complete, modified &smb.conf; file is as shown in <link linkend="anon-rw"/>.
280                 </para>
281
282 <example id="anon-rw">
283 <title>Modified Anonymous Read-Write smb.conf</title>
284 <smbconfblock>
285 <smbconfcomment>Global parameters</smbconfcomment>
286 <smbconfsection name="[global]"/>
287 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
288 <smbconfoption name="netbios name">HOBBIT</smbconfoption>
289 <smbconfoption name="security">SHARE</smbconfoption>
290
291 <smbconfsection name="[data]"/>
292 <smbconfoption name="comment">Data</smbconfoption>
293 <smbconfoption name="path">/export</smbconfoption>
294 <smbconfoption name="force user">jackb</smbconfoption>
295 <smbconfoption name="force group">users</smbconfoption>
296 <smbconfoption name="read only">No</smbconfoption>
297 <smbconfoption name="guest ok">Yes</smbconfoption>
298 </smbconfblock>
299 </example>
300
301                 </sect3>
302
303                 <sect3>
304                 <title>Anonymous Print Server</title>
305
306                 <para>
307                 <indexterm><primary>anonymous</primary><secondary>print server</secondary></indexterm>
308                 An anonymous print server serves two purposes:
309                 </para>
310
311                 <itemizedlist>
312                         <listitem><para>
313                         It allows printing to all printers from a single location.
314                         </para></listitem>
315
316                         <listitem><para>
317                         It reduces network traffic congestion due to many users trying
318                         to access a limited number of printers.
319                         </para></listitem>
320                 </itemizedlist>
321
322                 <para>
323                 In the simplest of anonymous print servers, it is common to require the installation
324                 of the correct printer drivers on the Windows workstation. In this case the print
325                 server will be designed to just pass print jobs through to the spooler, and the spooler
326                 should be configured to do raw pass-through to the printer. In other words, the print
327                 spooler should not filter or process the data stream being passed to the printer.
328                 </para>
329
330                 <para>
331                 In this configuration, it is undesirable to present the Add Printer Wizard, and we do
332                 not want to have automatic driver download, so we disable it in the following
333                 configuration. <link linkend="anon-print"></link> is the resulting &smb.conf; file.
334                 </para>
335
336 <example id="anon-print">
337 <title>Anonymous Print Server smb.conf</title>
338 <smbconfblock>
339 <smbconfcomment>Global parameters</smbconfcomment>
340 <smbconfsection name="[global]"/>
341 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
342 <smbconfoption name="netbios name">LUTHIEN</smbconfoption>
343 <smbconfoption name="security">share</smbconfoption>
344 <smbconfoption name="printcap name">cups</smbconfoption>
345 <smbconfoption name="disable spoolss">Yes</smbconfoption>
346 <smbconfoption name="show add printer wizard">No</smbconfoption>
347 <smbconfoption name="printing">cups</smbconfoption>
348
349 <smbconfsection name="[printers]"/>
350 <smbconfoption name="comment">All Printers</smbconfoption>
351 <smbconfoption name="path">/var/spool/samba</smbconfoption>
352 <smbconfoption name="guest ok">Yes</smbconfoption>
353 <smbconfoption name="printable">Yes</smbconfoption>
354 <smbconfoption name="use client driver">Yes</smbconfoption>
355 <smbconfoption name="browseable">No</smbconfoption>
356 </smbconfblock>
357 </example>
358
359                 <para>
360                 The above configuration is not ideal. It uses no smart features, and it deliberately
361                 presents a less than elegant solution. But it is basic, and it does print. Samba makes
362                 use of the direct printing application program interface that is provided by CUPS.
363                 When Samba has been compiled and linked with the CUPS libraries, the default printing
364                 system will be CUPS. By specifying that the printcap name is CUPS, Samba will use
365                 the CUPS library API to communicate directly with CUPS for all printer functions.
366                 It is possible to force the use of external printing commands by setting the value
367                 of the <parameter>printing</parameter> to either SYSV or BSD, and thus the value of
368                 the parameter <parameter>printcap name</parameter> must be set to something other than
369                 CUPS. In such case, it could be set to the name of any file that contains a list
370                 of printers that should be made available to Windows clients.
371                 </para>
372
373                 <note><para>
374                 Windows users will need to install a local printer and then change the print
375                 to device after installation of the drivers. The print to device can then be set to
376                 the network printer on this machine.
377                 </para></note>
378
379                 <para>
380                 Make sure that the directory <filename>/var/spool/samba</filename> is capable of being used
381                 as intended. The following steps must be taken to achieve this:
382                 </para>
383
384                 <itemizedlist>
385                         <listitem><para>
386                         The directory must be owned by the superuser (root) user and group:
387 <screen>
388 &rootprompt;<userinput>chown root.root /var/spool/samba</userinput>
389 </screen>
390                         </para></listitem>
391
392                         <listitem><para>
393                         Directory permissions should be set for public read-write with the
394                         sticky bit set as shown:
395 <screen>
396 &rootprompt;<userinput>chmod a+twrx /var/spool/samba</userinput>
397 </screen>
398                 The purpose of setting the sticky bit is to prevent who does not own the temporary print file
399                 from being able to take control of it with the potential for devious misuse.
400                         </para></listitem>
401                 </itemizedlist>
402
403
404                 <note><para>
405                 <indexterm><primary>MIME</primary><secondary>raw</secondary></indexterm>
406                 <indexterm><primary>raw printing</primary></indexterm>
407                 On CUPS-enabled systems there is a facility to pass raw data directly to the printer without
408                 intermediate processing via CUPS print filters. Where use of this mode of operation is desired,
409                 it is necessary to configure a raw printing device. It is also necessary to enable the raw mime
410                 handler in the <filename>/etc/mime.conv</filename> and <filename>/etc/mime.types</filename>
411                 files. Refer to <link linkend="cups-raw"></link>.
412                 </para></note>
413
414                 </sect3>
415
416                 <sect3>
417
418                 <title>Secure Read-Write File and Print Server</title>
419
420                 <para>
421                 We progress now from simple systems to a server that is slightly more complex.
422                 </para>
423
424                 <para>
425                 Our new server will require a public data storage area in which only authenticated
426                 users (i.e., those with a local account) can store files, as well as a home directory.
427                 There will be one printer that should be available for everyone to use.
428                 </para>
429
430                 <para>
431                 In this hypothetical environment (no espionage was conducted to obtain this data),
432                 the site is demanding a simple environment that is <emphasis>secure enough</emphasis>
433                 but not too difficult to use. 
434                 </para>
435
436                 <para>
437                 Site users will be Jack Baumbach, Mary Orville, and Amed Sehkah. Each will have
438                 a password (not shown in further examples). Mary will be the printer administrator and will
439                 own all files in the public share.
440                 </para>
441
442                 <para>
443                 This configuration will be based on <emphasis>user-level security</emphasis> that
444                 is the default, and for which the default is to store Microsoft Windows-compatible
445                 encrypted passwords in a file called <filename>/etc/samba/smbpasswd</filename>.
446                 The default &smb.conf; entry that makes this happen is
447                 <smbconfoption name="passdb backend">smbpasswd, guest</smbconfoption>. Since this is the default,
448                 it is not necessary to enter it into the configuration file. Note that the guest backend is
449                 added to the list of active passdb backends no matter whether it specified directly in Samba configuration
450                 file or not.
451                 </para>
452
453
454                 <procedure>
455                 <title>Installing the Secure Office Server</title>
456                         <step><para>
457                 <indexterm><primary>office server</primary></indexterm>
458                         Add all users to the operating system:
459 <screen>
460 &rootprompt;<userinput>useradd -c "Jack Baumbach" -m -g users -p m0r3pa1n jackb</userinput>
461 &rootprompt;<userinput>useradd -c "Mary Orville" -m -g users -p secret maryo</userinput>
462 &rootprompt;<userinput>useradd -c "Amed Sehkah" -m -g users -p secret ameds</userinput>
463 </screen>
464                         </para></step>
465
466                         <step><para>
467                         Configure the Samba &smb.conf; file as shown in <link linkend="OfficeServer"/>.
468                         </para></step>
469
470 <example id="OfficeServer">
471 <title>Secure Office Server smb.conf</title>
472 <smbconfblock>
473 <smbconfcomment>Global parameters</smbconfcomment>
474 <smbconfsection name="[global]"/>
475 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
476 <smbconfoption name="netbios name">OLORIN</smbconfoption>
477 <smbconfoption name="printcap name">cups</smbconfoption>
478 <smbconfoption name="disable spoolss">Yes</smbconfoption>
479 <smbconfoption name="show add printer wizard">No</smbconfoption>
480 <smbconfoption name="printing">cups</smbconfoption>
481
482 <smbconfsection name="[homes]"/>
483 <smbconfoption name="comment">Home Directories</smbconfoption>
484 <smbconfoption name="valid users">%S</smbconfoption>
485 <smbconfoption name="read only">No</smbconfoption>
486 <smbconfoption name="browseable">No</smbconfoption>
487
488 <smbconfsection name="[public]"/>
489 <smbconfoption name="comment">Data</smbconfoption>
490 <smbconfoption name="path">/export</smbconfoption>
491 <smbconfoption name="force user">maryo</smbconfoption>
492 <smbconfoption name="force group">users</smbconfoption>
493 <smbconfoption name="guest ok">Yes</smbconfoption>
494 <smbconfoption name="read only">No</smbconfoption>
495
496 <smbconfsection name="[printers]"/>
497 <smbconfoption name="comment">All Printers</smbconfoption>
498 <smbconfoption name="path">/var/spool/samba</smbconfoption>
499 <smbconfoption name="printer admin">root, maryo</smbconfoption>
500 <smbconfoption name="create mask">0600</smbconfoption>
501 <smbconfoption name="guest ok">Yes</smbconfoption>
502 <smbconfoption name="printable">Yes</smbconfoption>
503 <smbconfoption name="use client driver">Yes</smbconfoption>
504 <smbconfoption name="browseable">No</smbconfoption>
505 </smbconfblock>
506 </example>
507
508                         <step><para>
509                         Initialize the Microsoft Windows password database with the new users:
510 <screen>
511 &rootprompt;<userinput>smbpasswd -a root</userinput>
512 New SMB password: <userinput>bigsecret</userinput>
513 Reenter smb password: <userinput>bigsecret</userinput>
514 Added user root.
515
516 &rootprompt;<userinput>smbpasswd -a jackb</userinput>
517 New SMB password: <userinput>m0r3pa1n</userinput>
518 Retype new SMB password: <userinput>m0r3pa1n</userinput>
519 Added user jackb.
520
521 &rootprompt;<userinput>smbpasswd -a maryo</userinput>
522 New SMB password: <userinput>secret</userinput>
523 Reenter smb password: <userinput>secret</userinput>
524 Added user maryo.
525
526 &rootprompt;<userinput>smbpasswd -a ameds</userinput>
527 New SMB password: <userinput>mysecret</userinput>
528 Reenter smb password: <userinput>mysecret</userinput>
529 Added user ameds.
530 </screen>
531                         </para></step>
532
533                         <step><para>
534                         Install printer using the CUPS Web interface. Make certain that all
535                         printers that will be shared with Microsoft Windows clients are installed
536                         as raw printing devices.
537                         </para></step>
538
539                         <step><para>
540                         Start Samba using the operating system administrative interface.
541                         Alternately, this can be done manually by executing:
542                         <indexterm><primary>smbd</primary></indexterm>
543                         <indexterm><primary>nmbd</primary></indexterm>
544                         <indexterm><primary>starting samba</primary><secondary>smbd</secondary></indexterm>
545                         <indexterm><primary>starting samba</primary><secondary>nmbd</secondary></indexterm>
546 <screen>
547 &rootprompt;<userinput> nmbd; smbd;</userinput>
548 </screen>
549                         Both applications automatically execute as daemons. Those who are paranoid about
550                         maintaining control can add the <constant>-D</constant> flag to coerce them to start
551                         up in daemon mode.
552                         </para></step>
553
554                         <step><para>
555                         Configure the <filename>/export</filename> directory:
556 <screen>
557 &rootprompt;<userinput>mkdir /export</userinput>
558 &rootprompt;<userinput>chown maryo.users /export</userinput>
559 &rootprompt;<userinput>chmod u=rwx,g=rwx,o-rwx /export</userinput>
560 </screen>
561                         </para></step>
562
563                         <step><para>
564                         Check that Samba is running correctly:
565 <screen>
566 &rootprompt;<userinput>smbclient -L localhost -U%</userinput>
567 Domain=[MIDEARTH] OS=[UNIX] Server=[Samba-3.0.20]
568
569 Sharename      Type      Comment
570 ---------      ----      -------
571 public         Disk      Data
572 IPC$           IPC       IPC Service (Samba-3.0.20)
573 ADMIN$         IPC       IPC Service (Samba-3.0.20)
574 hplj4          Printer   hplj4
575
576 Server               Comment
577 ---------            -------
578 OLORIN               Samba-3.0.20
579
580 Workgroup            Master
581 ---------            -------
582 MIDEARTH             OLORIN
583 </screen>
584                         The following error message indicates that Samba was not running:
585 <screen>
586 &rootprompt; smbclient -L olorin -U%
587 Error connecting to 192.168.1.40 (Connection refused)
588 Connection to olorin failed
589 </screen>
590                         </para></step>
591
592                         <step><para>
593                         Connect to OLORIN as maryo:
594 <screen>
595 &rootprompt;<userinput>smbclient //olorin/maryo -Umaryo%secret</userinput>
596 OS=[UNIX] Server=[Samba-3.0.20]
597 smb: \> <userinput>dir</userinput>
598 .                              D        0  Sat Jun 21 10:58:16 2003
599 ..                             D        0  Sat Jun 21 10:54:32 2003
600 Documents                      D        0  Fri Apr 25 13:23:58 2003
601 DOCWORK                        D        0  Sat Jun 14 15:40:34 2003
602 OpenOffice.org                 D        0  Fri Apr 25 13:55:16 2003
603 .bashrc                        H     1286  Fri Apr 25 13:23:58 2003
604 .netscape6                    DH        0  Fri Apr 25 13:55:13 2003
605 .mozilla                      DH        0  Wed Mar  5 11:50:50 2003
606 .kermrc                        H      164  Fri Apr 25 13:23:58 2003
607 .acrobat                      DH        0  Fri Apr 25 15:41:02 2003
608
609                 55817 blocks of size 524288. 34725 blocks available
610 smb: \> <userinput>q</userinput>
611 </screen>
612                         </para></step>
613                 </procedure>
614
615                         <para>
616                         By now you should be getting the hang of configuration basics. Clearly, it is time to
617                         explore slightly more complex examples. For the remainder of this chapter we abbreviate
618                         instructions, since there are previous examples.
619                         </para>
620
621                 </sect3>
622
623         </sect2>
624
625         <sect2>
626         <title>Domain Member Server</title>
627
628         <para>
629         <indexterm><primary>Server Type</primary><secondary>Domain Member</secondary></indexterm>
630         In this instance we consider the simplest server configuration we can get away with
631         to make an accounting department happy. Let's be warned, the users are accountants and they
632         do have some nasty demands. There is a budget for only one server for this department.
633         </para>
634
635         <para>
636         The network is managed by an internal Information Services Group (ISG), to which we belong.
637         Internal politics are typical of a medium-sized organization; Human Resources is of the
638         opinion that they run the ISG because they are always adding and disabling users. Also,
639         departmental managers have to fight tooth and nail to gain basic network resources access for
640         their staff. Accounting is different, though, they get exactly what they want. So this should
641         set the scene.
642         </para>
643
644         <para>
645         We use the users from the last example. The accounting department
646         has a general printer that all departmental users may use. There is also a check printer
647         that may be used only by the person who has authority to print checks. The chief financial
648         officer (CFO) wants that printer to be completely restricted and for it to be located in the
649         private storage area in her office. It therefore must be a network printer.
650         </para>
651
652         <para>
653         The accounting department uses an accounting application called <emphasis>SpytFull</emphasis>
654         that must be run from a central application server. The software is licensed to run only off
655         one server, there are no workstation components, and it is run off a mapped share. The data
656         store is in a UNIX-based SQL backend. The UNIX gurus look after that, so this is not our
657         problem.
658         </para>
659
660         <para>
661         The accounting department manager (maryo) wants a general filing system as well as a separate
662         file storage area for form letters (nastygrams). The form letter area should be read-only to
663         all accounting staff except the manager. The general filing system has to have a structured
664         layout with a general area for all staff to store general documents as well as a separate
665         file area for each member of her team that is private to that person, but she wants full
666         access to all areas. Users must have a private home share for personal work-related files
667         and for materials not related to departmental operations.
668         </para>
669         
670                 <sect3>
671                 <title>Example Configuration</title>
672                 
673                 <para>
674                 The server <emphasis>valinor</emphasis> will be a member server of the company domain.
675                 Accounting will have only a local server. User accounts will be on the domain controllers,
676                 as will desktop profiles and all network policy files.
677                 </para>
678
679                 <procedure>
680                         <step><para>
681                         Do not add users to the UNIX/Linux server; all of this will run off the
682                         central domain.
683                         </para></step>
684
685                         <step><para>
686                         Configure &smb.conf; according to <link linkend="fast-member-server">Member server smb.conf
687                         (globals)</link> and <link linkend="fast-memberserver-shares">Member server smb.conf (shares
688                         and services)</link>.
689                         </para></step>
690
691 <example id="fast-member-server">
692 <title>Member Server smb.conf (Globals)</title>
693 <smbconfblock>
694 <smbconfcomment>Global parameters</smbconfcomment>
695 <smbconfsection name="[global]"/>
696 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
697 <smbconfoption name="netbios name">VALINOR</smbconfoption>
698 <smbconfoption name="security">DOMAIN</smbconfoption>
699 <smbconfoption name="printcap name">cups</smbconfoption>
700 <smbconfoption name="disable spoolss">Yes</smbconfoption>
701 <smbconfoption name="show add printer wizard">No</smbconfoption>
702 <smbconfoption name="idmap uid">15000-20000</smbconfoption>
703 <smbconfoption name="idmap gid">15000-20000</smbconfoption>
704 <smbconfoption name="winbind use default domain">Yes</smbconfoption>
705 <smbconfoption name="printing">cups</smbconfoption>
706 </smbconfblock>
707 </example>
708
709 <example id="fast-memberserver-shares">
710 <title>Member Server smb.conf (Shares and Services)</title>
711 <smbconfblock>
712 <smbconfsection name="[homes]"/>
713 <smbconfoption name="comment">Home Directories</smbconfoption>
714 <smbconfoption name="valid users">%S</smbconfoption>
715 <smbconfoption name="read only">No</smbconfoption>
716 <smbconfoption name="browseable">No</smbconfoption>
717
718 <smbconfsection name="[spytfull]"/>
719 <smbconfoption name="comment">Accounting Application Only</smbconfoption>
720 <smbconfoption name="path">/export/spytfull</smbconfoption>
721 <smbconfoption name="valid users">@Accounts</smbconfoption>
722 <smbconfoption name="admin users">maryo</smbconfoption>
723 <smbconfoption name="read only">Yes</smbconfoption>
724
725 <smbconfsection name="[public]"/>
726 <smbconfoption name="comment">Data</smbconfoption>
727 <smbconfoption name="path">/export/public</smbconfoption>
728 <smbconfoption name="read only">No</smbconfoption>
729
730 <smbconfsection name="[printers]"/>
731 <smbconfoption name="comment">All Printers</smbconfoption>
732 <smbconfoption name="path">/var/spool/samba</smbconfoption>
733 <smbconfoption name="printer admin">root, maryo</smbconfoption>
734 <smbconfoption name="create mask">0600</smbconfoption>
735 <smbconfoption name="guest ok">Yes</smbconfoption>
736 <smbconfoption name="printable">Yes</smbconfoption>
737 <smbconfoption name="use client driver">Yes</smbconfoption>
738 <smbconfoption name="browseable">No</smbconfoption>
739 </smbconfblock>
740 </example>
741
742                         <step><para>
743                         <indexterm><primary>net</primary><secondary>rpc</secondary></indexterm>
744                         Join the domain. Note: Do not start Samba until this step has been completed!
745 <screen>
746 &rootprompt;<userinput>net rpc join -Uroot%'bigsecret'</userinput>
747 Joined domain MIDEARTH.
748 </screen>
749                         </para></step>
750
751                         <step><para>
752                         Make absolutely certain that you disable (shut down) the <command>nscd</command>
753                         daemon on any system on which <command>winbind</command> is configured to run.
754                         </para></step>
755
756                         <step><para>
757                         Start Samba following the normal method for your operating system platform.
758                         If you wish to do this manually, execute as root:
759                         <indexterm><primary>smbd</primary></indexterm>
760                         <indexterm><primary>nmbd</primary></indexterm>
761                         <indexterm><primary>winbindd</primary></indexterm>
762                         <indexterm><primary>starting samba</primary><secondary>smbd</secondary></indexterm>
763                         <indexterm><primary>starting samba</primary><secondary>nmbd</secondary></indexterm>
764                         <indexterm><primary>starting samba</primary><secondary>winbindd</secondary></indexterm>
765 <screen>
766 &rootprompt;<userinput>nmbd; smbd; winbindd;</userinput>
767 </screen>
768                         </para></step>
769
770                         <step><para>
771                         Configure the name service switch (NSS) control file on your system to resolve user and group names
772                         via winbind. Edit the following lines in <filename>/etc/nsswitch.conf</filename>:
773 <programlisting>
774 passwd: files winbind
775 group:  files winbind
776 hosts:  files dns winbind
777 </programlisting>
778                         </para></step>
779
780                         <step><para>
781                         Set the password for <command>wbinfo</command> to use:
782 <screen>
783 &rootprompt;<userinput>wbinfo --set-auth-user=root%'bigsecret'</userinput>
784 </screen>
785                         </para></step>
786
787                         <step><para>
788                         Validate that domain user and group credentials can be correctly resolved by executing:
789 <screen>
790 &rootprompt;<userinput>wbinfo -u</userinput>
791 MIDEARTH\maryo
792 MIDEARTH\jackb
793 MIDEARTH\ameds
794 ...
795 MIDEARTH\root
796
797 &rootprompt;<userinput>wbinfo -g</userinput>
798 MIDEARTH\Domain Users
799 MIDEARTH\Domain Admins
800 MIDEARTH\Domain Guests
801 ...
802 MIDEARTH\Accounts
803 </screen>
804                         </para></step>
805
806                         <step><para>
807                         Check that <command>winbind</command> is working. The following demonstrates correct
808                         username resolution via the <command>getent</command> system utility:
809 <screen>
810 &rootprompt;<userinput>getent passwd maryo</userinput>
811 maryo:x:15000:15003:Mary Orville:/home/MIDEARTH/maryo:/bin/false
812 </screen>
813                         </para></step>
814
815                         <step><para>
816                         A final test that we have this under control might be reassuring:
817 <screen>
818 &rootprompt;<userinput>touch /export/a_file</userinput>
819 &rootprompt;<userinput>chown maryo /export/a_file</userinput>
820 &rootprompt;<userinput>ls -al /export/a_file</userinput>
821 ...
822 -rw-r--r--    1 maryo    users       11234 Jun 21 15:32 a_file
823 ...
824
825 &rootprompt;<userinput>rm /export/a_file</userinput>
826 </screen>
827                         </para></step>
828
829                         <step><para>
830                         Configuration is now mostly complete, so this is an opportune time
831                         to configure the directory structure for this site:
832 <screen>
833 &rootprompt;<userinput>mkdir -p /export/{spytfull,public}</userinput>
834 &rootprompt;<userinput>chmod ug=rwxS,o=x /export/{spytfull,public}</userinput>
835 &rootprompt;<userinput>chown maryo.Accounts /export/{spytfull,public}</userinput>
836 </screen>
837                         </para></step>
838                 </procedure>
839
840                 </sect3>
841
842         </sect2>
843
844         <sect2>
845         <title>Domain Controller</title>
846
847
848         <para>
849         <indexterm><primary>Server Type</primary><secondary>Domain Controller</secondary></indexterm>
850         For the remainder of this chapter the focus is on the configuration of domain control.
851         The examples that follow are for two implementation strategies. Remember, our objective is
852         to create a simple but working solution. The remainder of this book should help to highlight
853         opportunity for greater functionality and the complexity that goes with it.
854         </para>
855
856         <para>
857         A domain controller configuration can be achieved with a simple configuration using the new
858         tdbsam password backend. This type of configuration is good for small
859         offices, but has limited scalability (cannot be replicated), and performance can be expected
860         to fall as the size and complexity of the domain increases.
861         </para>
862
863         <para>
864         The use of tdbsam is best limited to sites that do not need
865         more than a Primary Domain Controller (PDC). As the size of a domain grows the need
866         for additional domain controllers becomes apparent. Do not attempt to under-resource
867         a Microsoft Windows network environment; domain controllers provide essential
868         authentication services. The following are symptoms of an under-resourced domain control
869         environment:
870         </para>
871
872         <itemizedlist>  
873                 <listitem><para>
874                  Domain logons intermittently fail.
875                 </para></listitem>
876
877                 <listitem><para>
878                 File access on a domain member server intermittently fails, giving a permission denied
879                 error message.
880                 </para></listitem>
881         </itemizedlist>
882
883         <para>
884         A more scalable domain control authentication backend option might use
885         Microsoft Active Directory or an LDAP-based backend. Samba-3 provides
886         for both options as a domain member server. As a PDC, Samba-3 is not able to provide
887         an exact alternative to the functionality that is available with Active Directory.
888         Samba-3 can provide a scalable LDAP-based PDC/BDC solution.
889         </para>
890
891         <para>
892         The tdbsam authentication backend provides no facility to replicate
893         the contents of the database, except by external means (i.e., there is no self-contained protocol
894         in Samba-3 for Security Account Manager database [SAM] replication).
895         </para>
896
897         <note><para>
898         If you need more than one domain controller, do not use a tdbsam authentication backend.
899         </para></note>
900
901                 <sect3>
902                 <title>Example: Engineering Office</title>
903
904                 <para>
905                 The engineering office network server we present here is designed to demonstrate use
906                 of the new tdbsam password backend. The tdbsam
907                 facility is new to Samba-3. It is designed to provide many user and machine account controls
908                 that are possible with Microsoft Windows NT4. It is safe to use this in smaller networks.
909                 </para>
910
911                 <procedure>
912                         <step><para>
913                         A working PDC configuration using the tdbsam
914                         password backend can be found in <link linkend="fast-engoffice-global">Engineering Office smb.conf
915                         (globals)</link> together with <link linkend="fast-engoffice-shares">Engineering Office smb.conf
916                         (shares and services)</link>:
917                         <indexterm><primary>pdbedit</primary></indexterm>
918                         </para></step>
919
920 <example id="fast-engoffice-global">
921 <title>Engineering Office smb.conf (globals)</title>
922 <smbconfblock>
923 <smbconfsection name="[global]"/>
924 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
925 <smbconfoption name="netbios name">FRODO</smbconfoption>
926 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
927 <smbconfoption name="printcap name">cups</smbconfoption>
928 <smbconfoption name="add user script">/usr/sbin/useradd -m %u</smbconfoption>
929 <smbconfoption name="delete user script">/usr/sbin/userdel -r %u</smbconfoption>
930 <smbconfoption name="add group script">/usr/sbin/groupadd %g</smbconfoption>
931 <smbconfoption name="delete group script">/usr/sbin/groupdel %g</smbconfoption>
932 <smbconfoption name="add user to group script">/usr/sbin/groupmod -A %u %g</smbconfoption>
933 <smbconfoption name="delete user from group script">/usr/sbin/groupmod -R %u %g</smbconfoption>
934 <smbconfoption name="add machine script">/usr/sbin/useradd -s /bin/false -d /var/lib/nobody %u</smbconfoption>
935 <smbconfcomment>Note: The following specifies the default logon script.</smbconfcomment>
936 <smbconfcomment>Per user logon scripts can be specified in the user account using pdbedit </smbconfcomment>
937 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
938 <smbconfcomment>This sets the default profile path. Set per user paths with pdbedit</smbconfcomment>
939 <smbconfoption name="logon path">\\%L\Profiles\%U</smbconfoption>
940 <smbconfoption name="logon drive">H:</smbconfoption>
941 <smbconfoption name="logon home">\\%L\%U</smbconfoption>
942 <smbconfoption name="domain logons">Yes</smbconfoption>
943 <smbconfoption name="os level">35</smbconfoption>
944 <smbconfoption name="preferred master">Yes</smbconfoption>
945 <smbconfoption name="domain master">Yes</smbconfoption>
946 <smbconfoption name="idmap uid">15000-20000</smbconfoption>
947 <smbconfoption name="idmap gid">15000-20000</smbconfoption>
948 <smbconfoption name="printing">cups</smbconfoption>
949 </smbconfblock>
950 </example>
951
952 <example id="fast-engoffice-shares">
953 <title>Engineering Office smb.conf (shares and services)</title>
954 <smbconfblock>
955 <smbconfsection name="[homes]"/>
956 <smbconfoption name="comment">Home Directories</smbconfoption>
957 <smbconfoption name="valid users">%S</smbconfoption>
958 <smbconfoption name="read only">No</smbconfoption>
959 <smbconfoption name="browseable">No</smbconfoption>
960
961 <smbconfcomment>Printing auto-share (makes printers available thru CUPS)</smbconfcomment>
962 <smbconfsection name="[printers]"/>
963 <smbconfoption name="comment">All Printers</smbconfoption>
964 <smbconfoption name="path">/var/spool/samba</smbconfoption>
965 <smbconfoption name="printer admin">root, maryo</smbconfoption>
966 <smbconfoption name="create mask">0600</smbconfoption>
967 <smbconfoption name="guest ok">Yes</smbconfoption>
968 <smbconfoption name="printable">Yes</smbconfoption>
969 <smbconfoption name="browseable">No</smbconfoption>
970
971 <smbconfsection name="[print$]"/>
972 <smbconfoption name="comment">Printer Drivers Share</smbconfoption>
973 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
974 <smbconfoption name="write list">maryo, root</smbconfoption>
975 <smbconfoption name="printer admin">maryo, root</smbconfoption>
976
977 <smbconfcomment>Needed to support domain logons</smbconfcomment>
978 <smbconfsection name="[netlogon]"/>
979 <smbconfoption name="comment">Network Logon Service</smbconfoption>
980 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
981 <smbconfoption name="admin users">root, maryo</smbconfoption>
982 <smbconfoption name="guest ok">Yes</smbconfoption>
983 <smbconfoption name="browseable">No</smbconfoption>
984
985 <smbconfcomment>For profiles to work, create a user directory under the path</smbconfcomment>
986 <smbconfcomment> shown. i.e., mkdir -p /var/lib/samba/profiles/maryo</smbconfcomment>
987 <smbconfsection name="[Profiles]"/>
988 <smbconfoption name="comment">Roaming Profile Share</smbconfoption>
989 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
990 <smbconfoption name="read only">No</smbconfoption>
991 <smbconfoption name="profile acls">Yes</smbconfoption>
992
993 <smbconfcomment>Other resource (share/printer) definitions would follow below.</smbconfcomment>
994 </smbconfblock>
995 </example>
996
997                         <step><para>
998                         Create UNIX group accounts as needed using a suitable operating system tool:
999 <screen>
1000 &rootprompt;<userinput>groupadd ntadmins</userinput>
1001 &rootprompt;<userinput>groupadd designers</userinput>
1002 &rootprompt;<userinput>groupadd engineers</userinput>
1003 &rootprompt;<userinput>groupadd qateam</userinput>
1004 </screen>
1005                         </para></step>
1006
1007                         <step><para>
1008                         Create user accounts on the system using the appropriate tool
1009                         provided with the operating system. Make sure all user home directories
1010                         are created also. Add users to groups as required for access control
1011                         on files, directories, printers, and as required for use in the Samba
1012                         environment.
1013                         </para></step>
1014
1015
1016                         <step><para>
1017                         <indexterm><primary>net</primary><secondary>groupmap</secondary></indexterm>
1018                         <indexterm><primary>initGroups.sh</primary></indexterm>
1019                         Assign each of the UNIX groups to NT groups by executing this shell script
1020                         (You could name the script <filename>initGroups.sh</filename>):
1021 <screen>
1022 #!/bin/bash
1023 #### Keep this as a shell script for future re-use
1024                         
1025 # First assign well known groups
1026 net groupmap modify ntgroup="Domain Admins" unixgroup=ntadmins
1027 net groupmap modify ntgroup="Domain Users"  unixgroup=users
1028 net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
1029
1030 # Now for our added Domain Groups
1031 net groupmap add ntgroup="Designers" unixgroup=designers type=d
1032 net groupmap add ntgroup="Engineers" unixgroup=engineers type=d
1033 net groupmap add ntgroup="QA Team"   unixgroup=qateam    type=d
1034 </screen>
1035                         </para></step>
1036
1037                         <step><para>
1038                         Create the <filename>scripts</filename> directory for use in the 
1039                         <smbconfsection name="[NETLOGON]"/> share:
1040 <screen>
1041 &rootprompt;<userinput>mkdir -p /var/lib/samba/netlogon/scripts</userinput>
1042 </screen>
1043                         Place the logon scripts that will be used (batch or cmd scripts)
1044                         in this directory.
1045                         </para></step>
1046                 </procedure>
1047
1048                 <para>
1049                 The above configuration provides a functional PDC
1050                 system to which must be added file shares and printers as required.
1051                 </para>
1052
1053                 </sect3>
1054
1055                 <sect3>
1056                 <title>A Big Organization</title>
1057
1058                 <para>
1059                 In this section we finally get to review in brief a Samba-3 configuration that
1060                 uses a Lightweight Directory Access (LDAP)-based authentication backend. The
1061                 main reasons for this choice are to provide the ability to host primary
1062                 and Backup Domain Control (BDC), as well as to enable a higher degree of
1063                 scalability to meet the needs of a very distributed environment.
1064                 </para>
1065
1066                         <sect4>
1067                         <title>The Primary Domain Controller</title>
1068
1069                         <para>
1070                         This is an example of a minimal configuration to run a Samba-3 PDC
1071                         using an LDAP authentication backend. It is assumed that the operating system
1072                         has been correctly configured.
1073                         </para>
1074
1075                         <para>
1076                         The Idealx scripts (or equivalent) are needed to manage LDAP-based POSIX and/or
1077                         SambaSamAccounts. The Idealx scripts may be downloaded from the <ulink url="http://www.idealx.org">
1078                         Idealx</ulink> Web site. They may also be obtained from the Samba tarball. Linux
1079                         distributions tend to install the Idealx scripts in the 
1080                         <filename>/usr/share/doc/packages/sambaXXXXXX/examples/LDAP/smbldap-tools</filename> directory.
1081                         Idealx scripts version <constant>smbldap-tools-0.9.1</constant> are known to work well.
1082                         </para>
1083
1084                         <procedure>
1085                                 <step><para>
1086                                 Obtain from the Samba sources <filename>~/examples/LDAP/samba.schema</filename>
1087                                 and copy it to the <filename>/etc/openldap/schema/</filename> directory.
1088                                 </para></step>
1089
1090                                 <step><para>
1091                                 Set up the LDAP server. This example is suitable for OpenLDAP 2.1.x.
1092                                 The <filename>/etc/openldap/slapd.conf</filename> file.
1093                                 <indexterm><primary>/etc/openldap/slapd.conf</primary></indexterm>
1094 <title>Example slapd.conf File</title>
1095 <screen>
1096 # Note commented out lines have been removed
1097 include         /etc/openldap/schema/core.schema
1098 include         /etc/openldap/schema/cosine.schema
1099 include         /etc/openldap/schema/inetorgperson.schema
1100 include         /etc/openldap/schema/nis.schema
1101 include         /etc/openldap/schema/samba.schema
1102
1103 pidfile         /var/run/slapd/slapd.pid
1104 argsfile        /var/run/slapd/slapd.args
1105
1106 database        bdb
1107 suffix          "dc=quenya,dc=org"
1108 rootdn          "cn=Manager,dc=quenya,dc=org"
1109 rootpw          {SSHA}06qDkonA8hk6W6SSnRzWj0/pBcU3m0/P
1110 # The password for the above is 'nastyon3'
1111
1112 directory     /var/lib/ldap
1113
1114 index   objectClass     eq
1115 index cn                      pres,sub,eq
1116 index sn                      pres,sub,eq
1117 index uid                     pres,sub,eq
1118 index displayName             pres,sub,eq
1119 index uidNumber               eq
1120 index gidNumber               eq
1121 index memberUid               eq
1122 index   sambaSID              eq
1123 index   sambaPrimaryGroupSID  eq
1124 index   sambaDomainName       eq
1125 index   default               sub
1126 </screen>
1127                                 </para></step>
1128
1129                                 <step><para>
1130                                 Create the following file <filename>initdb.ldif</filename>:
1131                                 <indexterm><primary>initdb.ldif</primary></indexterm>
1132 <programlisting>
1133 # Organization for SambaXP Demo
1134 dn: dc=quenya,dc=org
1135 objectclass: dcObject
1136 objectclass: organization
1137 dc: quenya
1138 o: SambaXP Demo
1139 description: The SambaXP Demo LDAP Tree
1140
1141 # Organizational Role for Directory Management
1142 dn: cn=Manager,dc=quenya,dc=org
1143 objectclass: organizationalRole
1144 cn: Manager
1145 description: Directory Manager
1146
1147 # Setting up the container for users
1148 dn: ou=People, dc=quenya, dc=org
1149 objectclass: top
1150 objectclass: organizationalUnit
1151 ou: People
1152
1153 # Set up an admin handle for People OU
1154 dn: cn=admin, ou=People, dc=quenya, dc=org
1155 cn: admin
1156 objectclass: top
1157 objectclass: organizationalRole
1158 objectclass: simpleSecurityObject
1159 userPassword: {SSHA}0jBHgQ1vp4EDX2rEMMfIudvRMJoGwjVb
1160 # The password for above is 'mordonL8'
1161 </programlisting>
1162                                 </para></step>
1163
1164                                 <step><para>
1165                                 Load the initial data above into the LDAP database:
1166 <screen>
1167 &rootprompt;<userinput>slapadd -v -l initdb.ldif</userinput>
1168 </screen>
1169                                 </para></step>
1170
1171                                 <step><para>
1172                                 Start the LDAP server using the appropriate tool or method for
1173                                 the operating system platform on which it is installed.
1174                                 </para></step>
1175
1176                                 <step><para>
1177                                 Install the Idealx script files in the <filename>/usr/local/sbin</filename> directory,
1178                                 then configure the smbldap_conf.pm file to match your system configuration.
1179                                 </para></step>
1180
1181                                 <step><para>
1182                                 The &smb.conf; file that drives this backend can be found in example <link
1183                                 linkend="fast-ldap">LDAP backend smb.conf for PDC</link>. Add additional stanzas
1184                                 as required.
1185                                 </para></step>
1186
1187 <example id="fast-ldap">
1188 <title>LDAP backend smb.conf for PDC</title>
1189 <smbconfblock>
1190 <smbconfcomment>Global parameters</smbconfcomment>
1191 <smbconfsection name="[global]"/>
1192 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
1193 <smbconfoption name="netbios name">FRODO</smbconfoption>
1194 <smbconfoption name="passdb backend">ldapsam:ldap://localhost</smbconfoption>
1195 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1196 <smbconfoption name="printcap name">cups</smbconfoption>
1197 <smbconfoption name="add user script">/usr/local/sbin/smbldap-useradd -m '%u'</smbconfoption>
1198 <smbconfoption name="delete user script">/usr/local/sbin/smbldap-userdel %u</smbconfoption>
1199 <smbconfoption name="add group script">/usr/local/sbin/smbldap-groupadd -p '%g'</smbconfoption>
1200 <smbconfoption name="delete group script">/usr/local/sbin/smbldap-groupdel '%g'</smbconfoption>
1201 <smbconfoption name="add user to group script">/usr/local/sbin/smbldap-groupmod -m '%u' '%g'</smbconfoption>
1202 <smbconfoption name="delete user from group script">/usr/local/sbin/smbldap-groupmod -x '%u' '%g'</smbconfoption>
1203 <smbconfoption name="set primary group script">/usr/local/sbin/smbldap-usermod -g '%g' '%u'</smbconfoption>
1204 <smbconfoption name="add machine script">/usr/local/sbin/smbldap-useradd -w '%u'</smbconfoption>
1205 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
1206 <smbconfoption name="logon path">\\%L\Profiles\%U</smbconfoption>
1207 <smbconfoption name="logon drive">H:</smbconfoption>
1208 <smbconfoption name="logon home">\\%L\%U</smbconfoption>
1209 <smbconfoption name="domain logons">Yes</smbconfoption>
1210 <smbconfoption name="os level">35</smbconfoption>
1211 <smbconfoption name="preferred master">Yes</smbconfoption>
1212 <smbconfoption name="domain master">Yes</smbconfoption>
1213 <smbconfoption name="ldap suffix">dc=quenya,dc=org</smbconfoption>
1214 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
1215 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
1216 <smbconfoption name="ldap group suffix">ou=People</smbconfoption>
1217 <smbconfoption name="ldap idmap suffix">ou=People</smbconfoption>
1218 <smbconfoption name="ldap admin dn">cn=Manager</smbconfoption>
1219 <smbconfoption name="ldap ssl">no</smbconfoption>
1220 <smbconfoption name="ldap passwd sync">Yes</smbconfoption>
1221 <smbconfoption name="idmap uid">15000-20000</smbconfoption>
1222 <smbconfoption name="idmap gid">15000-20000</smbconfoption>
1223 <smbconfoption name="printing">cups</smbconfoption>
1224 </smbconfblock>
1225 </example>
1226
1227                                 <step><para>
1228                                 Add the LDAP password to the <filename>secrets.tdb</filename> file so Samba can update
1229                                 the LDAP database:
1230 <screen>
1231 &rootprompt;<userinput>smbpasswd -w mordonL8</userinput>
1232 </screen>
1233                                 </para></step>
1234
1235                                 <step><para>
1236                                 Add users and groups as required. Users and groups added using Samba tools
1237                                 will automatically be added to both the LDAP backend and the operating
1238                                 system as required.
1239                                 </para></step>
1240
1241                         </procedure>
1242
1243                         </sect4>
1244
1245                         <sect4>
1246                         <title>Backup Domain Controller</title>
1247
1248                         <para>
1249                         <link linkend="fast-bdc"/> shows the example configuration for the BDC. Note that
1250                         the &smb.conf; file does not specify the smbldap-tools scripts &smbmdash; they are
1251                         not needed on a BDC. Add additional stanzas for shares and printers as required.
1252                         </para>
1253
1254                         <procedure>
1255                                 <step><para>
1256                                 Decide if the BDC should have its own LDAP server or not. If the BDC is to be
1257                                 the LDAP server, change the following &smb.conf; as indicated. The default
1258                                 configuration in <link linkend="fast-bdc">Remote LDAP BDC smb.conf</link>
1259                                 uses a central LDAP server.
1260                                 </para></step>
1261
1262 <example id="fast-bdc">
1263 <title>Remote LDAP BDC smb.conf</title>
1264 <smbconfblock>
1265 <smbconfcomment>Global parameters</smbconfcomment>
1266 <smbconfsection name="[global]"/>
1267 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
1268 <smbconfoption name="netbios name">GANDALF</smbconfoption>
1269 <smbconfoption name="passdb backend">ldapsam:ldap://frodo.quenya.org</smbconfoption>
1270 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1271 <smbconfoption name="printcap name">cups</smbconfoption>
1272 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
1273 <smbconfoption name="logon path">\\%L\Profiles\%U</smbconfoption>
1274 <smbconfoption name="logon drive">H:</smbconfoption>
1275 <smbconfoption name="logon home">\\%L\%U</smbconfoption>
1276 <smbconfoption name="domain logons">Yes</smbconfoption>
1277 <smbconfoption name="os level">33</smbconfoption>
1278 <smbconfoption name="preferred master">Yes</smbconfoption>
1279 <smbconfoption name="domain master">No</smbconfoption>
1280 <smbconfoption name="ldap suffix">dc=quenya,dc=org</smbconfoption>
1281 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
1282 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
1283 <smbconfoption name="ldap group suffix">ou=People</smbconfoption>
1284 <smbconfoption name="ldap idmap suffix">ou=People</smbconfoption>
1285 <smbconfoption name="ldap admin dn">cn=Manager</smbconfoption>
1286 <smbconfoption name="ldap ssl">no</smbconfoption>
1287 <smbconfoption name="ldap passwd sync">Yes</smbconfoption>
1288 <smbconfoption name="idmap uid">15000-20000</smbconfoption>
1289 <smbconfoption name="idmap gid">15000-20000</smbconfoption>
1290 <smbconfoption name="printing">cups</smbconfoption>
1291 </smbconfblock>
1292 </example>
1293
1294                                 <step><para>
1295                                 Configure the NETLOGON and PROFILES directory as for the PDC in <link linkend="fast-bdc"/>.
1296                                 </para></step>
1297                         </procedure>
1298
1299                         </sect4>
1300
1301                 </sect3>
1302
1303         </sect2>
1304
1305 </sect1>
1306
1307 </chapter>