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">
4 <title>Making Happy Users</title>
7 It is said that <quote>a day that is without troubles is not fulfilling. Rather, give
8 me a day of troubles well handled so that I can be content with my achievements.</quote>
12 In the world of computer networks, problems are as varied as the people who create them
13 or experience them. The design of the network implemented in <link linkend="Big500users"/>
14 may create problems for some network users. The following lists some of the problems that
18 <indexterm><primary>PDC</primary></indexterm>
19 <indexterm><primary>network bandwidth</primary><secondary>utilization</secondary></indexterm>
20 <indexterm><primary>BDC</primary></indexterm>
21 <indexterm><primary>user account</primary></indexterm>
22 <indexterm><primary>PDC/BDC ratio</primary></indexterm>
24 A significant number of network administrators have responded to the guidance given
25 here. It should be noted that there are sites that have a single PDC for many hundreds of
26 concurrent network clients. Network bandwidth, network bandwidth utilization, and server load
27 are among the factors that determine the maximum number of Windows clients that
28 can be served by a single domain controller (PDC or BDC) on a network segment. It is possible
29 to operate with only a single PDC over a routed network. What is possible is not necessarily
30 <emphasis>best practice</emphasis>. When Windows client network logons begin to fail with
31 the message that the domain controller cannot be found or that the user account cannot
32 be found (when you know it exists), that may be an indication that the domain controller is
33 overloaded or network bandwidth is overloaded. The guidance given for PDC/BDC ratio to Windows
34 clients is conservative and if followed will minimize problems &smbmdash; but it is not absolute.
39 <term>Users experiencing difficulty logging onto the network</term>
41 <indexterm><primary>network</primary><secondary>logon</secondary></indexterm>
42 <indexterm><primary>multiple domain controllers</primary></indexterm>
43 When a Windows client logs onto the network, many data packets are exchanged
44 between the client and the server that is providing the network logon services.
45 Each request between the client and the server must complete within a specific
46 time limit. This is one of the primary factors that govern the installation of
47 multiple domain controllers (usually called secondary or backup controllers).
48 As a rough rule, there should be one such backup controller for every
49 30 to 150 clients. The actual limits are determined by network operational
54 <indexterm><primary>PDC</primary></indexterm>
55 <indexterm><primary>BDC</primary></indexterm>
56 <indexterm><primary>clients per DC</primary></indexterm>
57 If the domain controller provides only network logon services
58 and all file and print activity is handled by domain member servers, one domain
59 controller per 150 clients on a single network segment may suffice. In any
60 case, it is highly recommended to have a minimum of one domain controller (PDC or BDC)
61 per network segment. It is better to have at least one BDC on the network
62 segment that has a PDC. If the domain controller is also used as a file and
63 print server, the number of clients it can service reliably is reduced,
64 and generally for low powered hardware should not exceed 30 machines (Windows
65 workstations plus domain member servers) per domain controller. Many sites are
66 able to operate with more clients per domain controller, the number of clients
67 that can be supported is limited by the CPU speed, memory and the workload on
68 the Samba server as well as network bandwidth utilization.
73 <term>Slow logons and log-offs</term>
75 <indexterm><primary>slow logon</primary></indexterm>
76 Slow logons and log-offs may be caused by many factors that include:
80 <indexterm><primary>NetBIOS</primary><secondary>name resolution</secondary><tertiary>delays</tertiary></indexterm>
81 <indexterm><primary>WINS</primary><secondary>server</secondary></indexterm>
82 Excessive delays in the resolution of a NetBIOS name to its IP
83 address. This may be observed when an overloaded domain controller
84 is also the WINS server. Another cause may be the failure to use
85 a WINS server (this assumes that there is a single network segment).
89 <indexterm><primary>traffic collisions</primary></indexterm>
90 <indexterm><primary>HUB</primary></indexterm>
91 <indexterm><primary>ethernet switch</primary></indexterm>
92 Network traffic collisions due to overloading of the network
93 segment. One short-term workaround to this may be to replace
94 network HUBs with Ethernet switches.
98 <indexterm><primary>networking hardware</primary><secondary>defective</secondary></indexterm>
99 Defective networking hardware. Over the past few years, we have seen
100 on the Samba mailing list a significant increase in the number of
101 problems that were traced to a defective network interface controller,
102 a defective HUB or Ethernet switch, or defective cabling. In most cases,
103 it was the erratic nature of the problem that ultimately pointed to
104 the cause of the problem.
108 <indexterm><primary>profile</primary><secondary>roaming</secondary></indexterm>
109 <indexterm><primary>MS Outlook</primary><secondary>PST file</secondary></indexterm>
110 Excessively large roaming profiles. This type of problem is typically
111 the result of poor user education as well as poor network management.
112 It can be avoided by users not storing huge quantities of email in
113 MS Outlook PST files as well as by not storing files on the desktop.
114 These are old bad habits that require much discipline and vigilance
115 on the part of network management.
119 <indexterm><primary>WebClient</primary></indexterm>
120 You should verify that the Windows XP WebClient service is not running.
121 The use of the WebClient service has been implicated in many Windows
122 networking-related problems.
129 <term>Loss of access to network drives and printer resources</term>
131 Loss of access to network resources during client operation may be caused by a number
132 of factors, including:
137 <indexterm><primary>network</primary><secondary>overload</secondary></indexterm>
138 Network overload (typically indicated by a high network collision rate)
146 <indexterm><primary>network</primary><secondary>timeout</secondary></indexterm>
147 Timeout causing the client to close a connection that is in use but has
148 been latent (no traffic) for some time (5 minutes or more)
152 <indexterm><primary>network hardware</primary><secondary>defective</secondary></indexterm>
153 Defective networking hardware
158 <indexterm><primary>data</primary><secondary>corruption</secondary></indexterm>
159 No matter what the cause, a sudden loss of access to network resources can
160 result in BSOD (blue screen of death) situations that necessitate rebooting of the client
161 workstation. In the case of a mild problem, retrying to access the network drive of the printer
162 may restore operations, but in any case this is a serious problem that may lead to the next
163 problem, data corruption.
168 <term>Potential data corruption</term>
170 <indexterm><primary>data</primary><secondary>corruption</secondary></indexterm>
171 Data corruption is one of the most serious problems. It leads to uncertainty, anger, and
172 frustration, and generally precipitates immediate corrective demands. Management response
173 to this type of problem may be rational, as well as highly irrational. There have been
174 cases where management has fired network staff for permitting this situation to occur without
175 immediate correction. There have been situations where perfectly functional hardware was thrown
176 out and replaced, only to find the problem caused by a low-cost network hardware item. There
177 have been cases where server operating systems were replaced, or where Samba was updated,
178 only to later isolate the problem due to defective client software.
184 In this chapter, you can work through a number of measures that significantly arm you to
185 anticipate and combat network performance issues. You can work through complex and thorny
186 methods to improve the reliability of your network environment, but be warned that all such steps
187 demand the price of complexity.
191 <title>Regarding LDAP Directories and Windows Computer Accounts</title>
194 <indexterm><primary>LDAP</primary><secondary>directory</secondary></indexterm>
195 Computer (machine) accounts can be placed wherever you like in an LDAP directory subject to some
196 constraints that are described in this section.
200 <indexterm><primary>POSIX</primary></indexterm>
201 <indexterm><primary>SambaSAMAccount</primary></indexterm>
202 <indexterm><primary>machine account</primary></indexterm>
203 <indexterm><primary>trust account</primary></indexterm>
204 The POSIX and SambaSAMAccount components of computer (machine) accounts are both used by Samba.
205 That is, machine accounts are treated inside Samba in the same way that Windows NT4/200X treats
206 them. A user account and a machine account are indistinguishable from each other, except that
207 the machine account ends in a $ character, as do trust accounts.
211 <indexterm><primary>account</primary></indexterm>
212 <indexterm><primary>UID</primary></indexterm>
213 The need for Windows user, group, machine, trust, and other such accounts to be tied to a valid UNIX UID
214 is a design decision that was made a long way back in the history of Samba development. It is
215 unlikely that this decision will be reversed or changed during the remaining life of the
220 <indexterm><primary>SID</primary></indexterm>
221 <indexterm><primary>NSS</primary></indexterm>
222 The resolution of a UID from the Windows SID is achieved within Samba through a mechanism that
223 must refer back to the host operating system on which Samba is running. The name service
224 switch (NSS) is the preferred mechanism that shields applications (like Samba) from the
225 need to know everything about every host OS it runs on.
229 Samba asks the host OS to provide a UID via the <quote>passwd</quote>, <quote>shadow</quote>
230 and <quote>group</quote> facilities in the NSS control (configuration) file. The best tool
231 for achieving this is left up to the UNIX administrator to determine. It is not imposed by
232 Samba. Samba provides winbindd together with its support libraries as one method. It is
233 possible to do this via LDAP, and for that Samba provides the appropriate hooks so that
234 all account entities can be located in an LDAP directory.
238 <indexterm><primary>nss_ldap</primary></indexterm>
239 For many the weapon of choice is to use the PADL nss_ldap utility. This utility must
240 be configured so that computer accounts can be resolved to a POSIX/UNIX account UID. That
241 is fundamentally an LDAP design question. The information provided on the Samba list and
242 in the documentation is directed at providing working examples only. The design
243 of an LDAP directory is a complex subject that is beyond the scope of this documentation.
250 <title>Introduction</title>
253 You just opened an email from Christine that reads:
258 <blockquote><attribution>Christine</attribution><para>
259 A few months ago we sat down to design the network. We discussed the challenges ahead and we all
260 agreed to compromise our design to keep it simple. We knew there would be problems, but anticipated
261 that we would have some time to resolve any issues that might be encountered.
265 As you now know, we started off on the wrong foot. We have a lot of unhappy users. One of them
266 resigned yesterday afternoon because she was under duress to complete some critical projects. She
267 suffered a blue screen of death situation just as she was finishing four hours of intensive work, all
268 of which was lost. She has a unique requirement that involves storing large files on her desktop.
269 Mary's desktop profile is nearly 1 GB in size. As a result of her desktop configuration, it
270 takes her nearly 15 minutes just to log onto her workstation. But that is not enough. Because all
271 network logon traffic passes over the network links between our buildings, logging on may take
272 three or four attempts due to blue screen problems associated with network timeouts.
276 A few of us worked to help her out of trouble. We convinced her to stay and promised to fully
277 resolve the difficulties she is facing. We have no choice. We must implement LDAP and set hard
278 limits on what our users can do with their desktops. Otherwise, we face staff losses
279 that can surely do harm to our growth as well as to staff morale. I am sure we can better deal
280 with the consequences of what we know we must do than we can with the unrest we have now.
284 Stan and I have discussed the current situation. We are resolved to help our users and protect
285 the well being of Abmas. Please acknowledge this advice with consent to proceed as required to
286 regain control of our vital IT operations.
291 <indexterm><primary>compromise</primary></indexterm>
292 <indexterm><primary>network</primary><secondary>multi-segment</secondary></indexterm>
293 Every compromise has consequences. Having a large routed (i.e., multisegment) network with only a
294 single domain controller is a poor design that has obvious operational effects that may
295 frustrate users. Here is your reply:
298 <blockquote><attribution>Bob</attribution><para>
299 Christine, Your diligence and attention to detail are much valued. Stan and I fully support your
300 proposals to resolve the issues. I am confident that your plans fully realized will significantly
301 boost staff morale. Please go ahead with your plans. If you have any problems, please let me know.
302 Please let Stan know what the estimated cost will be so I can approve the expense. Do not wait
303 for approval; I appreciate the urgency.
307 <title>Assignment Tasks</title>
310 The priority of assigned tasks in this chapter is:
315 <indexterm><primary>Backup Domain Controller</primary><see>BDC</see></indexterm>
316 <indexterm><primary>BDC</primary></indexterm>
317 <indexterm><primary>tdbsam</primary></indexterm>
318 <indexterm><primary>LDAP</primary></indexterm><indexterm><primary>migration</primary></indexterm>
319 Implement Backup Domain Controllers (BDCs) in each building. This involves
320 a change from a <emphasis>tdbsam</emphasis> backend that was used in the previous
321 chapter to an LDAP-based backend.
325 You can implement a single central LDAP server for this purpose.
329 <indexterm><primary>logon time</primary></indexterm>
330 <indexterm><primary>network share</primary></indexterm>
331 <indexterm><primary>default profile</primary></indexterm>
332 <indexterm><primary>profile</primary><secondary>default</secondary></indexterm>
333 Rectify the problem of excessive logon times. This involves redirection of
334 folders to network shares as well as modification of all user desktops to
335 exclude the redirected folders from being loaded at login time. You can also
336 create a new default profile that can be used for all new users.
341 <indexterm><primary>disk image</primary></indexterm>
342 You configure a new MS Windows XP Professional workstation disk image that you roll out
343 to all desktop users. The instructions you have created are followed on a staging machine
344 from which all changes can be carefully tested before inflicting them on your network users.
348 <indexterm><primary>CUPS</primary></indexterm>
349 This is the last network example in which specific mention of printing is made. The example
350 again makes use of the CUPS printing system.
358 <title>Dissection and Discussion</title>
361 <indexterm><primary>BDC</primary></indexterm>
362 <indexterm><primary>LDAP</primary></indexterm>
363 <indexterm><primary>OpenLDAP</primary></indexterm>
364 The implementation of Samba BDCs necessitates the installation and configuration of LDAP.
365 For this site, you use OpenLDAP, the open source software LDAP server platform. Commercial
366 LDAP servers in current use with Samba-3 include:
371 <indexterm><primary>eDirectory</primary></indexterm>
372 Novell <ulink url="http://www.novell.com/products/edirectory/">eDirectory</ulink>
373 is being successfully used by some sites. Information on how to use eDirectory can be
374 obtained from the Samba mailing lists or from Novell.
378 <indexterm><primary>Tivoli Directory Server</primary></indexterm>
379 IBM <ulink url="http://www-306.ibm.com/software/tivoli/products/directory-server/">Tivoli
380 Directory Server</ulink> can be used to provide the Samba LDAP backend. Example schema
381 files are provided in the Samba source code tarball under the directory
382 <filename>~samba/example/LDAP.</filename>
386 <indexterm><primary>Sun ONE Identity Server</primary></indexterm>
387 Sun <ulink url="http://www.sun.com/software/software/products/identity_srvr/home_identity.xml">ONE Identity
388 Server product suite</ulink> provides an LDAP server that can be used for Samba.
389 Example schema files are provided in the Samba source code tarball under the directory
390 <filename>~samba/example/LDAP.</filename>
395 A word of caution is fully in order. OpenLDAP is purely an LDAP server, and unlike commercial
396 offerings, it requires that you manually edit the server configuration files and manually
397 initialize the LDAP directory database. OpenLDAP itself has only command-line tools to
398 help you to get OpenLDAP and Samba-3 running as required, albeit with some learning curve challenges.
402 <indexterm><primary>Active Directory</primary></indexterm>
403 For most sites, the deployment of Microsoft Active Directory from the shrink-wrapped installation is quite
404 adequate. If you are migrating from Microsoft Active Directory, be warned that OpenLDAP does not include
405 GUI-based directory management tools. Even a simple task such as adding users to the OpenLDAP database
406 requires an understanding of what you are doing, why you are doing it, and the tools that you must use.
410 <indexterm><primary>Identity Management</primary></indexterm>
411 <indexterm><primary>high availability</primary></indexterm>
412 <indexterm><primary>directory</primary><secondary>replication</secondary></indexterm>
413 <indexterm><primary>directory</primary><secondary>synchronization</secondary></indexterm>
414 <indexterm><primary>performance</primary></indexterm>
415 <indexterm><primary>directory</primary><secondary>management</secondary></indexterm>
416 <indexterm><primary>directory</primary><secondary>schema</secondary></indexterm>
417 When installed and configured, an OpenLDAP Identity Management backend for Samba functions well.
418 High availability operation may be obtained through directory replication/synchronization and
419 master/slave server configurations. OpenLDAP is a mature platform to host the organizational
420 directory infrastructure that can include all UNIX accounts, directories for electronic mail, and much more.
421 The price paid through learning how to design an LDAP directory schema in implementation and configuration
422 of management tools is well rewarded by performance and flexibility and the freedom to manage directory
423 contents with greater ability to back up, restore, and modify the directory than is generally possible
424 with Microsoft Active Directory.
428 <indexterm><primary>comparison</primary><secondary>Active Directory & OpenLDAP</secondary></indexterm>
429 <indexterm><primary>ADAM</primary></indexterm>
430 <indexterm><primary>Active Directory</primary></indexterm>
431 <indexterm><primary>OpenLDAP</primary></indexterm>
432 A comparison of OpenLDAP with Microsoft Active Directory does not do justice to either. OpenLDAP is an LDAP directory
433 tool-set. Microsoft Active Directory Server is an implementation of an LDAP server that is largely preconfigured
434 for a specific task orientation. It comes with a set of administrative tools that is entirely customized
435 for the purpose of running MS Windows applications that include file and print services, Microsoft Exchange
436 server, Microsoft SQL server, and more. The complexity of OpenLDAP is highly valued by the UNIX administrator
437 who wants to build a custom directory solution. Microsoft provides an application called
438 <ulink url="http://www.microsoft.com/windowsserver2003/adam/default.mspx">
439 MS ADAM</ulink> that provides more generic LDAP services, yet it does not have the vanilla-like services
444 <indexterm><primary>directory</primary><secondary>schema</secondary></indexterm>
445 <indexterm><primary>passdb backend</primary></indexterm>
446 You may wish to consider outsourcing the development of your OpenLDAP directory to an expert, particularly
447 if you find the challenge of learning about LDAP directories, schemas, configuration, and management
448 tools and the creation of shell and Perl scripts a bit
449 challenging. OpenLDAP can be easily customized, though it includes
450 many ready-to-use schemas. Samba-3 provides an OpenLDAP schema file
451 that is required for use as a passdb backend.
455 <indexterm><primary>interoperability</primary></indexterm>
456 For those who are willing to brave the process of installing and configuring LDAP and Samba-3 interoperability,
457 there are a few nice Web-based tools that may help you to manage your users and groups more effectively.
458 The Web-based tools you might like to consider include the
459 <ulink url="http://lam.sourceforge.net/">LDAP Account Manager</ulink> (LAM) and the Webmin-based
460 <ulink url="http://www.webmin.com">Webmin</ulink> Idealx
461 <ulink url="http://webmin.idealx.org/index.en.html">CGI tools</ulink>.
465 Some additional LDAP tools should be mentioned. Every so often a Samba user reports using one of
466 these, so it may be useful to them:
467 <ulink url="http://biot.com/gq">GQ</ulink>, a GTK-based LDAP browser;
468 LDAP <ulink url="http://www.iit.edu/~gawojar/ldap/">Browser/Editor</ulink>
469 <ulink url="http://www.jxplorer.org/">; JXplorer</ulink> (by Computer Associates);
470 and <ulink url="http://phpldapadmin.sourceforge.net/">phpLDAPadmin</ulink>.
474 The following prescriptive guidance is not an LDAP tutorial. The LDAP implementation expressly uses minimal
475 security controls. No form of secure LDAP communications is attempted. The LDAP configuration information provided
476 is considered to consist of the barest essentials only. You are strongly encouraged to learn more about
477 LDAP before attempting to deploy it in a business-critical environment.
481 Information to help you get started with OpenLDAP is available from the
482 <ulink url="http://www.openldap.org/pub/">OpenLDAP web site</ulink>. Many people have found the book
483 <ulink url="http://www.oreilly.com/catalog/ldapsa/index.html"><emphasis>LDAP System Administration</emphasis>,</ulink>
484 by Jerry Carter quite useful.
488 <indexterm><primary>BDC</primary></indexterm>
489 <indexterm><primary>network</primary><secondary>segment</secondary></indexterm>
490 <indexterm><primary>performance</primary></indexterm>
491 <indexterm><primary>network</primary><secondary>wide-area</secondary></indexterm>
492 Mary's problems are due to two factors. First, the absence of a domain controller on the local network is the
493 main cause of the errors that result in blue screen crashes. Second, Mary has a large profile that must
494 be loaded over the WAN connection. The addition of BDCs on each network segment significantly
495 improves overall network performance for most users, but it is not enough. You must gain control over
496 user desktops, and this must be done in a way that wins their support and does not cause further loss of
497 staff morale. The following procedures solve this problem.
501 <indexterm><primary>smart printing</primary></indexterm>
502 There is also an opportunity to implement smart printing features. You add this to the Samba configuration
503 so that future printer changes can be managed without need to change desktop configurations.
507 You add the ability to automatically download new printer drivers, even if they are not installed
508 in the default desktop profile. Only one example of printing configuration is given. It is assumed that
509 you can extrapolate the principles and use them to install all printers that may be needed.
513 <title>Technical Issues</title>
516 <indexterm><primary>identity</primary><secondary>management</secondary></indexterm>
517 <indexterm><primary>directory</primary><secondary>server</secondary></indexterm>
518 <indexterm><primary>Posix</primary></indexterm>
519 The solution provided is a minimal approach to getting OpenLDAP running as an identity management directory
520 server for UNIX system accounts as well as for Samba. From the OpenLDAP perspective, UNIX system
521 accounts are stored POSIX schema extensions. Samba provides its own schema to permit storage of account
522 attributes Samba needs. Samba-3 can use the LDAP backend to store:
526 <listitem><para>Windows Networking User Accounts</para></listitem>
527 <listitem><para>Windows NT Group Accounts</para></listitem>
528 <listitem><para>Mapping Information between UNIX Groups and Windows NT Groups</para></listitem>
529 <listitem><para>ID Mappings for SIDs to UIDs (also for foreign Domain SIDs)</para></listitem>
533 <indexterm><primary>UNIX accounts</primary></indexterm>
534 <indexterm><primary>Windows accounts</primary></indexterm>
535 <indexterm><primary>PADL LDAP tools</primary></indexterm>
536 <indexterm><primary>/etc/group</primary></indexterm>
537 <indexterm><primary>LDAP</primary></indexterm>
538 <indexterm><primary>name service switch</primary><see>NSS</see></indexterm>
539 <indexterm><primary>NSS</primary></indexterm>
540 <indexterm><primary>UID</primary></indexterm>
541 <indexterm><primary>nss_ldap</primary></indexterm>
542 The use of LDAP with Samba-3 makes it necessary to store UNIX accounts as well as Windows Networking
543 accounts in the LDAP backend. This implies the need to use the
544 <ulink url="http://www.padl.com/Contents/OpenSourceSoftware.html">PADL LDAP tools</ulink>. The resolution
545 of the UNIX group name to its GID must be enabled from either the <filename>/etc/group</filename>
546 or from the LDAP backend. This requires the use of the PADL <filename>nss_ldap</filename> tool-set
547 that integrates with the NSS. The same requirements exist for resolution
548 of the UNIX username to the UID. The relationships are demonstrated in <link linkend="sbehap-LDAPdiag"/>.
551 <figure id="sbehap-LDAPdiag">
552 <title>The Interaction of LDAP, UNIX Posix Accounts and Samba Accounts</title>
553 <imagefile scale="50">UNIX-Samba-and-LDAP</imagefile>
557 <indexterm><primary>security</primary></indexterm>
558 <indexterm><primary>LDAP</primary><secondary>secure</secondary></indexterm>
559 You configure OpenLDAP so that it is operational. Before deploying the OpenLDAP, you really
560 ought to learn how to configure secure communications over LDAP so that site security is not
561 at risk. This is not covered in the following guidance.
565 <indexterm><primary>PDC</primary></indexterm>
566 <indexterm><primary>LDAP Interchange Format</primary><see>LDIF</see></indexterm>
567 <indexterm><primary>LDIF</primary></indexterm>
568 <indexterm><primary>secrets.tdb</primary></indexterm>
569 When OpenLDAP has been made operative, you configure the PDC called <constant>MASSIVE</constant>.
570 You initialize the Samba <filename>secrets.tdb<subscript></subscript></filename> file. Then you
571 create the LDAP Interchange Format (LDIF) file from which the LDAP database can be initialized.
572 You need to decide how best to create user and group accounts. A few hints are, of course, provided.
573 You can also find on the enclosed CD-ROM, in the <filename>Chap06</filename> directory, a few tools
574 that help to manage user and group configuration.
578 <indexterm><primary>folder redirection</primary></indexterm>
579 <indexterm><primary>default profile</primary></indexterm>
580 <indexterm><primary>roaming profile</primary></indexterm>
581 In order to effect folder redirection and to add robustness to the implementation,
582 create a network default profile. All network users workstations are configured to use
583 the new profile. Roaming profiles will automatically be deleted from the workstation
584 when the user logs off.
588 <indexterm><primary>mandatory profile</primary></indexterm>
589 The profile is configured so that users cannot change the appearance
590 of their desktop. This is known as a mandatory profile. You make certain that users
591 are able to use their computers efficiently.
595 <indexterm><primary>logon script</primary></indexterm>
596 A network logon script is used to deliver flexible but consistent network drive
600 <sect3 id="sbehap-ppc">
601 <title>Addition of Machines to the Domain</title>
604 <indexterm><primary></primary></indexterm>
605 <indexterm><primary></primary></indexterm>
606 <indexterm><primary></primary></indexterm>
607 <indexterm><primary></primary></indexterm>
608 Samba versions prior to 3.0.11 necessitated the use of a domain administrator account
609 that maps to the UNIX UID=0. The UNIX operating system permits only the <constant>root</constant>
610 user to add user and group accounts. Samba 3.0.11 introduced a new facility known as
611 <constant>Privileges</constant>, which provides five new privileges that
612 can be assigned to users and/or groups; see Table 5.1.
616 <table id="sbehap-privs">
617 <title>Current Privilege Capabilities</title>
619 <colspec align="left"/>
620 <colspec align="left"/>
623 <entry align="left">Privilege</entry>
624 <entry align="left">Description</entry>
629 <entry><para>SeMachineAccountPrivilege</para></entry>
630 <entry><para>Add machines to domain</para></entry>
633 <entry><para>SePrintOperatorPrivilege</para></entry>
634 <entry><para>Manage printers</para></entry>
637 <entry><para>SeAddUsersPrivilege</para></entry>
638 <entry><para>Add users and groups to the domain</para></entry>
641 <entry><para>SeRemoteShutdownPrivilege</para></entry>
642 <entry><para>Force shutdown from a remote system</para></entry>
645 <entry><para>SeDiskOperatorPrivilege</para></entry>
646 <entry><para>Manage disk share</para></entry>
653 In this network example use is made of one of the supported privileges purely to demonstrate
654 how any user can now be given the ability to add machines to the domain using a normal user account
655 that has been given the appropriate privileges.
661 <title>Roaming Profile Background</title>
664 As XP roaming profiles grow, so does the amount of time it takes to log in and out.
668 <indexterm><primary>roaming profile</primary></indexterm>
669 <indexterm><primary>HKEY_CURRENT_USER</primary></indexterm>
670 <indexterm><primary>NTUSER.DAT</primary></indexterm>
671 <indexterm><primary>%USERNAME%</primary></indexterm>
672 An XP roaming profile consists of the <constant>HKEY_CURRENT_USER</constant> hive file
673 <filename>NTUSER.DAT</filename> and a number of folders (My Documents, Application Data,
674 Desktop, Start Menu, Templates, NetHood, Favorites, and so on). When a user logs onto the
675 network with the default configuration of MS Windows NT/200x/XPP, all this data is
676 copied to the local machine under the <filename>C:\Documents and Settings\%USERNAME%</filename>
677 directory. While the user is logged in, any changes made to any of these folders or to the
678 <constant>HKEY_CURRENT_USER</constant> branch of the registry are made to the local copy
679 of the profile. At logout the profile data is copied back to the server. This behavior
680 can be changed through appropriate registry changes and/or through changes to the default
681 user profile. In the latter case, it updates the registry with the values that are set in the
682 profile <filename>NTUSER.DAT</filename>
687 The first challenge is to reduce the amount of data that must be transferred to and
688 from the profile server as roaming profiles are processed. This includes removing
689 all the shortcuts in the Recent directory, making sure the cache used by the Web browser
690 is not being dumped into the <filename>Application Data</filename> folder, removing the
691 Java plug-ins cache (the .jpi_cache directory in the profile), as well as training the
692 user to not place large files on the desktop and to use his or her mapped home directory
693 instead of the <filename>My Documents</filename> folder for saving documents.
697 <indexterm><primary>My Documents</primary></indexterm>
698 Using a folder other than <filename>My Documents</filename> is a nuisance for
699 some users, since many applications use it by default.
703 <indexterm><primary>roaming profiles</primary></indexterm>
704 <indexterm><primary>Local Group Policy</primary></indexterm>
705 <indexterm><primary>NTUSER.DAT</primary></indexterm>
706 The secret to rapid loading of roaming profiles is to prevent unnecessary data from
707 being copied back and forth, without losing any functionality. This is not difficult;
708 it can be done by making changes to the Local Group Policy on each client as well
709 as changing some paths in each user's <filename>NTUSER.DAT</filename> hive.
713 <indexterm><primary>Network Default Profile</primary></indexterm>
714 <indexterm><primary>redirected folders</primary></indexterm>
715 Every user profile has its own <filename>NTUSER.DAT</filename> file. This means
716 you need to edit every user's profile, unless a better method can be
717 followed. Fortunately, with the right preparations, this is not difficult.
718 It is possible to remove the <filename>NTUSER.DAT</filename> file from each
719 user's profile. Then just create a Network Default Profile. Of course, it is
720 necessary to copy all files from redirected folders to the network share to which
726 <sect3 id="sbehap-locgrppol">
727 <title>The Local Group Policy</title>
730 <indexterm><primary>Group Policy Objects</primary></indexterm>
731 <indexterm><primary>Active Directory</primary></indexterm>
732 <indexterm><primary>PDC</primary></indexterm>
733 <indexterm><primary>Group Policy editor</primary></indexterm>
734 Without an Active Directory PDC, you cannot take full advantage of Group Policy
735 Objects. However, you can still make changes to the Local Group Policy by using
736 the Group Policy editor (<command>gpedit.msc</command>).
740 The <emphasis>Exclude directories in roaming profile</emphasis> settings can
743 <guimenu>User Configuration</guimenu>
744 <guimenuitem>Administrative Templates</guimenuitem>
745 <guimenuitem>System</guimenuitem>
746 <guimenuitem>User Profiles</guimenuitem>
748 By default this setting contains
749 <quote>Local Settings; Temporary Internet Files; History; Temp</quote>.
753 Simply add the folders you do not wish to be copied back and forth to this
754 semicolon-separated list. Note that this change must be made on all clients
755 that are using roaming profiles.
761 <title>Profile Changes</title>
764 <indexterm><primary>NTUSER.DAT</primary></indexterm>
765 <indexterm><primary>%USERNAME%</primary></indexterm>
766 There are two changes that should be done to each user's profile. Move each of
767 the directories that you have excluded from being copied back and forth out of
768 the usual profile path. Modify each user's <filename>NTUSER.DAT</filename> file
769 to point to the new paths that are shared over the network instead of to the default
770 path (<filename>C:\Documents and Settings\%USERNAME%</filename>).
774 <indexterm><primary>Default User</primary></indexterm>
775 <indexterm><primary>regedt32</primary></indexterm>
776 The above modifies existing user profiles. So that newly created profiles have
777 these settings, you need to modify the <filename>NTUSER.DAT</filename> in
778 the <filename>C:\Documents and Settings\Default User</filename> folder on each
779 client machine, changing the same registry keys. You could do this by copying
780 <filename>NTUSER.DAT</filename> to a Linux box and using <command>regedt32</command>.
781 The basic method is described under <link linkend="redirfold"/>.
787 <title>Using a Network Default User Profile</title>
790 <indexterm><primary>NETLOGON</primary></indexterm>
791 <indexterm><primary>NTUSER.DAT</primary></indexterm>
792 If you are using Samba as your PDC, you should create a file share called
793 <constant>NETLOGON</constant> and within that create a directory called
794 <filename>Default User</filename>, which is a copy of the desired default user
795 configuration (including a copy of <filename>NTUSER.DAT</filename>).
796 If this share exists and the <filename>Default User</filename> folder exists,
797 the first login from a new account pulls its configuration from it.
798 See also <ulink url="http://isg.ee.ethz.ch/tools/realmen/det/skel.en.html">
799 the Real Men Don't Click</ulink> Web site.
805 <title>Installation of Printer Driver Auto-Download</title>
808 <indexterm><primary>printing</primary><secondary>dumb</secondary></indexterm>
809 <indexterm><primary>dumb printing</primary></indexterm>
810 <indexterm><primary>Raw Print Through</primary></indexterm>
811 The subject of printing is quite topical. Printing problems run second place to name
812 resolution issues today. So far in this book, you have experienced only what is generally
813 known as <quote>dumb</quote> printing. Dumb printing is the arrangement by which all drivers
814 are manually installed on each client and the printing subsystems perform no filtering
815 or intelligent processing. Dumb printing is easily understood. It usually works without
816 many problems, but it has its limitations also. Dumb printing is better known as
817 <command>Raw-Print-Through</command> printing.
821 <indexterm><primary>printing</primary><secondary>drag-and-drop</secondary></indexterm>
822 <indexterm><primary>printing</primary><secondary>point-n-click</secondary></indexterm>
823 Samba permits the configuration of <command>smart</command> printing using the Microsoft
824 Windows point-and-click (also called drag-and-drop) printing. What this provides is
825 essentially the ability to print to any printer. If the local client does not yet have a
826 driver installed, the driver is automatically downloaded from the Samba server and
827 installed on the client. Drag-and-drop printing is neat; it means the user never needs
828 to fuss with driver installation, and that is a <trademark>Good Thing,</trademark>
833 There is a further layer of print job processing that is known as <command>intelligent</command>
834 printing that automatically senses the file format of data submitted for printing and
835 then invokes a suitable print filter to convert the incoming data stream into a format
836 suited to the printer to which the job is dispatched.
840 <indexterm><primary>CUPS</primary></indexterm>
841 <indexterm><primary>Easy Software Products</primary></indexterm>
842 <indexterm><primary>Postscript</primary></indexterm>
843 The CUPS printing subsystem is capable of intelligent printing. It has the capacity to
844 detect the data format and apply a print filter. This means that it is feasible to install
845 on all Windows clients a single printer driver for use with all printers that are routed
846 through CUPS. The most sensible driver to use is one for a PostScript printer. Fortunately,
847 <ulink url="http://www.easysw.com">Easy Software Products</ulink>, the authors of CUPS, have
848 released a PostScript printing driver for Windows. It can be installed into the Samba
849 printing backend so that it automatically downloads to the client when needed.
853 This means that so long as there is a CUPS driver for the printer, all printing from Windows
854 software can use PostScript, no matter what the actual printer language for the physical
855 device is. It also means that the administrator can swap out a printer with a totally
856 different type of device without ever needing to change a client workstation driver.
860 This book is about Samba-3, so you can confine the printing style to just the smart
861 style of installation. Those interested in further information regarding intelligent
862 printing should review documentation on the Easy Software Products Web site.
867 <sect3 id="sbeavoid">
868 <title>Avoiding Failures: Solving Problems Before They Happen</title>
871 It has often been said that there are three types of people in the world: those who
872 have sharp minds and those who forget things. Please do not ask what the third group
873 is like! Well, it seems that many of us have company in the second group. There must
874 be a good explanation why so many network administrators fail to solve apparently
875 simple problems efficiently and effectively.
879 Here are some diagnostic guidelines that can be referred to when things go wrong:
883 <title>Preliminary Advice: Dangers Can Be Avoided</title>
886 The best advice regarding how to mend a broken leg is <quote>Never break a leg!</quote>
890 <indexterm><primary>LDAP</primary></indexterm>
891 Newcomers to Samba and LDAP seem to struggle a great deal at first. If you want advice
892 regarding the best way to remedy LDAP and Samba problems: <quote>Avoid them like the plague!</quote>
896 If you are now asking yourself how problems can be avoided, the best advice is to start
897 out your learning experience with a <emphasis>known-good configuration.</emphasis> After
898 you have seen a fully working solution, a good way to learn is to make slow and progressive
899 changes that cause things to break, then observe carefully how and why things ceased to work.
903 The examples in this chapter (also in the book as a whole) are known to work. That means
904 that they could serve as the kick-off point for your journey through fields of knowledge.
905 Use this resource carefully; we hope it serves you well.
909 Do not be lulled into thinking that you can easily adopt the examples in this
910 book and adapt them without first working through the examples provided. A little
911 thing overlooked can cause untold pain and may permanently tarnish your experience.
917 <title>The Name Service Caching Daemon</title>
920 The name service caching daemon (nscd) is a primary cause of difficulties with name
921 resolution, particularly where <command>winbind</command> is used. Winbind does its
922 own caching, thus nscd causes double caching which can lead to peculiar problems during
923 debugging. As a rule, it is a good idea to turn off the name service caching daemon.
927 Operation of the name service caching daemon is controlled by the
928 <filename>/etc/nscd.conf</filename> file. Typical contents of this file are as follows:
931 # An example Name Service Cache config file. This file is needed by nscd.
933 # logfile <file>
934 # debug-level <level>
935 # threads <threads to use>
936 # server-user <user to run server as instead of root>
937 # server-user is ignored if nscd is started with -S parameters
938 # stat-user <user who is allowed to request statistics>
939 # reload-count unlimited|<number>
941 # enable-cache <service> <yes|no>
942 # positive-time-to-live <service> <time in seconds>
943 # negative-time-to-live <service> <time in seconds>
944 # suggested-size <service> <prime number>
945 # check-files <service> <yes|no>
946 # persistent <service> <yes|no>
947 # shared <service> <yes|no>
948 # Currently supported cache names (services): passwd, group, hosts
949 # logfile /var/log/nscd.log
955 enable-cache passwd yes
956 positive-time-to-live passwd 600
957 negative-time-to-live passwd 20
958 suggested-size passwd 211
959 check-files passwd yes
960 persistent passwd yes
962 enable-cache group yes
963 positive-time-to-live group 3600
964 negative-time-to-live group 60
965 suggested-size group 211
966 check-files group yes
969 # !!!!!WARNING!!!!! Host cache is insecure!!! The mechanism in nscd to
970 # cache hosts will cause your local system to not be able to trust
971 # forward/reverse lookup checks. DO NOT USE THIS if your system relies on
972 # this sort of security mechanism. Use a caching DNS server instead.
973 enable-cache hosts no
974 positive-time-to-live hosts 3600
975 negative-time-to-live hosts 20
976 suggested-size hosts 211
977 check-files hosts yes
981 It is feasible to comment out the <constant>passwd</constant> and <constant>group</constant>
982 entries so they will not be cached. Alternatively, it is often simpler to just disable the
983 <command>nscd</command> service by executing (on Novell SUSE Linux):
985 &rootprompt; chkconfig nscd off
986 &rootprompt; rcnscd off
993 <title>Debugging LDAP</title>
996 <indexterm><primary>/etc/openldap/slapd.conf</primary></indexterm>
997 <indexterm><primary>loglevel</primary></indexterm>
998 <indexterm><primary>slapd</primary></indexterm>
999 In the example <filename>/etc/openldap/slapd.conf</filename> control file
1000 (see <link linkend="sbehap-dbconf"/>) there is an entry for <constant>loglevel 256</constant>.
1001 To enable logging via the syslog infrastructure, it is necessary to uncomment this parameter
1002 and restart <command>slapd</command>.
1006 <indexterm><primary>/etc/syslog.conf</primary></indexterm>
1007 <indexterm><primary>/var/log/ldaplogs</primary></indexterm>
1008 LDAP log information can be directed into a file that is separate from the normal system
1009 log files by changing the <filename>/etc/syslog.conf</filename> file so it has the following
1012 # Some foreign boot scripts require local7
1014 local0,local1.* -/var/log/localmessages
1015 local2,local3.* -/var/log/localmessages
1016 local5.* -/var/log/localmessages
1017 local6,local7.* -/var/log/localmessages
1018 local4.* -/var/log/ldaplogs
1020 In this case, all LDAP-related logs will be directed to the file
1021 <filename>/var/log/ldaplogs</filename>. This makes it easy to track LDAP errors.
1022 The snippet provides a simple example of usage that can be modified to suit
1023 local site needs. The configuration used later in this chapter reflects such
1024 customization with the intent that LDAP log files will be stored at a location
1025 that meets local site needs and wishes more fully.
1031 <title>Debugging NSS_LDAP</title>
1034 The basic mechanism for diagnosing problems with the nss_ldap utility involves adding to the
1035 <filename>/etc/ldap.conf</filename> file the following parameters:
1040 Create the log directory as follows:
1042 &rootprompt; mkdir /data/logs
1047 The diagnostic process should follow these steps:
1051 <title>NSS_LDAP Diagnostic Steps</title>
1054 Verify the <constant>nss_base_passwd, nss_base_shadow, nss_base_group</constant> entries
1055 in the <filename>/etc/ldap.conf</filename> file and compare them closely with the directory
1056 tree location that was chosen when the directory was first created.
1060 One way this can be done is by executing:
1062 &rootprompt; slapcat | grep Group | grep dn
1063 dn: ou=Groups,dc=abmas,dc=biz
1064 dn: cn=Domain Admins,ou=Groups,dc=abmas,dc=biz
1065 dn: cn=Domain Users,ou=Groups,dc=abmas,dc=biz
1066 dn: cn=Domain Guests,ou=Groups,dc=abmas,dc=biz
1067 dn: cn=Domain Computers,ou=Groups,dc=abmas,dc=biz
1068 dn: cn=Administrators,ou=Groups,dc=abmas,dc=biz
1069 dn: cn=Print Operators,ou=Groups,dc=abmas,dc=biz
1070 dn: cn=Backup Operators,ou=Groups,dc=abmas,dc=biz
1071 dn: cn=Replicators,ou=Groups,dc=abmas,dc=biz
1073 The first line is the DIT entry point for the container for POSIX groups. The correct entry
1074 for the <filename>/etc/ldap.conf</filename> for the <constant>nss_base_group</constant>
1075 parameter therefore is the distinguished name (dn) as applied here:
1077 nss_base_group ou=Groups,dc=abmas,dc=biz?one
1079 The same process may be followed to determine the appropriate dn for user accounts.
1080 If the container for computer accounts is not the same as that for users (see the &smb.conf;
1081 file entry for <constant>ldap machine suffix</constant>), it may be necessary to set the
1082 following DIT dn in the <filename>/etc/ldap.conf</filename> file:
1084 nss_base_passwd dc=abmas,dc=biz?sub
1086 This instructs LDAP to search for machine as well as user entries from the top of the DIT
1087 down. This is inefficient, but at least should work. Note: It is possible to specify multiple
1088 <constant>nss_base_passwd</constant> entries in the <filename>/etc/ldap.conf</filename> file; they
1089 will be evaluated sequentially. Let us consider an example of use where the following DIT
1090 has been implemented:
1095 <listitem><para>User accounts are stored under the DIT: ou=Users, dc=abmas, dc=biz</para></listitem>
1096 <listitem><para>User login accounts are under the DIT: ou=People, ou-Users, dc=abmas, dc=biz</para></listitem>
1097 <listitem><para>Computer accounts are under the DIT: ou=Computers, ou=Users, dc=abmas, dc=biz</para></listitem>
1102 The appropriate multiple entry for the <constant>nss_base_passwd</constant> directive
1103 in the <filename>/etc/ldap.conf</filename> file may be:
1105 nss_base_passwd ou=People,ou=Users,dc=abmas,dc=org?one
1106 nss_base_passwd ou=Computers,ou=Users,dc=abmas,dc=org?one
1111 Perform lookups such as:
1113 &rootprompt; getent passwd
1115 Each such lookup will create an entry in the <filename>/data/log</filename> directory
1116 for each such process executed. The contents of each file created in this directory
1117 may provide a hint as to the cause of the a problem that is under investigation.
1121 For additional diagnostic information, check the contents of the <filename>/var/log/messages</filename>
1122 to see what error messages are being generated as a result of the LDAP lookups. Here is an example of
1123 a successful lookup:
1125 slapd[12164]: conn=0 fd=10 ACCEPT from IP=127.0.0.1:33539
1127 slapd[12164]: conn=0 op=0 BIND dn="" method=128
1128 slapd[12164]: conn=0 op=0 RESULT tag=97 err=0 text=
1129 slapd[12164]: conn=0 op=1 SRCH base="" scope=0 deref=0
1130 filter="(objectClass=*)"
1131 slapd[12164]: conn=0 op=1 SEARCH RESULT tag=101 err=0
1133 slapd[12164]: conn=0 op=2 UNBIND
1134 slapd[12164]: conn=0 fd=10 closed
1135 slapd[12164]: conn=1 fd=10 ACCEPT from
1136 IP=127.0.0.1:33540 (IP=0.0.0.0:389)
1137 slapd[12164]: conn=1 op=0 BIND
1138 dn="cn=Manager,dc=abmas,dc=biz" method=128
1139 slapd[12164]: conn=1 op=0 BIND
1140 dn="cn=Manager,dc=abmas,dc=biz" mech=SIMPLE ssf=0
1141 slapd[12164]: conn=1 op=0 RESULT tag=97 err=0 text=
1142 slapd[12164]: conn=1 op=1 SRCH
1143 base="ou=People,dc=abmas,dc=biz" scope=1 deref=0
1144 filter="(objectClass=posixAccount)"
1145 slapd[12164]: conn=1 op=1 SRCH attr=uid userPassword
1146 uidNumber gidNumber cn
1147 homeDirectory loginShell gecos description objectClass
1148 slapd[12164]: conn=1 op=1 SEARCH RESULT tag=101 err=0
1150 slapd[12164]: conn=1 fd=10 closed
1156 Check that the bindpw entry in the <filename>/etc/ldap.conf</filename> or in the
1157 <filename>/etc/ldap.secrets</filename> file is correct, as specified in the
1158 <filename>/etc/openldap/slapd.conf</filename> file.
1166 <title>Debugging Samba</title>
1169 The following parameters in the &smb.conf; file can be useful in tracking down Samba-related problems:
1174 log file = /var/log/samba/%m.log
1178 This will result in the creation of a separate log file for every client from which connections
1179 are made. The log file will be quite verbose and will grow continually. Do not forget to
1180 change these lines to the following when debugging has been completed:
1185 log file = /var/log/samba/%m.log
1192 The log file can be analyzed by executing:
1194 &rootprompt; cd /var/log/samba
1195 &rootprompt; grep -v "^\[200" machine_name.log
1200 Search for hints of what may have failed by looking for the words <emphasis>fail</emphasis>
1201 and <emphasis>error</emphasis>.
1207 <title>Debugging on the Windows Client</title>
1210 MS Windows 2000 Professional and Windows XP Professional clients can be configured
1211 to create a netlogon.log file that can be very helpful in diagnosing network logon problems. Search
1212 the Microsoft knowledge base for detailed instructions. The techniques vary a little with each
1213 version of MS Windows.
1224 <title>Political Issues</title>
1227 MS Windows network users are generally very sensitive to limits that may be imposed when
1228 confronted with locked-down workstation configurations. The challenge you face must
1229 be promoted as a choice between reliable, fast network operation and a constant flux
1230 of problems that result in user irritation.
1236 <title>Installation Checklist</title>
1239 You are starting a complex project. Even though you went through the installation of a complex
1240 network in <link linkend="Big500users"/>, this network is a bigger challenge because of the
1241 large number of complex applications that must be configured before the first few steps
1242 can be validated. Take stock of what you are about to undertake, prepare yourself, and
1243 frequently review the steps ahead while making at least a mental note of what has already
1244 been completed. The following task list may help you to keep track of the task items
1250 <listitem><para>Samba-3 PDC Server Configuration</para>
1252 <listitem><para>DHCP and DNS servers</para></listitem>
1253 <listitem><para>OpenLDAP server</para></listitem>
1254 <listitem><para>PAM and NSS client tools</para></listitem>
1255 <listitem><para>Samba-3 PDC</para></listitem>
1256 <listitem><para>Idealx smbldap scripts</para></listitem>
1257 <listitem><para>LDAP initialization</para></listitem>
1258 <listitem><para>Create user and group accounts</para></listitem>
1259 <listitem><para>Printers</para></listitem>
1260 <listitem><para>Share point directory roots</para></listitem>
1261 <listitem><para>Profile directories</para></listitem>
1262 <listitem><para>Logon scripts</para></listitem>
1263 <listitem><para>Configuration of user rights and privileges</para></listitem>
1266 <listitem><para>Samba-3 BDC Server Configuration</para>
1268 <listitem><para>DHCP and DNS servers</para></listitem>
1269 <listitem><para>PAM and NSS client tools</para></listitem>
1270 <listitem><para>Printers</para></listitem>
1271 <listitem><para>Share point directory roots</para></listitem>
1272 <listitem><para>Profiles directories</para></listitem>
1275 <listitem><para>Windows XP Client Configuration</para>
1277 <listitem><para>Default profile folder redirection</para></listitem>
1278 <listitem><para>MS Outlook PST file relocation</para></listitem>
1279 <listitem><para>Delete roaming profile on logout</para></listitem>
1280 <listitem><para>Upload printer drivers to Samba servers</para></listitem>
1281 <listitem><para>Install software</para></listitem>
1282 <listitem><para>Creation of roll-out images</para></listitem>
1293 <title>Samba Server Implementation</title>
1296 <indexterm><primary>file servers</primary></indexterm>
1297 <indexterm><primary>BDC</primary></indexterm>
1298 The network design shown in <link linkend="chap6net"/> is not comprehensive. It is assumed
1299 that you will install additional file servers and possibly additional BDCs.
1302 <figure id="chap6net">
1303 <title>Network Topology &smbmdash; 500 User Network Using ldapsam passdb backend</title>
1304 <imagefile scale="50">chap6-net</imagefile>
1308 <indexterm><primary>SUSE Linux</primary></indexterm>
1309 <indexterm><primary>Red Hat Linux</primary></indexterm>
1310 All configuration files and locations are shown for SUSE Linux 9.2 and are equally valid for SUSE
1311 Linux Enterprise Server 9. The file locations for Red Hat Linux are similar. You may need to
1312 adjust the locations for your particular Linux system distribution/implementation.
1316 The following information applies to Samba-3.0.20 when used with the Idealx smbldap-tools
1317 scripts version 0.9.1. If using a different version of Samba or of the smbldap-tools tarball,
1318 please verify that the versions you are about to use are matching. The smbldap-tools package
1319 uses counter-entries in the LDAP directory to avoid duplication of the UIDs and GIDs that are
1320 issued for POSIX accounts. The LDAP rdn under which this information is stored are called
1321 <constant>uidNumber</constant> and <constant>gidNumber</constant> respectively. These may be
1322 located in any convenient part of the directory information tree (DIT). In the examples that
1323 follow they have been located under <constant>dn=sambaDomainName=MEGANET2,dc=abmas,dc=org</constant>.
1324 They could just as well be located under the rdn <constant>cn=NextFreeUnixId</constant>.
1328 The steps in the process involve changes from the network configuration shown in
1329 <link linkend="Big500users"/>. Before implementing the following steps, you must
1330 have completed the network implementation shown in that chapter. If you are starting
1331 with newly installed Linux servers, you must complete the steps shown in
1332 <link linkend="ch5-dnshcp-setup"/> before commencing at <link linkend="ldapsetup"/>.
1335 <sect2 id="ldapsetup">
1336 <title>OpenLDAP Server Configuration</title>
1339 <indexterm><primary>nss_ldap</primary></indexterm>
1340 <indexterm><primary>pam_ldap</primary></indexterm>
1341 <indexterm><primary>openldap</primary></indexterm>
1342 Confirm that the packages shown in <link linkend="oldapreq"/> are installed on your system.
1345 <table id="oldapreq">
1346 <title>Required OpenLDAP Linux Packages</title>
1348 <colspec align="left"/>
1349 <colspec align="left"/>
1350 <colspec align="left"/>
1353 <entry align="center">SUSE Linux 8.x</entry>
1354 <entry align="center">SUSE Linux 9.x</entry>
1355 <entry align="center">Red Hat Linux</entry>
1360 <entry>nss_ldap</entry>
1361 <entry>nss_ldap</entry>
1362 <entry>nss_ldap</entry>
1365 <entry>pam_ldap</entry>
1366 <entry>pam_ldap</entry>
1367 <entry>pam_ldap</entry>
1370 <entry>openldap2</entry>
1371 <entry>openldap2</entry>
1372 <entry>openldap</entry>
1375 <entry>openldap2-client</entry>
1376 <entry>openldap2-client</entry>
1384 Samba-3 and OpenLDAP will have a degree of interdependence that is unavoidable. The method
1385 for bootstrapping the LDAP and Samba-3 configuration is relatively straightforward. If you
1386 follow these guidelines, the resulting system should work fine.
1390 <title>OpenLDAP Server Configuration Steps</title>
1393 <indexterm><primary>/etc/openldap/slapd.conf</primary></indexterm>
1394 Install the file shown in <link linkend="sbehap-slapdconf"/> in the directory
1395 <filename>/etc/openldap</filename>.
1399 <indexterm><primary>/data/ldap</primary></indexterm>
1400 <indexterm><primary>group account</primary></indexterm>
1401 <indexterm><primary>user account</primary></indexterm>
1402 Remove all files from the directory <filename>/data/ldap</filename>, making certain that
1403 the directory exists with permissions:
1405 &rootprompt; ls -al /data | grep ldap
1406 drwx------ 2 ldap ldap 48 Dec 15 22:11 ldap
1408 This may require you to add a user and a group account for LDAP if they do not exist.
1412 <indexterm><primary>DB_CONFIG</primary></indexterm>
1413 Install the file shown in <link linkend="sbehap-dbconf"/> in the directory
1414 <filename>/data/ldap</filename>. In the event that this file is added after <constant>ldap</constant>
1415 has been started, it is possible to cause the new settings to take effect by shutting down
1416 the <constant>LDAP</constant> server, executing the <command>db_recover</command> command inside the
1417 <filename>/data/ldap</filename> directory, and then restarting the <constant>LDAP</constant> server.
1421 <indexterm><primary>syslog</primary></indexterm>
1422 Performance logging can be enabled and should preferably be sent to a file on
1423 a file system that is large enough to handle significantly sized logs. To enable
1424 the logging at a verbose level to permit detailed analysis, uncomment the entry in
1425 the <filename>/etc/openldap/slapd.conf</filename> shown as <quote>loglevel 256</quote>.
1429 Edit the <filename>/etc/syslog.conf</filename> file to add the following at the end
1432 local4.* -/data/ldap/log/openldap.log
1434 Note: The path <filename>/data/ldap/log</filename> should be set at a location
1435 that is convenient and that can store a large volume of data.
1440 <example id="sbehap-dbconf">
1441 <title>LDAP DB_CONFIG File</title>
1443 set_cachesize 0 150000000 1
1444 set_lg_regionmax 262144
1445 set_lg_bsize 2097152
1446 #set_lg_dir /var/log/bdb
1447 set_flags DB_LOG_AUTOREMOVE
1451 <example id="sbehap-slapdconf">
1452 <title>LDAP Master Configuration File &smbmdash; <filename>/etc/openldap/slapd.conf</filename> Part A</title>
1454 include /etc/openldap/schema/core.schema
1455 include /etc/openldap/schema/cosine.schema
1456 include /etc/openldap/schema/inetorgperson.schema
1457 include /etc/openldap/schema/nis.schema
1458 include /etc/openldap/schema/samba3.schema
1460 pidfile /var/run/slapd/slapd.pid
1461 argsfile /var/run/slapd/slapd.args
1463 access to dn.base=""
1467 access to attr=userPassword
1471 access to attr=shadowLastChange
1488 suffix "dc=abmas,dc=biz"
1489 rootdn "cn=Manager,dc=abmas,dc=biz"
1492 rootpw {SSHA}86kTavd9Dw3FAz6qzWTrCOKX/c0Qe+UV
1494 directory /data/ldap
1498 <example id="sbehap-slapdconf2">
1499 <title>LDAP Master Configuration File &smbmdash; <filename>/etc/openldap/slapd.conf</filename> Part B</title>
1501 # Indices to maintain
1502 index objectClass eq
1503 index cn pres,sub,eq
1504 index sn pres,sub,eq
1505 index uid pres,sub,eq
1506 index displayName pres,sub,eq
1511 index sambaPrimaryGroupSID eq
1512 index sambaDomainName eq
1519 <sect2 id="sbehap-PAM-NSS">
1520 <title>PAM and NSS Client Configuration</title>
1523 <indexterm><primary>LDAP</primary></indexterm>
1524 <indexterm><primary>NSS</primary></indexterm>
1525 <indexterm><primary>PAM</primary></indexterm>
1526 The steps that follow involve configuration of LDAP, NSS LDAP-based resolution of users and
1527 groups. Also, so that LDAP-based accounts can log onto the system, the steps ahead configure
1528 the Pluggable Authentication Modules (PAM) to permit LDAP-based authentication.
1532 <indexterm><primary>Pluggable Authentication Modules</primary><see>PAM</see></indexterm>
1533 <indexterm><primary>pam_unix2.so</primary></indexterm>
1534 Since you have chosen to put UNIX user and group accounts into the LDAP database, it is likely
1535 that you may want to use them for UNIX system (Linux) local machine logons. This necessitates
1536 correct configuration of PAM. The <command>pam_ldap</command> open source package provides the
1537 PAM modules that most people would use. On SUSE Linux systems, the <command>pam_unix2.so</command>
1538 module also has the ability to redirect authentication requests through LDAP.
1542 <indexterm><primary>YaST</primary></indexterm>
1543 <indexterm><primary>SUSE Linux</primary></indexterm>
1544 <indexterm><primary>Red Hat Linux</primary></indexterm>
1545 <indexterm><primary>authconfig</primary></indexterm>
1546 You have chosen to configure these services by directly editing the system files, but of course, you
1547 know that this configuration can be done using system tools provided by the Linux system vendor.
1548 SUSE Linux has a facility in YaST (the system admin tool) through <menuchoice><guimenu>yast</guimenu>
1549 <guimenuitem>system</guimenuitem><guimenuitem>ldap-client</guimenuitem></menuchoice> that permits
1550 configuration of SUSE Linux as an LDAP client. Red Hat Linux provides the <command>authconfig</command>
1555 <title>PAM and NSS Client Configuration Steps</title>
1558 <indexterm><primary>/lib/libnss_ldap.so.2</primary></indexterm>
1559 <indexterm><primary>/etc/ldap.conf</primary></indexterm>
1560 <indexterm><primary>nss_ldap</primary></indexterm>
1561 Execute the following command to find where the <filename>nss_ldap</filename> module
1562 expects to find its control file:
1564 &rootprompt; strings /lib/libnss_ldap.so.2 | grep conf
1566 The preferred and usual location is <filename>/etc/ldap.conf</filename>.
1570 On the server <constant>MASSIVE</constant>, install the file shown in
1571 <link linkend="sbehap-nss01"/> into the path that was obtained from the step above.
1572 On the servers called <constant>BLDG1</constant> and <constant>BLDG2</constant>, install the file shown in
1573 <link linkend="sbehap-nss02"/> into the path that was obtained from the step above.
1576 <example id="sbehap-nss01">
1577 <title>Configuration File for NSS LDAP Support &smbmdash; <filename>/etc/ldap.conf</filename></title>
1581 base dc=abmas,dc=biz
1583 binddn cn=Manager,dc=abmas,dc=biz
1594 nss_base_passwd ou=People,dc=abmas,dc=biz?one
1595 nss_base_shadow ou=People,dc=abmas,dc=biz?one
1596 nss_base_group ou=Groups,dc=abmas,dc=biz?one
1602 <example id="sbehap-nss02">
1603 <title>Configuration File for NSS LDAP Clients Support &smbmdash; <filename>/etc/ldap.conf</filename></title>
1607 base dc=abmas,dc=biz
1609 binddn cn=Manager,dc=abmas,dc=biz
1620 nss_base_passwd ou=People,dc=abmas,dc=biz?one
1621 nss_base_shadow ou=People,dc=abmas,dc=biz?one
1622 nss_base_group ou=Groups,dc=abmas,dc=biz?one
1629 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1630 Edit the NSS control file (<filename>/etc/nsswitch.conf</filename>) so that the lines that
1631 control user and group resolution will obtain information from the normal system files as
1632 well as from <command>ldap</command>:
1637 hosts: files dns wins
1639 Later, when the LDAP database has been initialized and user and group accounts have been
1640 added, you can validate resolution of the LDAP resolver process. The inclusion of
1641 WINS-based hostname resolution is deliberate so that all MS Windows client hostnames can be
1642 resolved to their IP addresses, whether or not they are DHCP clients.
1646 Some Linux systems (Novell SUSE Linux in particular) add entries to the <filename>nsswitch.conf</filename>
1647 file that may cause operational problems with the configuration methods adopted in this book. It is
1648 advisable to comment out the entries <constant>passwd_compat</constant> and <constant>group_compat</constant>
1649 where they are found in this file.
1653 Even at the risk of overstating the issue, incorrect and inappropriate configuration of the
1654 <filename>nsswitch.conf</filename> file is a significant cause of operational problems with LDAP.
1658 <indexterm><primary>pam_unix2.so</primary><secondary>use_ldap</secondary></indexterm>
1659 For PAM LDAP configuration on this SUSE Linux 9.0 system, the simplest solution is to edit the following
1660 files in the <filename>/etc/pam.d</filename> directory: <command>login</command>, <command>password</command>,
1661 <command>samba</command>, <command>sshd</command>. In each file, locate every entry that has the
1662 <command>pam_unix2.so</command> entry and add to the line the entry <command>use_ldap</command> as shown
1663 for the <command>login</command> module in this example:
1666 auth requisite pam_unix2.so nullok use_ldap #set_secrpc
1667 auth required pam_securetty.so
1668 auth required pam_nologin.so
1669 #auth required pam_homecheck.so
1670 auth required pam_env.so
1671 auth required pam_mail.so
1672 account required pam_unix2.so use_ldap
1673 password required pam_pwcheck.s nullok
1674 password required pam_unix2.so nullok use_first_pass \
1675 use_authtok use_ldap
1676 session required pam_unix2.so none use_ldap # debug or trace
1677 session required pam_limits.so
1682 <indexterm><primary>pam_ldap.so</primary></indexterm>
1683 On other Linux systems that do not have an LDAP-enabled <command>pam_unix2.so</command> module,
1684 you must edit these files by adding the <command>pam_ldap.so</command> modules as shown here:
1687 auth required pam_securetty.so
1688 auth required pam_nologin.so
1689 auth sufficient pam_ldap.so
1690 auth required pam_unix2.so nullok try_first_pass #set_secrpc
1691 account sufficient pam_ldap.so
1692 account required pam_unix2.so
1693 password required pam_pwcheck.so nullok
1694 password required pam_ldap.so use_first_pass use_authtok
1695 password required pam_unix2.so nullok use_first_pass use_authtok
1696 session required pam_unix2.so none # debug or trace
1697 session required pam_limits.so
1698 session required pam_env.so
1699 session optional pam_mail.so
1701 This example does have the LDAP-enabled <command>pam_unix2.so</command>, but simply
1702 demonstrates the use of the <command>pam_ldap.so</command> module. You can use either
1703 implementation, but if the <command>pam_unix2.so</command> on your system supports
1704 LDAP, you probably want to use it rather than add an additional module.
1711 <sect2 id="sbehap-massive">
1712 <title>Samba-3 PDC Configuration</title>
1715 <indexterm><primary>Samba RPM Packages</primary></indexterm>
1716 Verify that the Samba-3.0.20 (or later) packages are installed on each SUSE Linux server
1717 before following the steps below. If Samba-3.0.20 (or later) is not installed, you have the
1718 choice to either build your own or obtain the packages from a dependable source.
1719 Packages for SUSE Linux 8.x, 9.x, and SUSE Linux Enterprise Server 9, as well as for
1720 Red Hat Fedora Core and Red Hat Enterprise Linux Server 3 and 4, are included on the CD-ROM that
1721 is included with this book.
1725 <title>Configuration of PDC Called <constant>MASSIVE</constant></title>
1728 Install the files in <link linkend="sbehap-massive-smbconfa"/>,
1729 <link linkend="sbehap-massive-smbconfb"/>, <link linkend="sbehap-shareconfa"/>,
1730 and <link linkend="sbehap-shareconfb"/> into the <filename>/etc/samba/</filename>
1731 directory. The three files should be added together to form the &smb.conf;
1732 master file. It is a good practice to call this file something like
1733 <filename>smb.conf.master</filename> and then to perform all file edits
1734 on the master file. The operational &smb.conf; is then generated as shown in
1739 <indexterm><primary>testparm</primary></indexterm>
1740 Create and verify the contents of the &smb.conf; file that is generated by:
1742 &rootprompt; testparm -s smb.conf.master > smb.conf
1744 Immediately follow this with the following:
1746 &rootprompt; testparm
1748 The output that is created should be free from errors, as shown here:
1751 Load smb config files from /etc/samba/smb.conf
1752 Processing section "[accounts]"
1753 Processing section "[service]"
1754 Processing section "[pidata]"
1755 Processing section "[homes]"
1756 Processing section "[printers]"
1757 Processing section "[apps]"
1758 Processing section "[netlogon]"
1759 Processing section "[profiles]"
1760 Processing section "[profdata]"
1761 Processing section "[print$]"
1762 Loaded services file OK.
1763 Server role: ROLE_DOMAIN_PDC
1764 Press enter to see a dump of your service definitions
1769 Delete all runtime files from prior Samba operation by executing (for SUSE
1772 &rootprompt; rm /etc/samba/*tdb
1773 &rootprompt; rm /var/lib/samba/*tdb
1774 &rootprompt; rm /var/lib/samba/*dat
1775 &rootprompt; rm /var/log/samba/*
1780 <indexterm><primary>secrets.tdb</primary></indexterm>
1781 <indexterm><primary>smbpasswd</primary></indexterm>
1782 Samba-3 communicates with the LDAP server. The password that it uses to
1783 authenticate to the LDAP server must be stored in the <filename>secrets.tdb</filename>
1784 file. Execute the following to create the new <filename>secrets.tdb</filename> files
1785 and store the password for the LDAP Manager:
1787 &rootprompt; smbpasswd -w not24get
1789 The expected output from this command is:
1791 Setting stored password for "cn=Manager,dc=abmas,dc=biz" in secrets.tdb
1796 <indexterm><primary>smbd</primary></indexterm>
1797 <indexterm><primary>net</primary><secondary>getlocalsid</secondary></indexterm>
1798 Samba-3 generates a Windows Security Identifier (SID) only when <command>smbd</command>
1799 has been started. For this reason, you start Samba. After a few seconds delay,
1802 &rootprompt; smbclient -L localhost -U%
1803 &rootprompt; net getlocalsid
1805 A report such as the following means that the domain SID has not yet
1806 been written to the <filename>secrets.tdb</filename> or to the LDAP backend:
1808 [2005/03/03 23:19:34, 0] lib/smbldap.c:smbldap_connect_system(852)
1809 failed to bind to server ldap://massive.abmas.biz
1810 with dn="cn=Manager,dc=abmas,dc=biz" Error: Can't contact LDAP server
1812 [2005/03/03 23:19:48, 0] lib/smbldap.c:smbldap_search_suffix(1169)
1813 smbldap_search_suffix: Problem during the LDAP search:
1814 (unknown) (Timed out)
1816 The attempt to read the SID will cause and attempted bind to the LDAP server. Because the LDAP server
1817 is not running, this operation will fail by way of a timeout, as shown previously. This is
1818 normal output; do not worry about this error message. When the domain has been created and
1819 written to the <filename>secrets.tdb</filename> file, the output should look like this:
1821 SID for domain MASSIVE is: S-1-5-21-3504140859-1010554828-2431957765
1823 If, after a short delay (a few seconds), the domain SID has still not been written to
1824 the <filename>secrets.tdb</filename> file, it is necessary to investigate what
1825 may be misconfigured. In this case, carefully check the &smb.conf; file for typographical
1826 errors (the most common problem). The use of the <command>testparm</command> is highly
1827 recommended to validate the contents of this file.
1831 When a positive domain SID has been reported, stop Samba.
1835 <indexterm><primary>NFS server</primary></indexterm>
1836 <indexterm><primary>/etc/exports</primary></indexterm>
1837 <indexterm><primary>BDC</primary></indexterm>
1838 <indexterm><primary>rsync</primary></indexterm>
1839 Configure the NFS server for your Linux system. So you can complete the steps that
1840 follow, enter into the <filename>/etc/exports</filename> the following entry:
1842 /home *(rw,root_squash,sync)
1844 This permits the user home directories to be used on the BDC servers for testing
1845 purposes. You, of course, decide what is the best way for your site to distribute
1846 data drives, and you create suitable backup and restore procedures for Abmas
1847 I'd strongly recommend that for normal operation the BDC is completely independent
1848 of the PDC. rsync is a useful tool here, as it resembles the NT replication service quite
1849 closely. If you do use NFS, do not forget to start the NFS server as follows:
1851 &rootprompt; rcnfsserver start
1857 Your Samba-3 PDC is now ready to communicate with the LDAP password backend. Let's get on with
1858 configuration of the LDAP server.
1861 <example id="sbehap-massive-smbconfa">
1862 <title>LDAP Based &smb.conf; File, Server: MASSIVE &smbmdash; global Section: Part A</title>
1864 <smbconfcomment>Global parameters</smbconfcomment>
1865 <smbconfsection name="[global]"/>
1866 <smbconfoption name="unix charset">LOCALE</smbconfoption>
1867 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
1868 <smbconfoption name="netbios name">MASSIVE</smbconfoption>
1869 <smbconfoption name="interfaces">eth1, lo</smbconfoption>
1870 <smbconfoption name="bind interfaces only">Yes</smbconfoption>
1871 <smbconfoption name="passdb backend">ldapsam:ldap://massive.abmas.biz</smbconfoption>
1872 <smbconfoption name="enable privileges">Yes</smbconfoption>
1873 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1874 <smbconfoption name="log level">1</smbconfoption>
1875 <smbconfoption name="syslog">0</smbconfoption>
1876 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
1877 <smbconfoption name="max log size">50</smbconfoption>
1878 <smbconfoption name="smb ports">139</smbconfoption>
1879 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
1880 <smbconfoption name="time server">Yes</smbconfoption>
1881 <smbconfoption name="printcap name">CUPS</smbconfoption>
1882 <smbconfoption name="show add printer wizard">No</smbconfoption>
1883 <smbconfoption name="add user script">/opt/IDEALX/sbin/smbldap-useradd -m "%u"</smbconfoption>
1884 <smbconfoption name="delete user script">/opt/IDEALX/sbin/smbldap-userdel "%u"</smbconfoption>
1885 <smbconfoption name="add group script">/opt/IDEALX/sbin/smbldap-groupadd -p "%g"</smbconfoption>
1886 <smbconfoption name="delete group script">/opt/IDEALX/sbin/smbldap-groupdel "%g"</smbconfoption>
1887 <smbconfoption name="add user to group script">/opt/IDEALX/sbin/smbldap-groupmod -m "%u" "%g"</smbconfoption>
1888 <smbconfoption name="delete user from group script">/opt/IDEALX/sbin/smbldap-groupmod -x "%u" "%g"</smbconfoption>
1889 <smbconfoption name="set primary group script">/opt/IDEALX/sbin/smbldap-usermod -g "%g" "%u"</smbconfoption>
1890 <smbconfoption name="add machine script">/opt/IDEALX/sbin/smbldap-useradd -w "%u"</smbconfoption>
1894 <example id="sbehap-massive-smbconfb">
1895 <title>LDAP Based &smb.conf; File, Server: MASSIVE &smbmdash; global Section: Part B</title>
1897 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
1898 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
1899 <smbconfoption name="logon drive">X:</smbconfoption>
1900 <smbconfoption name="domain logons">Yes</smbconfoption>
1901 <smbconfoption name="preferred master">Yes</smbconfoption>
1902 <smbconfoption name="wins support">Yes</smbconfoption>
1903 <smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
1904 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
1905 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
1906 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
1907 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
1908 <smbconfoption name="ldap admin dn">cn=Manager,dc=abmas,dc=biz</smbconfoption>
1909 <smbconfoption name="idmap backend">ldap:ldap://massive.abmas.biz</smbconfoption>
1910 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
1911 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
1912 <smbconfoption name="map acl inherit">Yes</smbconfoption>
1913 <smbconfoption name="printing">cups</smbconfoption>
1914 <smbconfoption name="printer admin">root, chrisr</smbconfoption>
1921 <sect2 id="sbeidealx">
1922 <title>Install and Configure Idealx smbldap-tools Scripts</title>
1925 <indexterm><primary>Idealx</primary><secondary>smbldap-tools</secondary></indexterm>
1926 The Idealx scripts, or equivalent, are necessary to permit Samba-3 to manage accounts
1927 on the LDAP server. You have chosen the Idealx scripts because they are the best-known
1928 LDAP configuration scripts. The use of these scripts will help avoid the necessity
1929 to create custom scripts. It is easy to download them from the Idealx
1930 <ulink url="http://samba.idealx.org/index.en.html">Web site</ulink>. The tarball may
1931 be directly <ulink url="http://samba.idealx.org/dist/smbldap-tools-0.9.1.tgz">downloaded</ulink>
1932 from this site also. Alternatively, you may obtain the
1933 <ulink url="http://samba.idealx.org/dist/smbldap-tools-0.9.1-1.src.rpm">smbldap-tools-0.9.1-1.src.rpm</ulink>
1934 file that may be used to build an installable RPM package for your Linux system.
1938 The smbldap-tools scripts can be installed in any convenient directory of your choice, in which case you must
1939 change the path to them in your &smb.conf; file on the PDC (<constant>MASSIVE</constant>).
1943 The smbldap-tools are located in <filename>/opt/IDEALX/sbin</filename>.
1944 The scripts are not needed on BDC machines because all LDAP updates are handled by
1949 <title>Installation of smbldap-tools from the Tarball</title>
1952 To perform a manual installation of the smbldap-tools scripts, the following procedure may be used:
1955 <procedure id="idealxscript">
1956 <title>Unpacking and Installation Steps for the <constant>smbldap-tools</constant> Tarball</title>
1959 Create the <filename>/opt/IDEALX/sbin</filename> directory, and set its permissions
1960 and ownership as shown here:
1962 &rootprompt; mkdir -p /opt/IDEALX/sbin
1963 &rootprompt; chown root:root /opt/IDEALX/sbin
1964 &rootprompt; chmod 755 /opt/IDEALX/sbin
1965 &rootprompt; mkdir -p /etc/smbldap-tools
1966 &rootprompt; chown root:root /etc/smbldap-tools
1967 &rootprompt; chmod 755 /etc/smbldap-tools
1972 If you wish to use the downloaded tarball, unpack the smbldap-tools in a suitable temporary location.
1973 Change into either the directory extracted from the tarball or the smbldap-tools
1974 directory in your <filename>/usr/share/doc/packages</filename> directory tree.
1978 Copy all the <filename>smbldap-*</filename> and the <filename>configure.pl</filename> files into the
1979 <filename>/opt/IDEALX/sbin</filename> directory, as shown here:
1981 &rootprompt; cd smbldap-tools-0.9.1/
1982 &rootprompt; cp smbldap-* configure.pl *pm /opt/IDEALX/sbin/
1983 &rootprompt; cp smbldap*conf /etc/smbldap-tools/
1984 &rootprompt; chmod 750 /opt/IDEALX/sbin/smbldap-*
1985 &rootprompt; chmod 750 /opt/IDEALX/sbin/configure.pl
1986 &rootprompt; chmod 640 /etc/smbldap-tools/smbldap.conf
1987 &rootprompt; chmod 600 /etc/smbldap-tools/smbldap_bind.conf
1992 The smbldap-tools scripts master control file must now be configured.
1993 Change to the <filename>/opt/IDEALX/sbin</filename> directory, then edit the
1994 <filename>smbldap_tools.pm</filename> to affect the changes
1998 # ugly funcs using global variables and spawning openldap clients
2000 my $smbldap_conf="/etc/smbldap-tools/smbldap.conf";
2001 my $smbldap_bind_conf="/etc/smbldap-tools/smbldap_bind.conf";
2007 To complete the configuration of the smbldap-tools, set the permissions and ownership
2008 by executing the following commands:
2010 &rootprompt; chown root:root /opt/IDEALX/sbin/*
2011 &rootprompt; chmod 755 /opt/IDEALX/sbin/smbldap-*
2012 &rootprompt; chmod 640 /opt/IDEALX/sbin/smb*pm
2014 The smbldap-tools scripts are now ready for the configuration step outlined in
2015 <link linkend="smbldap-init"/>.
2023 <title>Installing smbldap-tools from the RPM Package</title>
2026 In the event that you have elected to use the RPM package provided by Idealx, download the
2027 source RPM <filename>smbldap-tools-0.9.1-1.src.rpm</filename>, then follow this procedure:
2031 <title>Installation Steps for <constant>smbldap-tools</constant> RPM's</title>
2034 Install the source RPM that has been downloaded as follows:
2036 &rootprompt; rpm -i smbldap-tools-0.9.1-1.src.rpm
2041 Change into the directory in which the SPEC files are located. On SUSE Linux:
2043 &rootprompt; cd /usr/src/packages/SPECS
2045 On Red Hat Linux systems:
2047 &rootprompt; cd /usr/src/redhat/SPECS
2052 Edit the <filename>smbldap-tools.spec</filename> file to change the value of the
2053 <constant>_sysconfig</constant> macro as shown here:
2055 %define _prefix /opt/IDEALX
2056 %define _sysconfdir /etc
2058 Note: Any suitable directory can be specified.
2062 Build the package by executing:
2064 &rootprompt; rpmbuild -ba -v smbldap-tools.spec
2066 A build process that has completed without error will place the installable binary
2067 files in the directory <filename>../RPMS/noarch</filename>.
2071 Install the binary package by executing:
2073 &rootprompt; rpm -Uvh ../RPMS/noarch/smbldap-tools-0.9.1-1.noarch.rpm
2080 The Idealx scripts should now be ready for configuration using the steps outlined in
2081 <link linkend="smbldap-init">Configuration of smbldap-tools</link>.
2086 <sect3 id="smbldap-init">
2087 <title>Configuration of smbldap-tools</title>
2090 Prior to use, the smbldap-tools must be configured to match the settings in the &smb.conf; file
2091 and to match the settings in the <filename>/etc/openldap/slapd.conf</filename> file. The assumption
2092 is made that the &smb.conf; file has correct contents. The following procedure ensures that
2093 this is completed correctly:
2097 The smbldap-tools require that the NetBIOS name (machine name) of the Samba server be included
2098 in the &smb.conf; file.
2102 <title>Configuration Steps for <constant>smbldap-tools</constant> to Enable Use</title>
2105 Change into the directory that contains the <filename>configure.pl</filename> script.
2107 &rootprompt; cd /opt/IDEALX/sbin
2112 Execute the <filename>configure.pl</filename> script as follows:
2114 &rootprompt; ./configure.pl
2116 The interactive use of this script for the PDC is demonstrated here:
2118 &rootprompt; /opt/IDEALX/sbin/configure.pl
2119 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2120 smbldap-tools script configuration
2121 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2122 Before starting, check
2123 . if your samba controller is up and running.
2124 . if the domain SID is defined (you can get it with the
2127 . you can leave the configuration using the Crtl-c key combination
2128 . empty value can be set with the "." character
2129 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2130 Looking for configuration files...
2132 Samba Config File Location [/etc/samba/smb.conf] >
2133 smbldap-tools configuration file Location (global parameters)
2134 [/etc/opt/IDEALX/smbldap-tools/smbldap.conf] >
2135 smbldap Config file Location (bind parameters)
2136 [/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf] >
2137 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2138 Let's start configuring the smbldap-tools scripts ...
2140 . workgroup name: name of the domain Samba act as a PDC
2141 workgroup name [MEGANET2] >
2142 . netbios name: netbios name of the samba controler
2143 netbios name [MASSIVE] >
2144 . logon drive: local path to which the home directory
2145 will be connected (for NT Workstations). Ex: 'H:'
2147 . logon home: home directory location (for Win95/98 or NT Workstation)
2148 (use %U as username) Ex:'\\MASSIVE\%U'
2149 logon home (press the "." character if you don't want homeDirectory)
2151 . logon path: directory where roaming profiles are stored.
2152 Ex:'\\MASSIVE\profiles\%U'
2153 logon path (press the "." character
2154 if you don't want roaming profile) [\\%L\profiles\%U] >
2155 . home directory prefix (use %U as username)
2156 [/home/%U] > /data/users/%U
2157 . default users' homeDirectory mode [700] >
2158 . default user netlogon script (use %U as username)
2159 [scripts\logon.bat] >
2160 default password validation time (time in days) [45] > 900
2161 . ldap suffix [dc=abmas,dc=biz] >
2162 . ldap group suffix [ou=Groups] >
2163 . ldap user suffix [ou=People,ou=Users] >
2164 . ldap machine suffix [ou=Computers,ou=Users] >
2165 . Idmap suffix [ou=Idmap] >
2166 . sambaUnixIdPooldn: object where you want to store the next uidNumber
2167 and gidNumber available for new users and groups
2168 sambaUnixIdPooldn object (relative to ${suffix})
2169 [sambaDomainName=MEGANET2] >
2170 . ldap master server: IP adress or DNS name of the master
2171 (writable) ldap server
2172 ldap master server [massive.abmas.biz] >
2173 . ldap master port [389] >
2174 . ldap master bind dn [cn=Manager,dc=abmas,dc=biz] >
2175 . ldap master bind password [] >
2176 . ldap slave server: IP adress or DNS name of the slave ldap server:
2177 can also be the master one
2178 ldap slave server [massive.abmas.biz] >
2179 . ldap slave port [389] >
2180 . ldap slave bind dn [cn=Manager,dc=abmas,dc=biz] >
2181 . ldap slave bind password [] >
2182 . ldap tls support (1/0) [0] >
2183 . SID for domain MEGANET2: SID of the domain
2184 (can be obtained with 'net getlocalsid MASSIVE')
2185 SID for domain MEGANET2
2186 [S-1-5-21-3504140859-1010554828-2431957765]] >
2187 . unix password encryption: encryption used for unix passwords
2188 unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA) [SSHA] > MD5
2189 . default user gidNumber [513] >
2190 . default computer gidNumber [515] >
2191 . default login shell [/bin/bash] >
2192 . default skeleton directory [/etc/skel] >
2193 . default domain name to append to mail adress [] > abmas.biz
2194 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2195 backup old configuration files:
2196 /etc/opt/IDEALX/smbldap-tools/smbldap.conf->
2197 /etc/opt/IDEALX/smbldap-tools/smbldap.conf.old
2198 /etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf->
2199 /etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf.old
2200 writing new configuration file:
2201 /etc/opt/IDEALX/smbldap-tools/smbldap.conf done.
2202 /etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf done.
2204 Since a slave LDAP server has not been configured, it is necessary to specify the IP
2205 address of the master LDAP server for both the master and the slave configuration
2210 Change to the directory that contains the <filename>smbldap.conf</filename> file,
2211 then verify its contents.
2217 The smbldap-tools are now ready for use.
2225 <title>LDAP Initialization and Creation of User and Group Accounts</title>
2228 The LDAP database must be populated with well-known Windows domain user accounts and domain group
2229 accounts before Samba can be used. The following procedures step you through the process.
2233 At this time, Samba-3 requires that on a PDC all UNIX (POSIX) group accounts that are
2234 mapped (linked) to Windows domain group accounts must be in the LDAP database. It does not
2235 hurt to have UNIX user and group accounts in both the system files as well as in the LDAP
2236 database. From a UNIX system perspective, the NSS resolver checks system files before
2237 referring to LDAP. If the UNIX system can resolve (find) an account in the system file, it
2238 does not need to ask LDAP.
2242 Addition of an account to the LDAP backend can be done in two ways:
2247 <indexterm><primary>NIS</primary></indexterm>
2248 <indexterm><primary>/etc/passwd</primary></indexterm>
2249 <indexterm><primary>Posix accounts</primary></indexterm>
2250 <indexterm><primary>pdbedit</primary></indexterm>
2251 <indexterm><primary>SambaSamAccount</primary></indexterm>
2252 <indexterm><primary>PosixAccount</primary></indexterm>
2253 If you always have a user account in the <filename>/etc/passwd</filename> on every
2254 server or in a NIS(+) backend, it is not necessary to add POSIX accounts for them in
2255 LDAP. In this case, you can add Windows domain user accounts using the
2256 <command>pdbedit</command> utility. Use of this tool from the command line adds the
2257 SambaSamAccount entry for the user, but does not add the PosixAccount entry for the user.
2261 This is the least desirable method because when LDAP is used as the passwd backend Samba
2262 expects the POSIX account to be in LDAP also. It is possible to use the PADL account
2263 migration tool to migrate all system accounts from either the <filename>/etc/passwd</filename>
2264 files, or from NIS, to LDAP.
2268 If you decide that it is probably a good idea to add both the PosixAccount attributes
2269 as well as the SambaSamAccount attributes for each user, then a suitable script is needed.
2270 In the example system you are installing in this exercise, you are making use of the
2271 Idealx smbldap-tools scripts. A copy of these tools, preconfigured for this system,
2272 is included on the enclosed CD-ROM under <filename>Chap06/Tools.</filename>
2277 <indexterm><primary>Idealx</primary><secondary>smbldap-tools</secondary></indexterm>
2278 If you wish to have more control over how the LDAP database is initialized or
2279 if you don't want to use the Idealx smbldap-tools, you should refer to
2280 <link linkend="appendix"/>, <link linkend="altldapcfg"/>.
2284 <indexterm><primary>smbldap-populate</primary></indexterm>
2285 The following steps initialize the LDAP database, and then you can add user and group
2286 accounts that Samba can use. You use the <command>smbldap-populate</command> to
2287 seed the LDAP database. You then manually add the accounts shown in <link linkend="sbehap-bigacct"/>.
2288 The list of users does not cover all 500 network users; it provides examples only.
2292 <indexterm><primary>LDAP</primary><secondary>database</secondary></indexterm>
2293 <indexterm><primary>directory</primary><secondary>People container</secondary></indexterm>
2294 <indexterm><primary>directory</primary><secondary>Computers container</secondary></indexterm>
2295 In the following examples, as the LDAP database is initialized, we do create a container
2296 for Computer (machine) accounts. In the Samba-3 &smb.conf; files, specific use is made
2297 of the People container, not the Computers container, for domain member accounts. This is not a
2298 mistake; it is a deliberate action that is necessitated by the fact that the resolution of
2299 a machine (computer) account to a UID is done via NSS. The only way this can be handled is
2300 using the NSS (<filename>/etc/nsswitch.conf</filename>) entry for <constant>passwd</constant>,
2301 which is resolved using the <filename>nss_ldap</filename> library. The configuration file for
2302 the <filename>nss_ldap</filename> library is the file <filename>/etc/ldap.conf</filename> that
2303 provides only one possible LDAP search command that is specified by the entry called
2304 <constant>nss_base_passwd</constant>. This means that the search path must take into account
2305 the directory structure so that the LDAP search will commence at a level that is above
2306 both the Computers container and the Users (or People) container. If this is done, it is
2307 necessary to use a search that will descend the directory tree so that the machine account
2308 can be found. Alternatively, by placing all machine accounts in the People container, we
2309 are able to sidestep this limitation. This is the simpler solution that has been adopted
2314 <table id="sbehap-bigacct">
2315 <title>Abmas Network Users and Groups</title>
2317 <colspec align="left"/>
2318 <colspec align="left"/>
2319 <colspec align="left"/>
2320 <colspec align="left"/>
2323 <entry align="center">Account Name</entry>
2324 <entry align="center">Type</entry>
2325 <entry align="center">ID</entry>
2326 <entry align="center">Password</entry>
2331 <entry>Robert Jordan</entry>
2334 <entry>n3v3r2l8</entry>
2337 <entry>Stanley Soroka</entry>
2339 <entry>stans</entry>
2340 <entry>impl13dst4r</entry>
2343 <entry>Christine Roberson</entry>
2345 <entry>chrisr</entry>
2346 <entry>S9n0nw4ll</entry>
2349 <entry>Mary Vortexis</entry>
2351 <entry>maryv</entry>
2352 <entry>kw13t0n3</entry>
2355 <entry>Accounts</entry>
2356 <entry>Group</entry>
2357 <entry>Accounts</entry>
2361 <entry>Finances</entry>
2362 <entry>Group</entry>
2363 <entry>Finances</entry>
2367 <entry>Insurance</entry>
2368 <entry>Group</entry>
2369 <entry>PIOps</entry>
2376 <procedure id="creatacc">
2377 <title>LDAP Directory Initialization Steps</title>
2380 Start the LDAP server by executing:
2382 &rootprompt; rcldap start
2383 Starting ldap-server done
2388 Change to the <filename>/opt/IDEALX/sbin</filename> directory.
2392 Execute the script that will populate the LDAP database as shown here:
2394 &rootprompt; ./smbldap-populate -a root -k 0 -m 0
2396 The expected output from this is:
2398 Using workgroup name from smb.conf: sambaDomainName=MEGANET2
2399 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2400 => Warning: you must update smbldap.conf configuration file to :
2401 => sambaUnixIdPooldn parameter must be set
2402 to "sambaDomainName=MEGANET2,dc=abmas,dc=biz"
2403 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2404 Using builtin directory structure
2405 adding new entry: dc=abmas,dc=biz
2406 adding new entry: ou=People,dc=abmas,dc=biz
2407 adding new entry: ou=Groups,dc=abmas,dc=biz
2408 entry ou=People,dc=abmas,dc=biz already exist.
2409 adding new entry: ou=Idmap,dc=abmas,dc=biz
2410 adding new entry: sambaDomainName=MEGANET2,dc=abmas,dc=biz
2411 adding new entry: uid=root,ou=People,dc=abmas,dc=biz
2412 adding new entry: uid=nobody,ou=People,dc=abmas,dc=biz
2413 adding new entry: cn=Domain Admins,ou=Groups,dc=abmas,dc=biz
2414 adding new entry: cn=Domain Users,ou=Groups,dc=abmas,dc=biz
2415 adding new entry: cn=Domain Guests,ou=Groups,dc=abmas,dc=biz
2416 adding new entry: cn=Domain Computers,ou=Groups,dc=abmas,dc=biz
2417 adding new entry: cn=Administrators,ou=Groups,dc=abmas,dc=biz
2418 adding new entry: cn=Print Operators,ou=Groups,dc=abmas,dc=biz
2419 adding new entry: cn=Backup Operators,ou=Groups,dc=abmas,dc=biz
2420 adding new entry: cn=Replicators,ou=Groups,dc=abmas,dc=biz
2425 Edit the <filename>/etc/smbldap-tools/smbldap.conf</filename> file so that the following
2426 information is changed from:
2428 # Where to store next uidNumber and gidNumber available
2429 sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
2431 to read, after modification:
2433 # Where to store next uidNumber and gidNumber available
2434 #sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
2435 sambaUnixIdPooldn="sambaDomainName=MEGANET2,dc=abmas,dc=biz"
2440 It is necessary to restart the LDAP server as shown here:
2442 &rootprompt; rcldap restart
2443 Shutting down ldap-server done
2444 Starting ldap-server done
2449 <indexterm><primary>slapcat</primary></indexterm>
2450 So that we can use a global IDMAP repository, the LDAP directory must have a container object for IDMAP data.
2451 There are several ways you can check that your LDAP database is able to receive IDMAP information. One of
2452 the simplest is to execute:
2454 &rootprompt; slapcat | grep -i idmap
2455 dn: ou=Idmap,dc=abmas,dc=biz
2458 <indexterm> <primary>ldapadd</primary></indexterm>
2459 If the execution of this command does not return IDMAP entries, you need to create an LDIF
2460 template file (see <link linkend="sbehap-ldifadd"/>). You can add the required entries using
2461 the following command:
2463 &rootprompt; ldapadd -x -D "cn=Manager,dc=abmas,dc=biz" \
2464 -w not24get < /etc/openldap/idmap.LDIF
2466 Samba automatically populates this LDAP directory container when it needs to.
2470 <indexterm><primary>slapcat</primary></indexterm>
2471 It looks like all has gone well, as expected. Let's confirm that this is the case
2472 by running a few tests. First we check the contents of the database directly
2473 by running <command>slapcat</command> as follows (the output has been cut down):
2475 &rootprompt; slapcat
2477 objectClass: dcObject
2478 objectClass: organization
2481 structuralObjectClass: organization
2482 entryUUID: 5ab02bf6-c536-1027-9d29-b1f32350fb43
2483 creatorsName: cn=Manager,dc=abmas,dc=biz
2484 createTimestamp: 20031217234200Z
2485 entryCSN: 2003121723:42:00Z#0x0001#0#0000
2486 modifiersName: cn=Manager,dc=abmas,dc=biz
2487 modifyTimestamp: 20031217234200Z
2489 dn: cn=Domain Computers,ou=Groups,dc=abmas,dc=biz
2490 objectClass: posixGroup
2491 objectClass: sambaGroupMapping
2493 cn: Domain Computers
2494 description: Netbios Domain Computers accounts
2495 sambaSID: S-1-5-21-3504140859-1010554828-2431957765-553
2497 displayName: Domain Computers
2498 structuralObjectClass: posixGroup
2499 entryUUID: 5e0a41d8-c536-1027-9d3b-b1f32350fb43
2500 creatorsName: cn=Manager,dc=abmas,dc=biz
2501 createTimestamp: 20031217234206Z
2502 entryCSN: 2003121723:42:06Z#0x0002#0#0000
2503 modifiersName: cn=Manager,dc=abmas,dc=biz
2504 modifyTimestamp: 20031217234206Z
2506 This looks good so far.
2510 <indexterm><primary>ldapsearch</primary></indexterm>
2511 The next step is to prove that the LDAP server is running and responds to a
2512 search request. Execute the following as shown (output has been cut to save space):
2514 &rootprompt; ldapsearch -x -b "dc=abmas,dc=biz" "(ObjectClass=*)"
2518 # base <dc=abmas,dc=biz> with scope sub
2519 # filter: (ObjectClass=*)
2525 objectClass: dcObject
2526 objectClass: organization
2531 dn: ou=People,dc=abmas,dc=biz
2532 objectClass: organizationalUnit
2535 # Domain Computers, Groups, abmas.biz
2536 dn: cn=Domain Computers,ou=Groups,dc=abmas,dc=biz
2537 objectClass: posixGroup
2538 objectClass: sambaGroupMapping
2540 cn: Domain Computers
2541 description: Netbios Domain Computers accounts
2542 sambaSID: S-1-5-21-3504140859-1010554828-2431957765-553
2544 displayName: Domain Computers
2553 Good. It is all working just fine.
2557 <indexterm><primary>getent</primary></indexterm>
2558 You must now make certain that the NSS resolver can interrogate LDAP also.
2559 Execute the following commands:
2561 &rootprompt; getent passwd | grep root
2562 root:x:998:512:Netbios Domain Administrator:/home:/bin/false
2564 &rootprompt; getent group | grep Domain
2565 Domain Admins:x:512:root
2567 Domain Guests:x:514:
2568 Domain Computers:x:553:
2570 <indexterm><primary>nss_ldap</primary></indexterm>
2571 This demonstrates that the <command>nss_ldap</command> library is functioning
2572 as it should. If these two steps fail to produce this information, refer to
2573 <link linkend="sbeavoid"/> for diagnostic procedures that can be followed to
2574 isolate the cause of the problem. Proceed to the next step only when the previous steps
2575 have been successfully completed.
2579 <indexterm><primary>smbldap-useradd</primary></indexterm>
2580 <indexterm><primary>smbldap-passwd</primary></indexterm>
2581 <indexterm><primary>smbpasswd</primary></indexterm>
2582 Our database is now ready for the addition of network users. For each user for
2583 whom an account must be created, execute the following:
2585 &rootprompt; ./smbldap-useradd -m -a <constant>username</constant>
2586 &rootprompt; ./smbldap-passwd <constant>username</constant>
2587 Changing password for <constant>username</constant>
2588 New password : XXXXXXXX
2589 Retype new password : XXXXXXXX
2591 &rootprompt; smbpasswd <constant>username</constant>
2592 New SMB password: XXXXXXXX
2593 Retype new SMB password: XXXXXXXX
2595 where <constant>username</constant> is the login ID for each user.
2599 <indexterm><primary>getent</primary></indexterm>
2600 Now verify that the UNIX (POSIX) accounts can be resolved via NSS by executing the
2603 &rootprompt; getent passwd
2604 root:x:0:0:root:/root:/bin/bash
2605 bin:x:1:1:bin:/bin:/bin/bash
2607 root:x:0:512:Netbios Domain Administrator:/home:/bin/false
2608 nobody:x:999:514:nobody:/dev/null:/bin/false
2609 bobj:x:1000:513:System User:/home/bobj:/bin/bash
2610 stans:x:1001:513:System User:/home/stans:/bin/bash
2611 chrisr:x:1002:513:System User:/home/chrisr:/bin/bash
2612 maryv:x:1003:513:System User:/home/maryv:/bin/bash
2614 This demonstrates that user account resolution via LDAP is working.
2618 This step will determine whether or not identity resolution is working correctly.
2619 Do not procede is this step fails, rather find the cause of the failure. The
2620 <command>id</command> command may be used to validate your configuration so far,
2623 &rootprompt; id chrisr
2624 uid=1002(chrisr) gid=513(Domain Users) groups=513(Domain Users)
2626 This confirms that the UNIX (POSIX) user account information can be resolved from LDAP
2627 by system tools that make a getentpw() system call.
2631 <indexterm><primary>smbldap-usermod</primary></indexterm>
2632 The root account must have UID=0; if not, this means that operations conducted from
2633 a Windows client using tools such as the Domain User Manager fails under UNIX because
2634 the management of user and group accounts requires that the UID=0. Additionally, it is
2635 a good idea to make certain that no matter how root account credentials are resolved,
2636 the home directory and shell are valid. You decide to effect this immediately
2637 as demonstrated here:
2639 &rootprompt; cd /opt/IDEALX/sbin
2640 &rootprompt; ./smbldap-usermod -u 0 -d /root -s /bin/bash root
2645 Verify that the changes just made to the <constant>root</constant> account were
2646 accepted by executing:
2648 &rootprompt; getent passwd | grep root
2649 root:x:0:0:root:/root:/bin/bash
2650 root:x:0:512:Netbios Domain Administrator:/root:/bin/bash
2652 This demonstrates that the changes were accepted.
2656 Make certain that a home directory has been created for every user by listing the
2657 directories in <filename>/home</filename> as follows:
2659 &rootprompt; ls -al /home
2660 drwxr-xr-x 8 root root 176 Dec 17 18:50 ./
2661 drwxr-xr-x 21 root root 560 Dec 15 22:19 ../
2662 drwx------ 7 bobj Domain Users 568 Dec 17 01:16 bobj/
2663 drwx------ 7 chrisr Domain Users 568 Dec 17 01:19 chrisr/
2664 drwx------ 7 maryv Domain Users 568 Dec 17 01:27 maryv/
2665 drwx------ 7 stans Domain Users 568 Dec 17 01:43 stans/
2667 This is precisely what we want to see.
2671 <indexterm><primary>ldapsam</primary></indexterm>
2672 <indexterm><primary>pdbedit</primary></indexterm>
2673 The final validation step involves making certain that Samba-3 can obtain the user
2674 accounts from the LDAP ldapsam passwd backend. Execute the following command as shown:
2676 &rootprompt; pdbedit -Lv chrisr
2677 Unix username: chrisr
2680 User SID: S-1-5-21-3504140859-1010554828-2431957765-3004
2681 Primary Group SID: S-1-5-21-3504140859-1010554828-2431957765-513
2682 Full Name: System User
2683 Home Directory: \\MASSIVE\homes
2685 Logon Script: scripts\login.cmd
2686 Profile Path: \\MASSIVE\profiles\chrisr
2688 Account desc: System User
2692 Logoff time: Mon, 18 Jan 2038 20:14:07 GMT
2693 Kickoff time: Mon, 18 Jan 2038 20:14:07 GMT
2694 Password last set: Wed, 17 Dec 2003 17:17:40 GMT
2695 Password can change: Wed, 17 Dec 2003 17:17:40 GMT
2696 Password must change: Mon, 18 Jan 2038 20:14:07 GMT
2697 Last bad password : 0
2698 Bad password count : 0
2699 Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
2701 This looks good. Of course, you fully expected that it would all work, didn't you?
2705 <indexterm><primary>smbldap-groupadd</primary></indexterm>
2706 Now you add the group accounts that are used on the Abmas network. Execute
2707 the following exactly as shown:
2709 &rootprompt; ./smbldap-groupadd -a Accounts
2710 &rootprompt; ./smbldap-groupadd -a Finances
2711 &rootprompt; ./smbldap-groupadd -a PIOps
2713 The addition of groups does not involve keyboard interaction, so the lack of console
2714 output is of no concern.
2718 <indexterm><primary>getent</primary></indexterm>
2719 You really do want to confirm that UNIX group resolution from LDAP is functioning
2720 as it should. Let's do this as shown here:
2722 &rootprompt; getent group
2724 Domain Admins:x:512:root
2725 Domain Users:x:513:bobj,stans,chrisr,maryv
2726 Domain Guests:x:514:
2732 The well-known special accounts (Domain Admins, Domain Users, Domain Guests), as well
2733 as our own site-specific group accounts, are correctly listed. This is looking good.
2737 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>list</tertiary></indexterm>
2738 The final step we need to validate is that Samba can see all the Windows domain groups
2739 and that they are correctly mapped to the respective UNIX group account. To do this,
2740 just execute the following command:
2742 &rootprompt; net groupmap list
2743 Domain Admins (S-1-5-21-3504140859-...-2431957765-512) -> Domain Admins
2744 Domain Users (S-1-5-21-3504140859-...-2431957765-513) -> Domain Users
2745 Domain Guests (S-1-5-21-3504140859-...-2431957765-514) -> Domain Guests
2747 Accounts (S-1-5-21-3504140859-1010554828-2431957765-3001) -> Accounts
2748 Finances (S-1-5-21-3504140859-1010554828-2431957765-3003) -> Finances
2749 PIOps (S-1-5-21-3504140859-1010554828-2431957765-3005) -> PIOps
2751 This is looking good. Congratulations &smbmdash; it works! Note that in the above output
2752 the lines were shortened by replacing the middle value (1010554828) of the SID with the
2757 The server you have so carefully built is now ready for another important step. You
2758 start the Samba-3 server and validate its operation. Execute the following to render all
2759 the processes needed fully operative so that, on system reboot, they are automatically
2762 &rootprompt; chkconfig named on
2763 &rootprompt; chkconfig dhcpd on
2764 &rootprompt; chkconfig ldap on
2765 &rootprompt; chkconfig nmb on
2766 &rootprompt; chkconfig smb on
2767 &rootprompt; chkconfig winbind on
2768 &rootprompt; rcnmb start
2769 &rootprompt; rcsmb start
2770 &rootprompt; rcwinbind start
2775 The next step might seem a little odd at this point, but take note that you are about to
2776 start <command>winbindd</command>, which must be able to authenticate to the PDC via the
2777 localhost interface with the <command>smbd</command> process. This account can be
2778 easily created by joining the PDC to the domain by executing the following command:
2780 &rootprompt; net rpc join -S MASSIVE -U root%not24get
2782 Note: Before executing this command on the PDC, both <command>nmbd</command> and
2783 <command>smbd</command> must be started so that the <command>net</command> command
2784 can communicate with <command>smbd</command>. The expected output is as follows:
2786 Joined domain MEGANET2.
2788 This indicates that the domain security account for the PDC has been correctly created.
2792 At this time it is necessary to restart <command>winbindd</command> so that it can
2793 correctly authenticate to the PDC. The following command achieves that:
2795 &rootprompt; rcwinbind restart
2800 <indexterm><primary>smbclient</primary></indexterm>
2801 You may now check Samba-3 operation as follows:
2803 &rootprompt; smbclient -L massive -U%
2805 Sharename Type Comment
2806 --------- ---- -------
2807 IPC$ IPC IPC Service (Samba 3.0.20)
2808 accounts Disk Accounting Files
2809 service Disk Financial Services Files
2810 pidata Disk Property Insurance Files
2811 apps Disk Application Files
2812 netlogon Disk Network Logon Service
2813 profiles Disk Profile Share
2814 profdata Disk Profile Data Share
2815 ADMIN$ IPC IPC Service (Samba 3.0.20)
2819 MASSIVE Samba 3.0.20
2825 This shows that an anonymous connection is working.
2829 For your finale, let's try an authenticated connection:
2831 &rootprompt; smbclient //massive/bobj -Ubobj%n3v3r2l8
2833 . D 0 Wed Dec 17 01:16:19 2003
2834 .. D 0 Wed Dec 17 19:04:42 2003
2835 bin D 0 Tue Sep 2 04:00:57 2003
2836 Documents D 0 Sun Nov 30 07:28:20 2003
2837 public_html D 0 Sun Nov 30 07:28:20 2003
2838 .urlview H 311 Fri Jul 7 06:55:35 2000
2839 .dvipsrc H 208 Fri Nov 17 11:22:02 1995
2841 57681 blocks of size 524288. 57128 blocks available
2844 Well done. All is working fine.
2849 The server <constant>MASSIVE</constant> is now configured, and it is time to move onto the next task.
2854 <sect2 id="sbehap-ptrcfg">
2855 <title>Printer Configuration</title>
2858 <indexterm><primary>CUPS</primary></indexterm>
2859 The configuration for Samba-3 to enable CUPS raw-print-through printing has already been
2860 taken care of in the &smb.conf; file. The only preparation needed for <constant>smart</constant>
2861 printing to be possible involves creation of the directories in which Samba-3 stores
2862 Windows printing driver files.
2866 <title>Printer Configuration Steps</title>
2869 Configure all network-attached printers to have a fixed IP address.
2873 Create an entry in the DNS database on the server <constant>MASSIVE</constant>
2874 in both the forward lookup database for the zone <constant>abmas.biz.hosts</constant>
2875 and in the reverse lookup database for the network segment that the printer is to
2876 be located in. Example configuration files for similar zones were presented in <link linkend="secure"/>,
2877 <link linkend="abmasbiz"/> and in <link linkend="eth2zone"/>.
2881 Follow the instructions in the printer manufacturers' manuals to permit printing
2882 to port 9100. Use any other port the manufacturer specifies for direct mode,
2883 raw printing. This allows the CUPS spooler to print using raw mode protocols.
2884 <indexterm><primary>CUPS</primary></indexterm>
2885 <indexterm><primary>raw printing</primary></indexterm>
2889 <indexterm><primary>lpadmin</primary></indexterm>
2890 <indexterm><primary>CUPS</primary><secondary>queue</secondary></indexterm>
2891 Only on the server to which the printer is attached, configure the CUPS Print
2894 &rootprompt; lpadmin -p <parameter>printque</parameter>
2895 -v socket://<parameter>printer-name</parameter>.abmas.biz:9100 -E
2897 <indexterm><primary>print filter</primary></indexterm>
2898 This step creates the necessary print queue to use no assigned print filter. This
2899 is ideal for raw printing, that is, printing without use of filters.
2900 The name <parameter>printque</parameter> is the name you have assigned for
2901 the particular printer.
2905 Print queues may not be enabled at creation. Make certain that the queues
2906 you have just created are enabled by executing the following:
2908 &rootprompt; /usr/bin/enable <parameter>printque</parameter>
2913 Even though your print queue may be enabled, it is still possible that it
2914 may not accept print jobs. A print queue will service incoming printing
2915 requests only when configured to do so. Ensure that your print queue is
2916 set to accept incoming jobs by executing the following commands:
2918 &rootprompt; /usr/bin/accept <parameter>printque</parameter>
2923 <indexterm><primary>mime type</primary></indexterm>
2924 <indexterm><primary>/etc/mime.convs</primary></indexterm>
2925 <indexterm><primary>application/octet-stream</primary></indexterm>
2926 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
2928 application/octet-stream application/vnd.cups-raw 0 -
2933 <indexterm><primary>/etc/mime.types</primary></indexterm>
2934 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
2936 application/octet-stream
2941 Refer to the CUPS printing manual for instructions regarding how to configure
2942 CUPS so that print queues that reside on CUPS servers on remote networks
2943 route print jobs to the print server that owns that queue. The default setting
2944 on your CUPS server may automatically discover remotely installed printers and
2945 may permit this functionality without requiring specific configuration.
2949 The following action creates the necessary directory subsystem. Follow these
2950 steps to printing heaven:
2952 &rootprompt; mkdir -p /var/lib/samba/drivers/{W32ALPHA,W32MIPS,W32X86,WIN40}
2953 &rootprompt; chown -R root:root /var/lib/samba/drivers
2954 &rootprompt; chmod -R ug=rwx,o=rx /var/lib/samba/drivers
2964 <sect1 id="sbehap-bldg1">
2965 <title>Samba-3 BDC Configuration</title>
2968 <title>Configuration of BDC Called: <constant>BLDG1</constant></title>
2971 Install the files in <link linkend="sbehap-bldg1-smbconf"/>,
2972 <link linkend="sbehap-shareconfa"/>, and <link linkend="sbehap-shareconfb"/>
2973 into the <filename>/etc/samba/</filename> directory. The three files
2974 should be added together to form the &smb.conf; file.
2978 Verify the &smb.conf; file as in step 2 of <link
2979 linkend="sbehap-massive"/>.
2983 Carefully follow the steps outlined in <link linkend="sbehap-PAM-NSS"/>, taking
2984 particular note to install the correct <filename>ldap.conf</filename>.
2988 Verify that the NSS resolver is working. You may need to cycle the run level
2989 to 1 and back to 5 before the NSS LDAP resolver functions. Follow these
2994 After the run level has been achieved, you are prompted to provide the
2995 <constant>root</constant> password. Log on, and then execute:
2999 When the normal logon prompt appears, log into the system as <constant>root</constant>
3000 and then execute these commands:
3002 &rootprompt; getent passwd
3003 root:x:0:0:root:/root:/bin/bash
3004 bin:x:1:1:bin:/bin:/bin/bash
3005 daemon:x:2:2:Daemon:/sbin:/bin/bash
3006 lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
3007 mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false
3009 root:x:0:512:Netbios Domain Administrator:/root:/bin/bash
3010 nobody:x:999:514:nobody:/dev/null:/bin/false
3011 bobj:x:1000:513:System User:/home/bobj:/bin/bash
3012 stans:x:1001:513:System User:/home/stans:/bin/bash
3013 chrisr:x:1002:513:System User:/home/chrisr:/bin/bash
3014 maryv:x:1003:513:System User:/home/maryv:/bin/bash
3015 vaioboss$:x:1005:553:vaioboss$:/dev/null:/bin/false
3016 bldg1$:x:1006:553:bldg1$:/dev/null:/bin/false
3018 This is the correct output. If the accounts that have UIDs above 512 are not shown, there is a problem.
3022 <indexterm><primary>getent</primary></indexterm>
3023 The next step in the verification process involves testing the operation of UNIX group
3024 resolution via the NSS LDAP resolver. Execute these commands:
3026 &rootprompt; getent group
3032 Domain Admins:x:512:root
3033 Domain Users:x:513:bobj,stans,chrisr,maryv,jht
3034 Domain Guests:x:514:
3035 Administrators:x:544:
3039 Account Operators:x:548:
3040 Server Operators:x:549:
3041 Print Operators:x:550:
3042 Backup Operators:x:551:
3044 Domain Computers:x:553:
3049 This is also the correct and desired output, because it demonstrates that the LDAP client
3050 is able to communicate correctly with the LDAP server (<constant>MASSIVE</constant>).
3054 <indexterm><primary>smbpasswd</primary></indexterm>
3055 You must now set the LDAP administrative password into the Samba-3 <filename>secrets.tdb</filename>
3056 file by executing this command:
3058 &rootprompt; smbpasswd -w not24get
3059 Setting stored password for "cn=Manager,dc=abmas,dc=biz" in secrets.tdb
3064 Now you must obtain the domain SID from the PDC and store it into the
3065 <filename>secrets.tdb</filename> file also. This step is not necessary with an LDAP
3066 passdb backend because Samba-3 obtains the domain SID from the
3067 sambaDomain object it automatically stores in the LDAP backend. It does not hurt to
3068 add the SID to the <filename>secrets.tdb</filename>, and if you wish to do so, this
3069 command can achieve that:
3071 &rootprompt; net rpc getsid MEGANET2
3072 Storing SID S-1-5-21-3504140859-1010554828-2431957765 \
3073 for Domain MEGANET2 in secrets.tdb
3075 When configuring a Samba-3 BDC that has an LDAP backend, there is no need to take
3076 any special action to join it to the domain. However, winbind communicates with the
3077 domain controller that is running on the localhost and must be able to authenticate,
3078 thus requiring that the BDC should be joined to the domain. The process of joining
3079 the domain creates the necessary authentication accounts.
3083 To join the Samba BDC to the domain, execute the following:
3085 &rootprompt; net rpc join -U root%not24get
3086 Joined domain MEGANET2.
3088 This indicates that the domain security account for the BDC has been correctly created.
3093 <primary>pdbedit</primary>
3095 Verify that user and group account resolution works via Samba-3 tools as follows:
3097 &rootprompt; pdbedit -L
3100 bobj:1000:System User
3101 stans:1001:System User
3102 chrisr:1002:System User
3103 maryv:1003:System User
3106 &rootprompt; net groupmap list
3107 Domain Admins (S-1-5-21-3504140859-...-2431957765-512) ->
3109 Domain Users (S-1-5-21-3504140859-...-2431957765-513) -> Domain Users
3110 Domain Guests (S-1-5-21-3504140859-...-2431957765-514) ->
3112 Administrators (S-1-5-21-3504140859-...-2431957765-544) ->
3115 Accounts (S-1-5-21-3504140859-1010554828-2431957765-3001) -> Accounts
3116 Finances (S-1-5-21-3504140859-1010554828-2431957765-3003) -> Finances
3117 PIOps (S-1-5-21-3504140859-1010554828-2431957765-3005) -> PIOps
3119 These results show that all things are in order.
3123 The server you have so carefully built is now ready for another important step. Now
3124 start the Samba-3 server and validate its operation. Execute the following to render all
3125 the processes needed fully operative so that, upon system reboot, they are automatically
3128 &rootprompt; chkconfig named on
3129 &rootprompt; chkconfig dhcpd on
3130 &rootprompt; chkconfig nmb on
3131 &rootprompt; chkconfig smb on
3132 &rootprompt; chkconfig winbind on
3133 &rootprompt; rcnmb start
3134 &rootprompt; rcsmb start
3135 &rootprompt; rcwinbind start
3137 Samba-3 should now be running and is ready for a quick test. But not quite yet!
3141 Your new <constant>BLDG1, BLDG2</constant> servers do not have home directories for users.
3142 To rectify this using the SUSE yast2 utility or by manually editing the <filename>/etc/fstab</filename>
3143 file, add a mount entry to mount the <constant>home</constant> directory that has been exported
3144 from the <constant>MASSIVE</constant> server. Mount this resource before proceeding. An alternate
3145 approach could be to create local home directories for users who are to use these machines.
3146 This is a choice that you, as system administrator, must make. The following entry in the
3147 <filename>/etc/fstab</filename> file suffices for now:
3149 massive.abmas.biz:/home /home nfs rw 0 0
3151 To mount this resource, execute:
3153 &rootprompt; mount -a
3155 Verify that the home directory has been mounted as follows:
3157 &rootprompt; df | grep home
3158 massive:/home 29532988 283388 29249600 1% /home
3163 Implement a quick check using one of the users that is in the LDAP database. Here you go:
3165 &rootprompt; smbclient //bldg1/bobj -Ubobj%n3v3r2l8
3167 . D 0 Wed Dec 17 01:16:19 2003
3168 .. D 0 Wed Dec 17 19:04:42 2003
3169 bin D 0 Tue Sep 2 04:00:57 2003
3170 Documents D 0 Sun Nov 30 07:28:20 2003
3171 public_html D 0 Sun Nov 30 07:28:20 2003
3172 .urlview H 311 Fri Jul 7 06:55:35 2000
3173 .dvipsrc H 208 Fri Nov 17 11:22:02 1995
3175 57681 blocks of size 524288. 57128 blocks available
3183 Now that the first BDC (<constant>BDLG1</constant>) has been configured it is time to build
3184 and configure the second BDC server (<constant>BLDG2</constant>) as follows:
3187 <procedure id="sbehap-bldg2">
3188 <title>Configuration of BDC Called <constant>BLDG2</constant></title>
3191 Install the files in <link linkend="sbehap-bldg2-smbconf"/>,
3192 <link linkend="sbehap-shareconfa"/>, and <link linkend="sbehap-shareconfb"/>
3193 into the <filename>/etc/samba/</filename> directory. The three files
3194 should be added together to form the &smb.conf; file.
3198 Follow carefully the steps shown in <link linkend="sbehap-bldg1"/>, starting at step 2.
3203 <example id="sbehap-bldg1-smbconf">
3204 <title>LDAP Based &smb.conf; File, Server: BLDG1</title>
3206 <smbconfcomment>Global parameters</smbconfcomment>
3207 <smbconfsection name="[global]"/>
3208 <smbconfoption name="unix charset">LOCALE</smbconfoption>
3209 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
3210 <smbconfoption name="netbios name">BLDG1</smbconfoption>
3211 <smbconfoption name="passdb backend">ldapsam:ldap://massive.abmas.biz</smbconfoption>
3212 <smbconfoption name="enable privileges">Yes</smbconfoption>
3213 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
3214 <smbconfoption name="log level">1</smbconfoption>
3215 <smbconfoption name="syslog">0</smbconfoption>
3216 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
3217 <smbconfoption name="max log size">50</smbconfoption>
3218 <smbconfoption name="smb ports">139</smbconfoption>
3219 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
3220 <smbconfoption name="printcap name">CUPS</smbconfoption>
3221 <smbconfoption name="show add printer wizard">No</smbconfoption>
3222 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
3223 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
3224 <smbconfoption name="logon drive">X:</smbconfoption>
3225 <smbconfoption name="domain logons">Yes</smbconfoption>
3226 <smbconfoption name="domain master">No</smbconfoption>
3227 <smbconfoption name="wins server">172.16.0.1</smbconfoption>
3228 <smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
3229 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
3230 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
3231 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
3232 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
3233 <smbconfoption name="ldap admin dn">cn=Manager,dc=abmas,dc=biz</smbconfoption>
3234 <smbconfoption name="idmap backend">ldap:ldap://massive.abmas.biz</smbconfoption>
3235 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
3236 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
3237 <smbconfoption name="printing">cups</smbconfoption>
3238 <smbconfoption name="printer admin">root, chrisr</smbconfoption>
3243 <example id="sbehap-bldg2-smbconf">
3244 <title>LDAP Based &smb.conf; File, Server: BLDG2</title>
3246 <smbconfcomment>Global parameters</smbconfcomment>
3247 <smbconfsection name="[global]"/>
3248 <smbconfoption name="unix charset">LOCALE</smbconfoption>
3249 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
3250 <smbconfoption name="netbios name">BLDG2</smbconfoption>
3251 <smbconfoption name="passdb backend">ldapsam:ldap://massive.abmas.biz</smbconfoption>
3252 <smbconfoption name="enable privileges">Yes</smbconfoption>
3253 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
3254 <smbconfoption name="log level">1</smbconfoption>
3255 <smbconfoption name="syslog">0</smbconfoption>
3256 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
3257 <smbconfoption name="max log size">50</smbconfoption>
3258 <smbconfoption name="smb ports">139</smbconfoption>
3259 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
3260 <smbconfoption name="printcap name">CUPS</smbconfoption>
3261 <smbconfoption name="show add printer wizard">No</smbconfoption>
3262 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
3263 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
3264 <smbconfoption name="logon drive">X:</smbconfoption>
3265 <smbconfoption name="domain logons">Yes</smbconfoption>
3266 <smbconfoption name="domain master">No</smbconfoption>
3267 <smbconfoption name="wins server">172.16.0.1</smbconfoption>
3268 <smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
3269 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
3270 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
3271 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
3272 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
3273 <smbconfoption name="ldap admin dn">cn=Manager,dc=abmas,dc=biz</smbconfoption>
3274 <smbconfoption name="idmap backend">ldap:ldap://massive.abmas.biz</smbconfoption>
3275 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
3276 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
3277 <smbconfoption name="printing">cups</smbconfoption>
3278 <smbconfoption name="printer admin">root, chrisr</smbconfoption>
3283 <example id="sbehap-shareconfa">
3284 <title>LDAP Based &smb.conf; File, Shares Section &smbmdash; Part A</title>
3286 <smbconfsection name="[accounts]"/>
3287 <smbconfoption name="comment">Accounting Files</smbconfoption>
3288 <smbconfoption name="path">/data/accounts</smbconfoption>
3289 <smbconfoption name="read only">No</smbconfoption>
3291 <smbconfsection name="[service]"/>
3292 <smbconfoption name="comment">Financial Services Files</smbconfoption>
3293 <smbconfoption name="path">/data/service</smbconfoption>
3294 <smbconfoption name="read only">No</smbconfoption>
3296 <smbconfsection name="[pidata]"/>
3297 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
3298 <smbconfoption name="path">/data/pidata</smbconfoption>
3299 <smbconfoption name="read only">No</smbconfoption>
3301 <smbconfsection name="[homes]"/>
3302 <smbconfoption name="comment">Home Directories</smbconfoption>
3303 <smbconfoption name="valid users">%S</smbconfoption>
3304 <smbconfoption name="read only">No</smbconfoption>
3305 <smbconfoption name="browseable">No</smbconfoption>
3307 <smbconfsection name="[printers]"/>
3308 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
3309 <smbconfoption name="path">/var/spool/samba</smbconfoption>
3310 <smbconfoption name="guest ok">Yes</smbconfoption>
3311 <smbconfoption name="printable">Yes</smbconfoption>
3312 <smbconfoption name="browseable">No</smbconfoption>
3316 <example id="sbehap-shareconfb">
3317 <title>LDAP Based &smb.conf; File, Shares Section &smbmdash; Part B</title>
3319 <smbconfsection name="[apps]"/>
3320 <smbconfoption name="comment">Application Files</smbconfoption>
3321 <smbconfoption name="path">/apps</smbconfoption>
3322 <smbconfoption name="admin users">bjordan</smbconfoption>
3323 <smbconfoption name="read only">No</smbconfoption>
3325 <smbconfsection name="[netlogon]"/>
3326 <smbconfoption name="comment">Network Logon Service</smbconfoption>
3327 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
3328 <smbconfoption name="guest ok">Yes</smbconfoption>
3329 <smbconfoption name="locking">No</smbconfoption>
3331 <smbconfsection name="[profiles]"/>
3332 <smbconfoption name="comment">Profile Share</smbconfoption>
3333 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
3334 <smbconfoption name="read only">No</smbconfoption>
3335 <smbconfoption name="profile acls">Yes</smbconfoption>
3337 <smbconfsection name="[profdata]"/>
3338 <smbconfoption name="comment">Profile Data Share</smbconfoption>
3339 <smbconfoption name="path">/var/lib/samba/profdata</smbconfoption>
3340 <smbconfoption name="read only">No</smbconfoption>
3341 <smbconfoption name="profile acls">Yes</smbconfoption>
3343 <smbconfsection name="[print$]"/>
3344 <smbconfoption name="comment">Printer Drivers</smbconfoption>
3345 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
3346 <smbconfoption name="browseable">yes</smbconfoption>
3347 <smbconfoption name="guest ok">no</smbconfoption>
3348 <smbconfoption name="read only">yes</smbconfoption>
3349 <smbconfoption name="write list">root, chrisr</smbconfoption>
3353 <example id="sbehap-ldifadd">
3354 <title>LDIF IDMAP Add-On Load File &smbmdash; File: /etc/openldap/idmap.LDIF</title>
3356 dn: ou=Idmap,dc=abmas,dc=biz
3357 objectClass: organizationalUnit
3359 structuralObjectClass: organizationalUnit
3366 <title>Miscellaneous Server Preparation Tasks</title>
3369 My father would say, <quote>Dinner is not over until the dishes have been done.</quote>
3370 The makings of a great network environment take a lot of effort and attention to detail.
3371 So far, you have completed most of the complex (and to many administrators, the interesting
3372 part of server configuration) steps, but remember to tie it all together. Here are
3373 a few more steps that must be completed so that your network runs like a well-rehearsed
3378 <title>Configuring Directory Share Point Roots</title>
3381 In your &smb.conf; file, you have specified Windows shares. Each has a <parameter>path</parameter>
3382 parameter. Even though it is obvious to all, one of the common Samba networking problems is
3383 caused by forgetting to verify that every such share root directory actually exists and that it
3384 has the necessary permissions and ownership.
3388 Here is an example, but remember to create the directory needed for every share:
3390 &rootprompt; mkdir -p /data/{accounts,finsvcs,piops}
3391 &rootprompt; mkdir -p /apps
3392 &rootprompt; chown -R root:root /data
3393 &rootprompt; chown -R root:root /apps
3394 &rootprompt; chown -R bobj:Accounts /data/accounts
3395 &rootprompt; chown -R bobj:Finances /data/finsvcs
3396 &rootprompt; chown -R bobj:PIOps /data/pidata
3397 &rootprompt; chmod -R ug+rwxs,o-rwx /data
3398 &rootprompt; chmod -R ug+rwx,o+rx-w /apps
3405 <title>Configuring Profile Directories</title>
3408 You made a conscious decision to do everything it would take to improve network client
3409 performance. One of your decisions was to implement folder redirection. This means that Windows
3410 user desktop profiles are now made up of two components: a dynamically loaded part and a set of file
3415 For this arrangement to work, every user needs a directory structure for the network folder
3416 portion of his or her profile as shown here:
3418 &rootprompt; mkdir -p /var/lib/samba/profdata
3419 &rootprompt; chown root:root /var/lib/samba/profdata
3420 &rootprompt; chmod 755 /var/lib/samba/profdata
3422 # Per user structure
3423 &rootprompt; cd /var/lib/samba/profdata
3424 &rootprompt; mkdir -p <emphasis>username</emphasis>
3425 &rootprompt; for i in InternetFiles Cookies History AppData \
3426 LocalSettings MyPictures MyDocuments Recent
3428 &rootprompt; mkdir <emphasis>username</emphasis>/$i
3430 &rootprompt; chown -R <emphasis>username</emphasis>:Domain\ Users <emphasis>username</emphasis>
3431 &rootprompt; chmod -R 750 <emphasis>username</emphasis>
3436 <indexterm><primary>roaming profile</primary></indexterm>
3437 <indexterm><primary>mandatory profile</primary></indexterm>
3438 You have three options insofar as the dynamically loaded portion of the roaming profile
3443 <listitem><para>You may permit the user to obtain a default profile.</para></listitem>
3444 <listitem><para>You can create a mandatory profile.</para></listitem>
3445 <listitem><para>You can create a group profile (which is almost always a mandatory profile).</para></listitem>
3449 Mandatory profiles cannot be overwritten by a user. The change from a user profile to a mandatory
3450 profile is effected by renaming the <filename>NTUSER.DAT</filename> to <filename>NTUSER.MAN</filename>,
3451 that is, just by changing the filename extension.
3455 <indexterm><primary>SRVTOOLS.EXE</primary></indexterm>
3456 <indexterm><primary>Domain User Manager</primary></indexterm>
3457 The location of the profile that a user can obtain is set in the user's account in the LDAP passdb backend.
3458 You can manage this using the Idealx smbldap-tools or using the
3459 <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">Windows NT4 Domain User Manager</ulink>.
3463 It may not be obvious that you must ensure that the root directory for the user's profile exists
3464 and has the needed permissions. Use the following commands to create this directory:
3466 &rootprompt; mkdir -p /var/lib/samba/profiles/<emphasis>username</emphasis>
3467 &rootprompt; chown <emphasis>username</emphasis>:Domain\ Users
3468 /var/lib/samba/profiles/<emphasis>username</emphasis>
3469 &rootprompt; chmod 700 /var/lib/samba/profiles/<emphasis>username</emphasis>
3476 <title>Preparation of Logon Scripts</title>
3479 <indexterm><primary>logon script</primary></indexterm>
3480 The use of a logon script with Windows XP Professional is an option that every site should consider.
3481 Unless you have locked down the desktop so the user cannot change anything, there is risk that
3482 a vital network drive setting may be broken or that printer connections may be lost. Logon scripts
3483 can help to restore persistent network folder (drive) and printer connections in a predictable
3484 manner. One situation in which such breakage may occur in particular is when a mobile PC (notebook)
3485 user attaches to another company's network that forces environment changes that are alien to your
3490 If you decide to use network logon scripts, by reference to the &smb.conf; files for the domain
3491 controllers, you see that the path to the share point for the <constant>NETLOGON</constant>
3492 share defined is <filename>/var/lib/samba/netlogon</filename>. The path defined for the logon
3493 script inside that share is <filename>scripts\logon.bat</filename>. This means that as a Windows
3494 NT/200x/XP client logs onto the network, it tries to obtain the file <filename>logon.bat</filename>
3495 from the fully qualified path <filename>/var/lib/samba/netlogon/scripts</filename>. This fully
3496 qualified path should therefore exist whether you install the <filename>logon.bat</filename>.
3500 You can, of course, create the fully qualified path by executing:
3502 &rootprompt; mkdir -p /var/lib/samba/netlogon/scripts
3507 You should research the options for logon script implementation by referring to <emphasis>TOSHARG2</emphasis>, Chapter 24,
3508 Section 24.4. A quick Web search will bring up a host of options. One of the most popular logon
3509 facilities in use today is called <ulink url="http://www.kixtart.org">KiXtart</ulink>.
3515 <title>Assigning User Rights and Privileges</title>
3518 The ability to perform tasks such as joining Windows clients to the domain can be assigned to
3519 normal user accounts. By default, only the domain administrator account (<constant>root</constant> on UNIX
3520 systems because it has UID=0) can add accounts. New to Samba 3.0.11 is the ability to grant
3521 this privilege in a very limited fashion to particular accounts.
3525 By default, even Samba-3.0.11 does not grant any rights even to the <constant>Domain Admins</constant>
3526 group. Here we grant this group all privileges.
3530 Samba limits privileges on a per-server basis. This is a deliberate limitation so that users who
3531 are granted rights can be restricted to particular machines. It is left to the network administrator
3532 to determine which rights should be provided and to whom.
3536 <title>Steps for Assignment of User Rights and Privileges</title>
3539 Log onto the PDC as the <constant>root</constant> account.
3543 Execute the following command to grant the <constant>Domain Admins</constant> group all
3544 rights and privileges:
3546 &rootprompt; net -S MASSIVE -U root%not24get rpc rights grant \
3547 "MEGANET2\Domain Admins" SeMachineAccountPrivilege \
3548 SePrintOperatorPrivilege SeAddUsersPrivilege \
3549 SeDiskOperatorPrivilege SeRemoteShutdownPrivilege
3550 Successfully granted rights.
3552 Repeat this step on each domain controller, in each case substituting the name of the server
3553 (e.g., BLDG1, BLDG2) in place of the PDC called MASSIVE.
3557 In this step the privilege will be granted to Bob Jordan (bobj) to add Windows workstations
3558 to the domain. Execute the following only on the PDC. It is not necessary to do this on
3559 BDCs or on DMS machines because machine accounts are only ever added by the PDC:
3561 &rootprompt; net -S MASSIVE -U root%not24get rpc rights grant \
3562 "MEGANET2\bobj" SeMachineAccountPrivilege
3563 Successfully granted rights.
3568 Verify that privilege assignments have been correctly applied by executing:
3570 net rpc rights list accounts -Uroot%not24get
3572 SeMachineAccountPrivilege
3575 No privileges assigned
3577 BUILTIN\Print Operators
3578 No privileges assigned
3580 BUILTIN\Account Operators
3581 No privileges assigned
3583 BUILTIN\Backup Operators
3584 No privileges assigned
3586 BUILTIN\Server Operators
3587 No privileges assigned
3589 BUILTIN\Administrators
3590 No privileges assigned
3593 No privileges assigned
3595 MEGANET2\Domain Admins
3596 SeMachineAccountPrivilege
3597 SePrintOperatorPrivilege
3599 SeRemoteShutdownPrivilege
3600 SeDiskOperatorPrivilege
3611 <title>Windows Client Configuration</title>
3614 <indexterm><primary>NETLOGON</primary></indexterm>
3615 In the next few sections, you can configure a new Windows XP Professional disk image on a staging
3616 machine. You will configure all software, printer settings, profile and policy handling, and desktop
3617 default profile settings on this system. When it is complete, you copy the contents of the
3618 <filename>C:\Documents and Settings\Default User</filename> directory to a directory with the same
3619 name in the <constant>NETLOGON</constant> share on the domain controllers.
3623 Much can be learned from the Microsoft Support site regarding how best to set up shared profiles.
3624 One knowledge-base article in particular stands out:
3625 "<ulink url="http://support.microsoft.com/default.aspx?scid=kb;EN-US;168475">How to Create a
3626 Base Profile for All Users."</ulink>
3630 <sect2 id="redirfold">
3631 <title>Configuration of Default Profile with Folder Redirection</title>
3634 <indexterm><primary>folder redirection</primary></indexterm>
3635 Log onto the Windows XP Professional workstation as the local <constant>Administrator</constant>.
3636 It is necessary to expose folders that are generally hidden to provide access to the
3637 <constant>Default User</constant> folder.
3641 <title>Expose Hidden Folders</title>
3644 Launch the Windows Explorer by clicking
3646 <guimenu>Start</guimenu>
3647 <guimenuitem>My Computer</guimenuitem>
3648 <guimenuitem>Tools</guimenuitem>
3649 <guimenuitem>Folder Options</guimenuitem>
3650 <guimenuitem>View Tab</guimenuitem>
3652 Select <guilabel>Show hidden files and folders</guilabel>,
3653 and click <guibutton>OK</guibutton>. Exit Windows Explorer.
3657 <indexterm><primary>regedt32</primary></indexterm>
3658 Launch the Registry Editor. Click
3660 <guimenu>Start</guimenu>
3661 <guimenuitem>Run</guimenuitem>
3662 </menuchoice>. Key in <command>regedt32</command>, and click
3663 <guibutton>OK</guibutton>.
3671 <procedure id="sbehap-rdrfldr">
3672 <title>Redirect Folders in Default System User Profile</title>
3675 <indexterm><primary>HKEY_LOCAL_MACHINE</primary></indexterm>
3676 <indexterm><primary>Default User</primary></indexterm>
3677 Give focus to <constant>HKEY_LOCAL_MACHINE</constant> hive entry in the left panel.
3679 <guimenu>File</guimenu>
3680 <guimenuitem>Load Hive...</guimenuitem>
3681 <guimenuitem>Documents and Settings</guimenuitem>
3682 <guimenuitem>Default User</guimenuitem>
3683 <guimenuitem>NTUSER</guimenuitem>
3684 <guimenuitem>Open</guimenuitem>
3685 </menuchoice>. In the dialog box that opens, enter the key name
3686 <constant>Default</constant> and click <guibutton>OK</guibutton>.
3690 Browse inside the newly loaded Default folder to:
3692 HKEY_LOCAL_MACHINE\Default\Software\Microsoft\Windows\
3693 CurrentVersion\Explorer\User Shell Folders\
3695 The right panel reveals the contents as shown in <link linkend="XP-screen001"/>.
3699 <indexterm><primary>%USERPROFILE%</primary></indexterm>
3700 <indexterm><primary>%LOGONSERVER%</primary></indexterm>
3701 You edit hive keys. Acceptable values to replace the
3702 <constant>%USERPROFILE%</constant> variable includes:
3705 <listitem><para>A drive letter such as <constant>U:</constant></para></listitem>
3706 <listitem><para>A direct network path such as
3707 <constant>\\MASSIVE\profdata</constant></para></listitem>
3708 <listitem><para>A network redirection (UNC name) that contains a macro such as </para>
3709 <para><constant>%LOGONSERVER%\profdata\</constant></para></listitem>
3714 <indexterm><primary>registry keys</primary></indexterm>
3715 Set the registry keys as shown in <link linkend="proffold"/>. Your implementation makes the assumption
3716 that users have statically located machines. Notebook computers (mobile users) need to be
3717 accommodated using local profiles. This is not an uncommon assumption.
3721 Click back to the root of the loaded hive <constant>Default</constant>.
3722 Click <menuchoice><guimenu>File</guimenu><guimenuitem>Unload Hive...</guimenuitem>
3723 <guimenuitem>Yes</guimenuitem></menuchoice>.
3727 <indexterm><primary>Registry Editor</primary></indexterm>
3728 Click <menuchoice><guimenu>File</guimenu><guimenuitem>Exit</guimenuitem></menuchoice>. This exits the
3733 Now follow the procedure given in <link linkend="sbehap-locgrppol"/>. Make sure that each folder you
3734 have redirected is in the exclusion list.
3738 You are now ready to copy<footnote><para>
3739 There is an alternate method by which a default user profile can be added to the
3740 <constant>NETLOGON</constant> share. This facility in the Windows System tool
3741 permits profiles to be exported. The export target may be a particular user or
3742 group profile share point or else the <constant>NETLOGON</constant> share.
3743 In this case, the profile directory must be named <constant>Default User</constant>.
3745 the Default User profile to the Samba domain controllers. Launch Microsoft Windows Explorer,
3746 and use it to copy the full contents of the directory <filename>Default User</filename> that
3747 is in the <filename>C:\Documents and Settings</filename> to the root directory of the
3748 <constant>NETLOGON</constant> share. If the <constant>NETLOGON</constant> share has the defined
3749 UNIX path of <filename>/var/lib/samba/netlogon</filename>, when the copy is complete there must
3750 be a directory in there called <filename>Default User</filename>.
3756 Before punching out new desktop images for the client workstations, it is perhaps a good idea that
3757 desktop behavior should be returned to the original Microsoft settings. The following steps achieve
3762 <title>Reset Folder Display to Original Behavior</title>
3765 To launch the Windows Explorer, click
3767 <guimenu>Start</guimenu>
3768 <guimenuitem>My Computer</guimenuitem>
3769 <guimenuitem>Tools</guimenuitem>
3770 <guimenuitem>Folder Options</guimenuitem>
3771 <guimenuitem>View Tab</guimenuitem>
3773 Deselect <guilabel>Show hidden files and folders</guilabel>, and click <guibutton>OK</guibutton>.
3774 Exit Windows Explorer.
3779 <figure id="XP-screen001">
3780 <title>Windows XP Professional &smbmdash; User Shared Folders</title>
3781 <imagefile scale="65">XP-screen001</imagefile>
3784 <table id="proffold">
3785 <title>Default Profile Redirections</title>
3787 <colspec align="left"/>
3788 <colspec align="left"/>
3791 <entry>Registry Key</entry>
3792 <entry>Redirected Value</entry>
3797 <entry>Cache</entry>
3798 <entry>%LOGONSERVER%\profdata\%USERNAME%\InternetFiles</entry>
3801 <entry>Cookies</entry>
3802 <entry>%LOGONSERVER%\profdata\%USERNAME%\Cookies</entry>
3805 <entry>History</entry>
3806 <entry>%LOGONSERVER%\profdata\%USERNAME%\History</entry>
3809 <entry>Local AppData</entry>
3810 <entry>%LOGONSERVER%\profdata\%USERNAME%\AppData</entry>
3813 <entry>Local Settings</entry>
3814 <entry>%LOGONSERVER%\profdata\%USERNAME%\LocalSettings</entry>
3817 <entry>My Pictures</entry>
3818 <entry>%LOGONSERVER%\profdata\%USERNAME%\MyPictures</entry>
3821 <entry>Personal</entry>
3822 <entry>%LOGONSERVER%\profdata\%USERNAME%\MyDocuments</entry>
3825 <entry>Recent</entry>
3826 <entry>%LOGONSERVER%\profdata\%USERNAME%\Recent</entry>
3835 <title>Configuration of MS Outlook to Relocate PST File</title>
3838 <indexterm><primary>Outlook</primary><secondary>PST</secondary></indexterm>
3839 Microsoft Outlook can store a Personal Storage file, generally known as a PST file.
3840 It is the nature of email storage that this file grows, at times quite rapidly.
3841 So that users' email is available to them at every workstation they may log onto,
3842 it is common practice in well-controlled sites to redirect the PST folder to the
3843 users' home directory. Follow these steps for each user who wishes to do this.
3847 It is presumed that Outlook Express has been configured for use.
3851 Launch Outlook Express 6. Click
3853 <guimenu>Tools</guimenu>
3854 <guimenuitem>Options</guimenuitem>
3855 <guimenuitem>Maintenance</guimenuitem>
3856 <guimenuitem>Store Folder</guimenuitem>
3857 <guimenuitem>Change</guimenuitem>
3862 Follow the on-screen prompts to relocate the PST file to the desired location.
3868 <title>Configure Delete Cached Profiles on Logout</title>
3871 Configure the Windows XP Professional client to auto-delete roaming profiles on logout:
3875 <indexterm><primary>MMC</primary></indexterm>
3878 <guimenu>Start</guimenu>
3879 <guimenuitem>Run</guimenuitem>
3880 </menuchoice>. In the dialog box, enter <command>MMC</command> and click <guibutton>OK</guibutton>.
3884 Follow these steps to set the default behavior of the staging machine so that all roaming
3885 profiles are deleted as network users log out of the system. Click
3887 <guimenu>File</guimenu>
3888 <guimenuitem>Add/Remove Snap-in</guimenuitem>
3889 <guimenuitem>Add</guimenuitem>
3890 <guimenuitem>Group Policy</guimenuitem>
3891 <guimenuitem>Add</guimenuitem>
3892 <guimenuitem>Finish</guimenuitem>
3893 <guimenuitem>Close</guimenuitem>
3894 <guimenuitem>OK</guimenuitem>
3899 <indexterm><primary>Microsoft Management Console</primary><see>MMC</see></indexterm>
3900 The Microsoft Management Console now shows the <guimenu>Group Policy</guimenu>
3901 utility that enables you to set the policies needed. In the left panel, click
3903 <guimenuitem>Local Computer Policy</guimenuitem>
3904 <guimenuitem>Administrative Templates</guimenuitem>
3905 <guimenuitem>System</guimenuitem>
3906 <guimenuitem>User Profiles</guimenuitem>
3907 </menuchoice>. In the right panel, set the properties shown here by double-clicking on each
3912 <listitem><para>Do not check for user ownership of Roaming Profile Folders = Enabled</para></listitem>
3913 <listitem><para>Delete cached copies of roaming profiles = Enabled</para></listitem>
3917 Close the Microsoft Management Console. The settings take immediate effect and persist onto all image copies
3918 made of this system to deploy the new standard desktop system.
3924 <title>Uploading Printer Drivers to Samba Servers</title>
3927 <indexterm><primary>printing</primary><secondary>drag-and-drop</secondary></indexterm>
3928 Users want to be able to use network printers. You have a vested interest in making
3929 it easy for them to print. You have chosen to install the printer drivers onto the Samba
3930 servers and to enable point-and-click (drag-and-drop) printing. This process results in
3931 Samba being able to automatically provide the Windows client with the driver necessary to
3932 print to the printer chosen. The following procedure must be followed for every network
3937 <title>Steps to Install Printer Drivers on the Samba Servers</title>
3940 Join your Windows XP Professional workstation (the staging machine) to the
3941 <constant>MEGANET2</constant> domain. If you are not sure of the procedure,
3942 follow the guidance given in <link linkend="appendix"/>, <link linkend="domjoin"/>.
3946 After the machine has rebooted, log onto the workstation as the domain
3947 <constant>root</constant> (this is the Administrator account for the
3948 operating system that is the host platform for this implementation of Samba.
3952 Launch MS Windows Explorer. Navigate in the left panel. Click
3954 <guimenu>My Network Places</guimenu>
3955 <guimenuitem>Entire Network</guimenuitem>
3956 <guimenuitem>Microsoft Windows Network</guimenuitem>
3957 <guimenuitem>Meganet2</guimenuitem>
3958 <guimenuitem>Massive</guimenuitem>
3959 </menuchoice>. Click on <guimenu>Massive</guimenu>
3960 <guimenu>Printers and Faxes</guimenu>.
3964 Identify a printer that is shown in the right panel. Let us assume the printer is called
3965 <constant>ps01-color</constant>. Right-click on the <guimenu>ps01-color</guimenu> icon
3966 and select the <guimenu>Properties</guimenu> entry. This opens a dialog box that indicates
3967 that <quote>The printer driver is not installed on this computer. Some printer properties
3968 will not be accessible unless you install the printer driver. Do you want to install the
3969 driver now?</quote> It is important at this point you answer <guimenu>No</guimenu>.
3973 The printer properties panel for the <guimenu>ps01-color</guimenu> printer on the server
3974 <constant>MASSIVE</constant> is displayed. Click the <guimenu>Advanced</guimenu> tab.
3975 Note that the box labeled <guimenu>Driver</guimenu> is empty. Click the <guimenu>New Driver</guimenu>
3976 button that is next to the <guimenu>Driver</guimenu> box. This launches the <quote>Add Printer Wizard</quote>.
3980 <indexterm><primary>Add Printer Wizard</primary><secondary>APW</secondary></indexterm>
3981 <indexterm><primary>APW</primary></indexterm>
3982 The <quote>Add Printer Driver Wizard on <constant>MASSIVE</constant></quote> panel
3983 is now presented. Click <guimenu>Next</guimenu> to continue. From the left panel, select the
3984 printer manufacturer. In your case, you are adding a driver for a printer manufactured by
3985 Lexmark. In the right panel, select the printer (Lexmark Optra Color 40 PS). Click
3986 <guimenu>Next</guimenu>, and then <guimenu>Finish</guimenu> to commence driver upload. A
3987 progress bar appears and instructs you as each file is being uploaded and that it is being
3988 directed at the network server <constant>\\massive\ps01-color</constant>.
3992 <indexterm><primary>printers</primary><secondary>Advanced</secondary></indexterm>
3993 <indexterm><primary>printers</primary><secondary>Properties</secondary></indexterm>
3994 <indexterm><primary>printers</primary><secondary>Sharing</secondary></indexterm>
3995 <indexterm><primary>printers</primary><secondary>General</secondary></indexterm>
3996 <indexterm><primary>printers</primary><secondary>Security</secondary></indexterm>
3997 <indexterm><primary>AD printer publishing</primary></indexterm>
3998 The driver upload completes in anywhere from a few seconds to a few minutes. When it completes,
3999 you are returned to the <guimenu>Advanced</guimenu> tab in the <guimenu>Properties</guimenu> panel.
4000 You can set the Location (under the <guimenu>General</guimenu> tab) and Security settings (under
4001 the <guimenu>Security</guimenu> tab). Under the <guimenu>Sharing</guimenu> tab it is possible to
4002 load additional printer drivers; there is also a check-box in this tab called <quote>List in the
4003 directory</quote>. When this box is checked, the printer will be published in Active Directory
4004 (Applicable to Active Directory use only.)
4008 <indexterm><primary>printers</primary><secondary>Default Settings</secondary></indexterm>
4009 Click <guimenu>OK</guimenu>. It will take a minute or so to upload the settings to the server.
4010 You are now returned to the <guimenu>Printers and Faxes on Massive</guimenu> monitor.
4011 Right-click on the printer, click <menuchoice><guimenu>Properties</guimenu>
4012 <guimenuitem>Device Settings</guimenuitem> </menuchoice>. Now change the settings to suit
4013 your requirements. BE CERTAIN TO CHANGE AT LEAST ONE SETTING and apply the changes even if
4014 you need to reverse the changes back to their original settings.
4018 This is necessary so that the printer settings are initialized in the Samba printers
4019 database. Click <guimenu>Apply</guimenu> to commit your settings. Revert any settings you changed
4020 just to initialize the Samba printers database entry for this printer. If you need to revert a setting,
4021 click <guimenu>Apply</guimenu> again.
4025 <indexterm><primary>Print Test Page</primary></indexterm>
4026 Verify that all printer settings are at the desired configuration. When you are satisfied that they are,
4027 click the <guimenu>General</guimenu> tab. Now click the <guimenu>Print Test Page</guimenu> button.
4028 A test page should print. Verify that it has printed correctly. Then click <guimenu>OK</guimenu>
4029 in the panel that is newly presented. Click <guimenu>OK</guimenu> on the <guimenu>ps01-color on
4030 massive Properties</guimenu> panel.
4034 You must repeat this process for all network printers (i.e., for every printer on each server).
4035 When you have finished uploading drivers to all printers, close all applications. The next task
4036 is to install software your users require to do their work.
4044 <title>Software Installation</title>
4047 Your network has both fixed desktop workstations as well as notebook computers. As a general rule, it is
4048 a good idea to not tamper with the operating system that is provided by the notebook computer manufacturer.
4049 Notebooks require special handling that is beyond the scope of this chapter.
4053 For desktop systems, the installation of software onto administratively centralized application servers
4054 make a lot of sense. This means that you can manage software maintenance from a central
4055 perspective and that only minimal application stubware needs to be installed onto the desktop
4056 systems. You should proceed with software installation and default configuration as far as is humanly
4057 possible and so long as it makes sense to do so. Make certain to thoroughly test and validate every aspect
4058 of software operations and configuration.
4062 When you believe that the overall configuration is complete, be sure to create a shared group profile
4063 and migrate that to the Samba server for later reuse when creating custom mandatory profiles, just in
4064 case a user may have specific needs you had not anticipated.
4070 <title>Roll-out Image Creation</title>
4073 The final steps before preparing the distribution Norton Ghost image file you might follow are:
4077 Unjoin the domain &smbmdash; Each workstation requires a unique name and must be independently
4078 joined into domain membership.
4079 </para></blockquote>
4082 Defragment the hard disk &smbmdash; While not obvious to the uninitiated, defragmentation results
4083 in better performance and often significantly reduces the size of the compressed disk image. That
4084 also means it will take less time to deploy the image onto 500 workstations.
4085 </para></blockquote>
4092 <title>Key Points Learned</title>
4095 This chapter introduced many new concepts. Is it a sad fact that the example presented deliberately
4096 avoided any consideration of security. Security does not just happen; you must design it into your total
4097 network. Security begins with a systems design and implementation that anticipates hostile behavior from
4098 users both inside and outside the organization. Hostile and malicious intruders do not respect barriers;
4099 they accept them as challenges. For that reason, if not simply from a desire to establish safe networking
4100 practices, you must not deploy the design presented in this book in an environment where there is risk
4105 <indexterm><primary>Access Control Lists</primary><see>ACLs</see></indexterm>
4106 <indexterm><primary>ACLs</primary></indexterm>
4107 As a minimum, the LDAP server must be protected by way of Access Control Lists (ACLs), and it must be
4108 configured to use secure protocols for all communications over the network. Of course, secure networking
4109 does not result just from systems design and implementation but involves constant user education
4110 training and, above all, disciplined attention to detail and constant searching for signs of unfriendly
4111 or alien activities. Security is itself a topic for a whole book. Please do consult appropriate sources.
4112 Jerry Carter's book <ulink url="http://www.booksense.com/product/info.jsp&isbn=1565924916">
4113 <emphasis>LDAP System Administration</emphasis></ulink> is a good place to start reading about OpenLDAP
4114 as well as security considerations.
4118 The substance of this chapter that has been deserving of particular attention includes:
4123 Implementation of an OpenLDAP-based passwd backend, necessary to support distributed
4128 Implementation of Samba primary and secondary domain controllers with a common LDAP backend
4129 for user and group accounts that is shared with the UNIX system through the PADL nss_ldap and
4134 Use of the Idealx smbldap-tools scripts for UNIX (POSIX) account management as well as
4135 to manage Samba Windows user and group accounts.
4139 The basics of implementation of Group Policy controls for Windows network clients.
4143 Control over roaming profiles, with particular focus on folder redirection to network drives.
4147 Use of the CUPS printing system together with Samba-based printer driver auto-download.
4155 <title>Questions and Answers</title>
4158 Well, here we are at the end of this chapter and we have only ten questions to help you to
4159 remember so much. There are bound to be some sticky issues here.
4162 <qandaset defaultlabel="chap06qa">
4167 Why did you not cover secure practices? Isn't it rather irresponsible to instruct
4168 network administrators to implement insecure solutions?
4175 Let's get this right. This is a book about Samba, not about OpenLDAP and secure
4176 communication protocols for subjects other than Samba. Earlier on, you note,
4177 that the dynamic DNS and DHCP solutions also used no protective secure communications
4178 protocols. The reason for this is simple: There are so many ways of implementing
4179 secure protocols that this book would have been even larger and more complex.
4183 The solutions presented here all work (at least they did for me). Network administrators
4184 have the interest and the need to be better trained and instructed in secure networking
4185 practices and ought to implement safe systems. I made the decision, right or wrong,
4186 to keep this material as simple as possible. The intent of this book is to demonstrate
4187 a working solution and not to discuss too many peripheral issues.
4191 This book makes little mention of backup techniques. Does that mean that I am recommending
4192 that you should implement a network without provision for data recovery and for disaster
4193 management? Back to our focus: The deployment of Samba has been clearly demonstrated.
4203 You have focused much on SUSE Linux and little on the market leader, Red Hat. Do
4204 you have a problem with Red Hat Linux? Doesn't that make your guidance irrelevant
4205 to the Linux I might be using?
4212 Both Red Hat Linux and SUSE Linux comply with the Linux Standards Base specifications
4213 for a standard Linux distribution. The differences are marginal. Surely you know
4214 your Linux platform, and you do have access to administration manuals for it. This
4215 book is not a Linux tutorial; it is a Samba tutorial. Let's keep the focus on
4216 the Samba part of the book; all the other bits are peripheral (but important) to
4217 creation of a total network solution.
4221 What I find interesting is the attention reviewers give to Linux installation and to
4222 the look and feel of the desktop, but does that make for a great server? In this book,
4223 I have paid particular attention to the details of creating a whole solution framework.
4224 I have not tightened every nut and bolt, but I have touched on all the issues you
4225 need to be familiar with. Over the years many people have approached me wanting to
4226 know the details of exactly how to implement a DHCP and dynamic DNS server with Samba
4227 and WINS. In this chapter, it is plain to see what needs to be configured to provide
4228 transparent interoperability. Likewise for CUPS and Samba interoperation. These are
4229 key stumbling areas for many people.
4233 At every critical junction, I have provided comparative guidance for both SUSE and
4234 Red Hat Linux. Both manufacturers have done a great job in furthering the cause
4235 of open source software. I favor neither and respect both. I like particular
4236 features of both products (companies also). No bias in presentation is intended.
4237 Oh, before I forget, I particularly like Debian Linux; that is my favorite playground.
4247 You did not use SWAT to configure Samba. Is there something wrong with it?
4254 That is a good question. As it is, the &smb.conf; file configurations are presented
4255 in as direct a format as possible. Adding SWAT into the equation would have complicated
4256 matters. I sought simplicity of implementation. The fact is that I did use SWAT to
4257 create the files in the first place.
4261 There are people in the Linux and open source community who feel that SWAT is dangerous
4262 and insecure. Many will not touch it with a barge-pole. By not introducing SWAT, I
4263 hope to have brought their interests on board. SWAT is well covered is <emphasis>TOSHARG2</emphasis>.
4273 You have exposed a well-used password <emphasis>not24get</emphasis>. Is that
4281 Well, I had to use a password of some sort. At least this one has been consistently
4282 used throughout. I guess you can figure out that in a real deployment it would make
4283 sense to use a more secure and original password.
4293 The Idealx smbldap-tools create many domain group accounts that are not used. Is that
4301 I took this up with Idealx and found them most willing to change that in the next version.
4302 Let's give Idealx some credit for the contribution they have made. I appreciate their work
4303 and, besides, it does no harm to create accounts that are not now used &smbmdash; at some time
4304 Samba may well use them.
4314 Can I use LDAP just for Samba accounts and not for UNIX system accounts?
4321 Yes, you can do that for user accounts only. Samba requires there to be a POSIX (UNIX)
4322 group account for every Windows domain group account. But if you put your users into
4323 the system password account, how do you plan to keep all domain controller system
4324 password files in sync? I think that having everything in LDAP makes a lot of sense
4325 for the UNIX administrator who is still learning the craft and is migrating from MS Windows.
4335 Why are the Windows domain RID portions not the same as the UNIX UID?
4342 Samba uses a well-known public algorithm for assigning RIDs from UIDs and GIDs.
4343 This algorithm ought to ensure that there will be no clashes with well-known RIDs.
4344 Well-known RIDs have special significance to MS Windows clients. The automatic
4345 assignment used the calculation: RID = UID x 2 + 1000. Of course, Samba does
4346 permit you to override that to some extent. See the &smb.conf; man page entry
4347 for <parameter>algorithmic rid base</parameter>.
4357 Printer configuration examples all show printing to the HP port 9100. Does this
4358 mean that I must have HP printers for these solutions to work?
4365 No. You can use any type of printer and must use the interfacing protocol supported
4366 by the printer. Many networks use LPR/LPD print servers to which are attached
4367 PCL printers, inkjet printers, plotters, and so on. At home I use a USB-attached
4368 inkjet printer. Use the appropriate device URI (Universal Resource Interface)
4369 argument to the <constant>lpadmin -v</constant> option that is right for your
4380 Is folder redirection dangerous? I've heard that you can lose your data that way.
4387 The only loss of data I know of that involved folder redirection was caused by
4388 manual misuse of the redirection tool. The administrator redirected a folder to
4389 a network drive and said he wanted to migrate (move) the data over. Then he
4390 changed his mind, so he moved the folder back to the roaming profile. This time,
4391 he declined to move the data because he thought it was still in the local profile
4392 folder. That was not the case, so by declining to move the data back, he wiped out
4393 the data. You cannot hold the tool responsible for that. Caveat emptor still applies.
4403 Is it really necessary to set a local Group Policy to exclude the redirected
4404 folders from the roaming profile?
4411 Yes. If you do not do this, the data will still be copied from the network folder
4412 (share) to the local cached copy of the profile.