s3:lib: make use of samba_tevent_context_init()
[Samba/gebeck_regimport.git] / docs-xml / Samba3-ByExample / SBE-SecureOfficeServer.xml
blob956bb4dcdb4733af284083b9fe1ab1596f03c123
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="secure">
4   <title>Secure Office Networking</title>
6         <para>
7         Congratulations, your Samba networking skills are developing nicely. You started out
8         with three simple networks in <link linkend="simple"/>, and then in <link linkend="small"/>
9         you designed and built a network that provides a high degree of flexibility, integrity,
10         and dependability. It was enough for the basic needs each was designed to fulfill. In
11         this chapter you address a more complex set of needs. The solution you explore 
12         introduces you to basic features that are specific to Samba-3.
13         </para>
15         <para>
16         You should note that a working and secure solution could be implemented using Samba-2.2.x. 
17         In the exercises presented here, you are gradually using more Samba-3-specific features,
18         so caution is advised for anyone who tries to use Samba-2.2.x with the guidance here given. 
19         To avoid confusion, this book is all about Samba-3. Let's get the exercises in this 
20         chapter underway.
21         </para>
23 <sect1>
24         <title>Introduction</title>
26         <para>
27         You have made Mr. Meany a very happy man. Recently he paid you a fat bonus for work 
28         well done. It is one year since the last network upgrade. You have been quite busy. 
29         Two months ago Mr. Meany gave approval to hire Christine Roberson, who has taken over 
30         general network management. Soon she will provide primary user support. You have
31         demonstrated that you can delegate responsibility and can plan and execute according
32         to that plan. Above all, you have shown Mr. Meany that you are a responsible person.
33         Today is a big day. Mr. Meany called you to his office at 9 a.m. for news you never 
34         expected: You are going to take charge of business operations. Mr. Meany 
35         is retiring and has entrusted the business to your capable hands. 
36         </para>
38         <para>
39         Mr. Meany may be retiring from this company, but not from work. He is taking the
40         opportunity to develop Abmas Accounting into a larger and more substantial company.
41         He says that it took him many years to learn that there is no future in just running
42         a business. He now realizes there is great personal satisfaction in the creation of
43         career opportunities for people in the local community. He wants to do more for others,
44         as he is doing for you. Today he spent a lot of time talking about his grand plan
45         for growth, which you will deal with in the chapters ahead.
46         </para>
48         <para>
49         Over the past year, the growth projections were exceeded. The network has grown to
50         meet the needs of 130 users. Along with growth, the demand for improved services
51         and better functionality has also developed. You are about to make an interim
52         improvement and then hand over all Help desk and network maintenance to Christine.
53         Christine has professional certifications in Microsoft Windows as well as in Linux;
54         she is a hard worker and quite likable. Christine does not want to manage the department
55         (although she manages well). She gains job satisfaction when left to sort things out.
56         Occasionally she wants to work with you on a challenging problem. When you told her
57         about your move, she almost resigned, although she was reassured that a new manager would
58         be hired to run Information Technology, and she would be responsible only for operations.
59         </para>
61         <sect2>
62                 <title>Assignment Tasks</title>
64                 <para>
65                 You promised the staff Internet services including Web browsing, electronic mail, virus
66                 protection, and a company Web site.  Christine is eager to help turn the vision into 
67                 reality. Let's see how close you can get to the promises made.
68                 </para>
70                 <para>
71                 The network you are about to deliver will service 130 users today. Within a year,
72                 Abmas will aquire another company. Mr. Meany claims that within 2 years there will be
73                 well over 500 users on the network. You have bought into the big picture, so prepare 
74                 for growth.  You have purchased a new server and will implement a new network infrastructure. 
75                 </para>
77                 <para>
78                 You have decided to not recycle old network components. The only items that will be
79                 carried forward are notebook computers. You offered staff new notebooks, but not 
80                 one person wanted the disruption for what was perceived as a marginal update. 
81                 You decided to give everyone, even the notebook user, a new desktop computer.
82                 </para>
84                 <para>
85                 You procured a DSL Internet connection that provides 1.5 Mb/sec (bidirectional)
86                 and a 10 Mb/sec ethernet port. You registered the domain
87                 <constant>abmas.us</constant>, and the Internet Service Provider (ISP) is supplying
88                 secondary DNS. Information furnished by your ISP is shown in <link linkend="chap4netid"/>.
89                 </para>
91                 <para>
92                 It is of paramount priority that under no circumstances will Samba offer
93                 service access from an Internet connection. You are paying an ISP to
94                 give, as part of its value-added services, full firewall protection for your
95                 connection to the outside world. The only services allowed in from
96                 the Internet side are the following destination ports: <constant>http/https (ports 
97                 80 and 443), email (port 25), DNS (port 53)</constant>. All Internet traffic
98                 will be allowed out after network address translation (NAT). No internal IP addresses
99                 are permitted through the NAT filter because complete privacy of internal network
100                 operations must be assured.
101                 </para>
103                 <table id="chap4netid">
104                         <title>Abmas.US ISP Information</title>
105                         <tgroup cols="2">
106                                 <colspec align="left"/>
107                                 <colspec align="center"/>
108                                 <thead>
109                                         <row>
110                                                 <entry>Parameter</entry>
111                                                 <entry>Value</entry>
112                                         </row>
113                                 </thead>
114                                 <tbody>
115                                         <row>
116                                                 <entry>Server IP Address</entry>
117                                                 <entry>123.45.67.66</entry>
118                                         </row>
119                                         <row>
120                                                 <entry>DSL Device IP Address</entry>
121                                                 <entry>123.45.67.65</entry>
122                                         </row>
123                                         <row>
124                                                 <entry>Network Address</entry>
125                                                 <entry>123.45.67.64/30</entry>
126                                         </row>
127                                         <row>
128                                                 <entry>Gateway Address</entry>
129                                                 <entry>123.45.54.65</entry>
130                                         </row>
131                                         <row>
132                                                 <entry>Primary DNS Server</entry>
133                                                 <entry>123.45.54.65</entry>
134                                         </row>
135                                         <row>
136                                                 <entry>Secondary DNS Server</entry>
137                                                 <entry>123.45.54.32</entry>
138                                         </row>
139                                         <row>
140                                                 <entry>Forwarding DNS Server</entry>
141                                                 <entry>123.45.12.23</entry>
142                                         </row>
143                                 </tbody>
144                         </tgroup>
145                 </table>
147                 <figure id="ch04net">
148                         <title>Abmas Network Topology &smbmdash; 130 Users</title>
149                         <imagefile scale="65">chap4-net</imagefile>
150                 </figure>
152                 <para>
153                 Christine recommended that desktop systems should be installed from a single cloned
154                 master system that has a minimum of locally installed software and loads all software
155                 off a central application server. The benefit of having the central application server
156                 is that it allows single-point maintenance of all business applications, a more
157                 efficient way to manage software.  She further recommended installation of antivirus 
158                 software on workstations as well as on the Samba server. Christine knows the dangers
159                 of potential virus infection and insists on a comprehensive approach to detective
160                 as well as corrective action to protect network operations.
161                 </para>
163                 <para>
164                 A significant concern is the problem of managing company growth. Recently, a number 
165                 of users had to share a PC while waiting for new machines to arrive. This presented 
166                 some problems with desktop computers and software installation into the new users' 
167                 desktop profiles.
168                 </para>
169                 
170         </sect2>
171 </sect1>
173 <sect1>
174         <title>Dissection and Discussion</title>
176         <para>
177         Many of the conclusions you draw here are obvious. Some requirements are not very clear
178         or may simply be your means of drawing the most out of Samba-3. Much can be done more simply
179         than you will demonstrate here, but keep in mind that the network must scale to at least 500
180         users. This means that some functionality will be overdesigned for the current 130-user
181         environment.
182         </para>
184         <sect2>
185                 <title>Technical Issues</title>
187                 <para>
188                 In this exercise we use a 24-bit subnet mask for the two local networks. This,
189                 of course, limits our network to a maximum of 253 usable IP addresses. The network
190                 address range chosen is one assigned by RFC1918 for private networks.
191                 When the number of users on the network begins to approach the limit of usable
192                 addresses, it is a good idea to switch to a network address specified in RFC1918
193                 in the 172.16.0.0/16 range. This is done in subsequent chapters.
194                 </para>
196                 <para>
197                 <indexterm><primary>tdbsam</primary></indexterm>
198                 <indexterm><primary>smbpasswd</primary></indexterm>
199                 The high growth rates projected are a good reason to use the <constant>tdbsam</constant>
200                 passdb backend. The use of <constant>smbpasswd</constant> for the backend may result in
201                 performance problems. The <constant>tdbsam</constant> passdb backend offers features that
202                 are not available with the older, flat ASCII-based <constant>smbpasswd</constant> database.
203                 </para>
205                 <para>
206                 <indexterm><primary>risk</primary></indexterm>
207                 The proposed network design uses a single server to act as an Internet services host for
208                 electronic mail, Web serving, remote administrative access via SSH, 
209                 Samba-based file and print services. This design is often chosen by sites that feel     
210                 they cannot afford or justify the cost or overhead of having separate servers. It must 
211                 be realized that if security of this type of server should ever be violated (compromised), 
212                 the whole network and all data is at risk. Many sites continue to choose this type 
213                 of solution; therefore, this chapter provides detailed coverage of key implementation 
214                 aspects.
215                 </para>
217                 <para>
218                 Samba will be configured to specifically not operate on the Ethernet interface that is
219                 directly connected to the Internet.
220                 </para>
222                 <para>
223                 <indexterm><primary>iptables</primary></indexterm>
224                 <indexterm><primary>NAT</primary></indexterm>
225                 <indexterm><primary>Network Address Translation</primary><see>NAT</see></indexterm>
226                 <indexterm><primary>firewall</primary></indexterm>
227                 You know that your ISP is providing full firewall services, but you cannot rely on that.
228                 Always assume that human error will occur, so be prepared by using Linux firewall facilities
229                 based on <command>iptables</command> to effect NAT. Block all
230                 incoming traffic except to permitted well-known ports. You must also allow incoming packets
231                 to establish outgoing connections. You will permit all internal outgoing requests.
232                 </para>
234                 <para>
235                 The configuration of Web serving, Web proxy services, electronic mail, and the details of
236                 generic antivirus handling are beyond the scope of this book and therefore are not
237                 covered except insofar as this affects Samba-3.
238                 </para>
240                 <para>
241                 <indexterm><primary>login</primary></indexterm>
242                 Notebook computers are configured to use a network login when in the office and a
243                 local account to log in while away from the office. Users store all work done in
244                 transit (away from the office) by using a local share for work files. Standard procedures
245                 dictate that on completion of the work that necessitates mobile file access, all
246                 work files are moved back to secure storage on the office server. Staff is instructed
247                 to not carry on any company notebook computer any files that are not absolutely required.
248                 This is a preventative measure to protect client information as well as private business
249                 records.
250                 </para>
252                 <para>
253                 <indexterm><primary>application server</primary></indexterm>
254                 All applications are served from the central server from a share called <constant>apps</constant>.
255                 Microsoft Office XP Professional and OpenOffice 1.1.0 will be installed using a network 
256                 (or administrative) installation. Accounting and financial management software can also
257                 be run only from the central application server. Notebook users are provided with
258                 locally installed applications on a need-to-have basis only.
259                 </para>
261                 <para>
262                 <indexterm><primary>roaming profiles</primary></indexterm>
263                 The introduction of roaming profiles support means that users can move between
264                 desktop computer systems without constraint while retaining full access to their data.
265                 The desktop travels with them as they move.
266                 </para>
268                 <para>
269                 <indexterm><primary>DNS</primary></indexterm>
270                 The DNS server implementation must now address both internal and external
271                 needs. You forward DNS lookups to your ISP-provided server as well as the 
272                 <constant>abmas.us</constant> external secondary DNS server.
273                 </para>
275                 <para>
276                 <indexterm><primary>dynamic DNS</primary></indexterm>
277                 <indexterm><primary>DDNS</primary><see>dynamic DNS</see></indexterm>
278                 <indexterm><primary>DHCP server</primary></indexterm>
279                 Compared with the DHCP server configuration in <link linkend="small"/>, <link linkend="dhcp01"/>, the 
280                 configuration used in this example has to deal with the presence of an Internet connection.
281                 The scope set for it ensures that no DHCP services will be offered on the external
282                 connection. All printers are configured as DHCP clients so that the DHCP server assigns
283                 the printer a fixed IP address by way of the Ethernet interface (MAC) address. One additional
284                 feature of this DHCP server configuration file is the inclusion of parameters to allow dynamic
285                 DNS (DDNS) operation.
286                 </para>
288                 <para>
289                 This is the first implementation that depends on a correctly functioning DNS server.
290                 Comprehensive steps are included to provide for a fully functioning DNS server that also
291                 is enabled for DDNS operation. This means that DHCP clients can be autoregistered
292                 with the DNS server.
293                 </para>
295                 <para>
296                 You are taking the opportunity to manually set the netbios name of the Samba server to
297                 a name other than what will be automatically resolved. You are doing this to ensure that
298                 the machine has the same NetBIOS name on both network segments.
299                 </para>
301                 <para>
302                 As in the previous network configuration, printing in this network configuration uses
303                 direct raw printing (i.e., no smart printing and no print driver autodownload to Windows
304                 clients). Printer drivers are installed on the Windows client manually. This is not
305                 a problem because Christine is to install and configure one single workstation and
306                 then clone that configuration, using Norton Ghost, to all workstations. Each machine is
307                 identical, so this should pose no problem.
308                 </para>
310                 <sect3>
311                 <title>Hardware Requirements</title>
313                 <para>
314                 <indexterm><primary>memory requirements</primary></indexterm>
315                 This server runs a considerable number of services. From similarly configured Linux
316                 installations, the approximate calculated memory requirements are as shown in
317                 <link linkend="ch4memoryest"/>.
319 <example id="ch4memoryest">
320 <title>Estimation of Memory Requirements</title>
321 <screen>
322 Application  Memory per User    130 Users      500 Users
323    Name        (MBytes)       Total MBytes   Total MBytes
324 -----------  ---------------  ------------   ------------
325 DHCP              2.5               3              3
326 DNS              16.0              16             16
327 Samba (nmbd)     16.0              16             16
328 Samba (winbind)  16.0              16             16
329 Samba (smbd)      4.0             520           2000
330 Apache           10.0 (20 User)   200            200
331 CUPS              3.5              16             32
332 Basic OS        256.0             256            256
333                               -------------- --------------
334     Total:                       1043 MBytes    2539 MBytes
335                               -------------- --------------
336 </screen>
337 </example>
338                 You should add a safety margin of at least 50% to these estimates. The minimum 
339                 system memory recommended for initial startup 1 GB, but to permit the system
340                 to scale to 500 users, it makes sense to provision the machine with 4 GB memory.
341                 An initial configuration with only 1 GB memory would lead to early performance complaints
342                 as the system load builds up. Given the low cost of memory, it does not make sense to
343                 compromise in this area.
344                 </para>
346                 <para>
347                 <indexterm><primary>bandwidth calculations</primary></indexterm>
348                 Aggregate input/output loads should be considered for sizing network configuration as 
349                 well as disk subsystems. For network bandwidth calculations, one would typically use an
350                 estimate of 0.1 MB/sec per user. This suggests that 100-Base-T (approx. 10 MB/sec)
351                 would deliver below acceptable capacity for the initial user load. It is therefore a good
352                 idea to begin with 1 Gb Ethernet cards for the two internal networks, each attached
353                 to a 1 Gb Ethernet switch that provides connectivity to an expandable array of 100-Base-T
354                 switched ports.
355                 </para>
357                 <para>
358                 <indexterm><primary>network segments</primary></indexterm>
359                 <indexterm><primary>RAID</primary></indexterm>
360                 Considering the choice of 1 Gb Ethernet interfaces for the two local network segments,
361                 the aggregate network I/O capacity will be 2100 Mb/sec (about 230 MB/sec), an I/O
362                 demand that would require a fast disk storage I/O capability. Peak disk throughput is 
363                 limited by the disk subsystem chosen. It is desirable to provide the maximum 
364                 I/O bandwidth affordable. If a low-cost solution must be chosen, 
365                 3Ware IDE RAID Controllers are a good choice. These controllers can be fitted into a 
366                 64-bit, 66 MHz PCI-X slot. They appear to the operating system as a high-speed SCSI 
367                 controller that can operate at the peak of the PCI-X bandwidth (approximately 450 MB/sec).
368                 Alternative SCSI-based hardware RAID controllers should also be considered. Alternately,
369                 it makes sense to purchase well-known, branded hardware that has appropriate performance
370                 specifications. As a minimum, one should attempt to provide a disk subsystem that can
371                 deliver I/O rates of at least 100 MB/sec. 
372                 </para>
374                 <para>
375                 Disk storage requirements may be calculated as shown in <link linkend="ch4diskest"/>.
377 <example id="ch4diskest">
378 <title>Estimation of Disk Storage Requirements</title>
379 <screen>
380 Corporate Data: 100 MBytes/user per year
381 Email Storage:  500 MBytes/user per year
382 Applications:   5000 MBytes
383 Safety Buffer:  At least 50%
385 Given 500 Users and 2 years:
386 -----------------------------
387         Corporate Data:  2 x 100 x 500 = 100000 MBytes = 100 GBytes
388         Email Storage:   2 x 500 x 500 = 500000 MBytes = 500 GBytes
389         Applications:                      5000 MBytes =   5 GBytes
390                                        ----------------------------
391                              Total:                      605 GBytes
392              Add 50% buffer                              303 GBytes
393                        Recommended Storage:              908 GBytes
394 </screen>
395 </example>
396                 <indexterm><primary>storage capacity</primary></indexterm>
397                 The preferred storage capacity should be approximately 1 Terabyte. Use of RAID level 5
398                 with two hot spare drives would require an 8-drive by 200 GB capacity per drive array.
399                 </para>
401                 </sect3>
403         </sect2>
406         <sect2>
407                 <title>Political Issues</title>
409                 <para>
410                 Your industry is coming under increasing accountability pressures. Increased paranoia
411                 is necessary so you can demonstrate that you have acted with due diligence. You must
412                 not trust your Internet connection.
413                 </para>
415                 <para>
416                 Apart from permitting more efficient management of business applications through use of
417                 an application server, your primary reason for the decision to implement this is that it
418                 gives you greater control over software licensing.
419                 </para>
421                 <para>
422                 <indexterm><primary>Outlook Express</primary></indexterm>
423                 You are well aware that the current configuration results in some performance issues
424                 as the size of the desktop profile grows. Given that users use Microsoft Outlook
425                 Express, you know that the storage implications of the <constant>.PST</constant> file
426                 is something that needs to be addressed later.
427                 </para>
429         </sect2>
431 </sect1>
433 <sect1>
434         <title>Implementation</title>
436         <para>
437         <link linkend="ch04net"/> demonstrates the overall design of the network that you will implement.
438         </para>
440         <para>
441         The information presented here assumes that you are already familiar with many basic steps.
442         As this stands, the details provided already extend well beyond just the necessities of
443         Samba configuration. This decision is deliberate to ensure that key determinants
444         of a successful installation are not overlooked. This is the last case that documents
445         the finite minutiae of DHCP and DNS server configuration. Beyond the information provided
446         here, there are many other good reference books on these subjects.
447         </para>
449         <para>
450         The &smb.conf; file has the following noteworthy features:
451         </para>
453         <itemizedlist>
454                 <listitem><para>
455                 The NetBIOS name of the Samba server is set to <constant>DIAMOND</constant>.
456                 </para></listitem>
458                 <listitem><para>
459                 The Domain name is set to <constant>PROMISES</constant>.
460                 </para></listitem>
462                 <listitem><para>
463                 <indexterm><primary>broadcast messages</primary></indexterm>
464                 <indexterm><primary>interfaces</primary></indexterm>
465                 <indexterm><primary>bind interfaces only</primary></indexterm>
466                 Ethernet interface <constant>eth0</constant> is attached to the Internet connection
467                 and is externally exposed. This interface is explicitly not available for Samba to use.
468                 Samba listens on this interface for broadcast messages but does not broadcast any
469                 information on <constant>eth0</constant>, nor does it accept any connections from it.
470                 This is achieved by way of the <parameter>interfaces</parameter> parameter and the
471                 <parameter>bind interfaces only</parameter> entry.
472                 </para></listitem>
474                 <listitem><para>
475                 <indexterm><primary>passdb backend</primary></indexterm>
476                 <indexterm><primary>tdbsam</primary></indexterm>
477                 <indexterm><primary>binary database</primary></indexterm>
478                 The <parameter>passdb backend</parameter> parameter specifies the creation and use
479                 of the <constant>tdbsam</constant> password backend. This is a binary database that
480                 has excellent scalability for a large number of user account entries.
481                 </para></listitem>
483                 <listitem><para>
484                 <indexterm><primary>WINS serving</primary></indexterm>
485                 <indexterm><primary>wins support</primary></indexterm>
486                 <indexterm><primary>name resolve order</primary></indexterm>
487                 WINS serving is enabled by the <smbconfoption name="wins support">Yes</smbconfoption>,
488                 and name resolution is set to use it by means of the
489                 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption> entry.
490                 </para></listitem>
492                 <listitem><para>
493                 <indexterm><primary>time server</primary></indexterm>
494                 The Samba server is configured for use by Windows clients as a time server.
495                 </para></listitem>
497                 <listitem><para>
498                 <indexterm><primary>CUPS</primary></indexterm>
499                 <indexterm><primary>printing</primary></indexterm>
500                 <indexterm><primary>printcap name</primary></indexterm>
501                 Samba is configured to directly interface with CUPS via the direct internal interface
502                 that is provided by CUPS libraries. This is achieved with the 
503                 <smbconfoption name="printing">CUPS</smbconfoption> as well as the
504                 <smbconfoption name="printcap name">CUPS</smbconfoption> entries.
505                 </para></listitem>
507                 <listitem><para>
508                 <indexterm><primary>user management</primary></indexterm>
509                 <indexterm><primary>group management</primary></indexterm>
510                 <indexterm><primary>SRVTOOLS.EXE</primary></indexterm>
511                 External interface scripts are provided to enable Samba to interface smoothly to
512                 essential operating system functions for user and group management. This is important
513                 to enable workstations to join the Domain and is also important so that you can use
514                 the Windows NT4 Domain User Manager as well as the Domain Server Manager. These tools
515                 are provided as part of the <filename>SRVTOOLS.EXE</filename> toolkit that can be 
516                 downloaded from the Microsoft FTP
517                 <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">site</ulink>.
518                 </para></listitem>
520                 <listitem><para>
521                 <indexterm><primary>User Mode</primary></indexterm>
522                 The &smb.conf; file specifies that the Samba server will operate in (default) <parameter>
523                 security = user</parameter> mode<footnote><para>See <emphasis>TOSHARG2</emphasis>, Chapter 3.
524                 This is necessary so that Samba can act as a Domain Controller (PDC); see
525                 <emphasis>TOSHARG2</emphasis>, Chapter 4, for additional information.</para></footnote>
526                 (User Mode).
527                 </para></listitem>
529                 <listitem><para>
530                 <indexterm><primary>logon services</primary></indexterm>
531                 <indexterm><primary>logon script</primary></indexterm>
532                 Domain logon services as well as a Domain logon script are specified. The logon script
533                 will be used to add robustness to the overall network configuration.
534                 </para></listitem>
536                 <listitem><para>
537                 <indexterm><primary>roaming profiles</primary></indexterm>
538                 <indexterm><primary>logon path</primary></indexterm>
539                 <indexterm><primary>profile share</primary></indexterm>
540                 Roaming profiles are enabled through the specification of the parameter,
541                 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>. The value of this parameter translates the
542                 <constant>%L</constant> to the name by which the Samba server is called by the client (for this
543                 configuration, it translates to the name <constant>DIAMOND</constant>), and the <constant>%U</constant>
544                 will translate to the name of the user within the context of the connection made to the profile share.
545                 It is the administrator's responsibility to ensure there is a directory in the root of the
546                 profile share for each user. This directory must be owned by the user also. An exception to this
547                 requirement is when a profile is created for group use.
548                 </para></listitem>
550                 <listitem><para>
551                 <indexterm><primary>virus</primary></indexterm>
552                 <indexterm><primary>opportunistic locking</primary></indexterm>
553                 Precautionary veto is effected for particular Windows file names that have been targeted by 
554                 virus-related activity. Additionally, Microsoft Office files are vetoed from opportunistic locking
555                 controls. This should help to prevent lock contention-related file access problems.
556                 </para></listitem>
558                 <listitem><para>
559                 Every user has a private home directory on the UNIX/Linux host. This is mapped to
560                 a network drive that is the same for all users.
561                 </para></listitem>
563         </itemizedlist>
565         <para>
566         The configuration of the server is the most complex so far. The following steps are used:
567         </para>
569         <orderedlist numeration="arabic">
570                 <listitem><para>
571                 Basic System Configuration
572                 </para></listitem>
574                 <listitem><para>
575                 Samba Configuration
576                 </para></listitem>
578                 <listitem><para>
579                 DHCP and DNS Server Configuration
580                 </para></listitem>
582                 <listitem><para>
583                 Printer Configuration
584                 </para></listitem>
586                 <listitem><para>
587                 Process Start-up Configuration
588                 </para></listitem>
590                 <listitem><para>
591                 Validation
592                 </para></listitem>
594                 <listitem><para>
595                 Application Share Configuration
596                 </para></listitem>
598                 <listitem><para>
599                 Windows Client Configuration
600                 </para></listitem>
601         </orderedlist>
603         <para>
604         The following sections cover each step in logical and defined detail.
605         </para>
607         <sect2 id="ch4bsc">
608         <title>Basic System Configuration</title>
610         <para>
611         <indexterm><primary>SUSE Enterprise Linux Server</primary></indexterm>
612         The preparation in this section assumes that your SUSE Enterprise Linux Server 8.0 system has been
613         freshly installed. It prepares basic files so that the system is ready for comprehensive
614         operation in line with the network diagram shown in <link linkend="ch04net"/>.
615         </para>
617         <procedure>
618         <title>Server Configuration Steps</title>
620                 <step><para>
621                 <indexterm><primary>hostname</primary></indexterm>
622                 Using the UNIX/Linux system tools, name the server <constant>server.abmas.us</constant>.
623                 Verify that your hostname is correctly set by running:
624 <screen>
625 &rootprompt; uname -n
626 server
627 </screen>
628                 An alternate method to verify the hostname is:
629 <screen>
630 &rootprompt; hostname -f
631 server.abmas.us
632 </screen>
633                 </para></step>
635                 <step><para>
636                 <indexterm><primary>/etc/hosts</primary></indexterm>
637                 <indexterm><primary>localhost</primary></indexterm>
638                 Edit your <filename>/etc/hosts</filename> file to include the primary names and addresses
639                 of all network interfaces that are on the host server. This is necessary so that during
640                 startup the system can resolve all its own names to the IP address prior to
641                 startup of the DNS server. An example of entries that should be in the 
642                 <filename>/etc/hosts</filename> file is:
643 <screen>
644 127.0.0.1       localhost
645 192.168.1.1     sleeth1.abmas.biz sleeth1 diamond
646 192.168.2.1     sleeth2.abmas.biz sleeth2
647 123.45.67.66    server.abmas.us server
648 </screen>
649                 You should check the startup order of your system. If the CUPS print server is started before
650                 the DNS server (<command>named</command>), you should also include an entry for the printers
651                 in the <filename>/etc/hosts</filename> file, as follows:
652 <screen>
653 192.168.1.20    qmsa.abmas.biz qmsa
654 192.168.1.30    hplj6a.abmas.biz hplj6a
655 192.168.2.20    qmsf.abmas.biz qmsf
656 192.168.2.30    hplj6f.abmas.biz hplj6f
657 </screen>
658                 <indexterm><primary>named</primary></indexterm>
659                 <indexterm><primary>cupsd</primary></indexterm>
660                 <indexterm><primary>daemon</primary></indexterm>
661                 The printer entries are not necessary if <command>named</command> is started prior to
662                 startup of <command>cupsd</command>, the CUPS daemon.
663                 </para></step>
665                 <step><para>
666                 <indexterm><primary>/etc/rc.d/boot.local</primary></indexterm>
667                 <indexterm><primary>IP forwarding</primary></indexterm>
668                 <indexterm><primary>/proc/sys/net/ipv4/ip_forward</primary></indexterm>
669                 The host server is acting as a router between the two internal network segments as well
670                 as for all Internet access. This necessitates that IP forwarding be enabled. This can be
671                 achieved by adding to the <filename>/etc/rc.d/boot.local</filename> an entry as follows:
672 <screen>
673 echo 1 > /proc/sys/net/ipv4/ip_forward
674 </screen>
675                 To ensure that your kernel is capable of IP forwarding during configuration, you may 
676                 wish to execute that command manually also. This setting permits the Linux system to 
677                 act as a router.<footnote><para>You may want to do the echo command last and include 
678                                 "0" in the init scripts, since it opens up your network for a short time.</para></footnote>
679                 </para></step>
681                 <step><para>
682                 <indexterm><primary>firewall</primary></indexterm>
683                 <indexterm><primary>abmas-netfw.sh</primary></indexterm>
684                 Installation of a basic firewall and NAT facility is necessary.
685                 The following script can be installed in the <filename>/usr/local/sbin</filename>
686                 directory. It is executed from the <filename>/etc/rc.d/boot.local</filename> startup
687                 script. In your case, this script is called <filename>abmas-netfw.sh</filename>. The
688                 script contents are shown in <link linkend="ch4natfw"/>.
690 <example id="ch4natfw">
691 <title>NAT Firewall Configuration Script</title>
692 <screen>
693 #!/bin/sh
694 echo -e "\n\nLoading NAT firewall.\n"
695 IPTABLES=/usr/sbin/iptables
696 EXTIF="eth0"
697 INTIFA="eth1"
698 INTIFB="eth2"
700 /sbin/depmod -a
701 /sbin/modprobe ip_tables
702 /sbin/modprobe ip_conntrack
703 /sbin/modprobe ip_conntrack_ftp
704 /sbin/modprobe iptable_nat
705 /sbin/modprobe ip_nat_ftp
706 $IPTABLES -P INPUT DROP
707 $IPTABLES -F INPUT
708 $IPTABLES -P OUTPUT ACCEPT
709 $IPTABLES -F OUTPUT
710 $IPTABLES -P FORWARD DROP
711 $IPTABLES -F FORWARD
713 $IPTABLES -A INPUT -i lo -j ACCEPT
714 $IPTABLES -A INPUT -i $INTIFA -j ACCEPT
715 $IPTABLES -A INPUT -i $INTIFB -j ACCEPT
716 $IPTABLES -A INPUT -i $EXTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
717 # Enable incoming traffic for: SSH, SMTP, DNS(tcp), HTTP, HTTPS
718 for i in 22 25 53 80 443
720         $IPTABLES -A INPUT -i $EXTIF -p tcp --dport $i  -j ACCEPT
721 done
722 # Allow DNS(udp)
723 $IPTABLES -A INPUT -i $EXTIF -p udp -dport 53  -j ACCEPT
724 echo "Allow all connections OUT and only existing and specified ones IN"
725 $IPTABLES -A FORWARD -i $EXTIF -o $INTIFA -m state \
726                                   --state ESTABLISHED,RELATED -j ACCEPT
727 $IPTABLES -A FORWARD -i $EXTIF -o $INTIFB -m state \
728                                   --state ESTABLISHED,RELATED -j ACCEPT
729 $IPTABLES -A FORWARD -i $INTIFA -o $EXTIF -j ACCEPT
730 $IPTABLES -A FORWARD -i $INTIFB -o $EXTIF -j ACCEPT
731 $IPTABLES -A FORWARD -j LOG
732 echo "   Enabling SNAT (MASQUERADE) functionality on $EXTIF"
733 $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
734 echo "1" > /proc/sys/net/ipv4/ip_forward
735 echo -e "\nNAT firewall done.\n"
736 </screen>
737 </example>
738                 </para></step>
740                 <step><para>
741                 Execute the following to make the script executable:
742 <screen>
743 &rootprompt; chmod 755 /usr/local/sbin/abmas-natfw.sh
744 </screen>
745                 You must now edit <filename>/etc/rc.d/boot.local</filename> to add an entry
746                 that runs your <command>abmas-natfw.sh</command> script. The following
747                 entry works for you:
748 <screen>
749 #! /bin/sh
751 # Copyright (c) 2002 SUSE Linux AG Nuernberg, Germany. 
752 # All rights reserved.
754 # Author: Werner Fink, 1996
755 #         Burchard Steinbild, 1996
757 # /etc/init.d/boot.local
759 # script with local commands to be executed from init on system startup
761 # Here you should add things that should happen directly after booting
762 # before we're going to the first run level.
764 /usr/local/sbin/abmas-natfw.sh
765 </screen>
766                 </para></step>
767         </procedure>
769         <para>
770         <indexterm><primary>/etc/hosts</primary></indexterm>
771         The server is now ready for Samba configuration. During the validation step, you remove
772         the entry for the Samba server <constant>diamond</constant> from the <filename>/etc/hosts</filename>
773         file. This is done after you are satisfied that DNS-based name resolution is functioning correctly.
774         </para>
776         </sect2>
778         <sect2>
779         <title>Samba Configuration</title>
781         <para>
782         When you have completed this section, the Samba server is ready for testing and validation;
783         however, testing and validation have to wait until DHCP, DNS, and printing (CUPS) services have 
784         been configured.
785         </para>
787         <procedure>
788         <title>Samba Configuration Steps</title>
790                 <step><para>
791                 Install the Samba-3 binary RPM from the Samba-Team FTP site. Assuming that the binary
792                 RPM file is called <filename>samba-3.0.20-1.i386.rpm</filename>, one way to install this
793                 file is as follows:
794 <screen>
795 &rootprompt; rpm -Uvh samba-3.0.20-1.i386.rpm
796 </screen>
797                 This operation must be performed while logged in as the <command>root</command> user.
798                 Successful operation is clearly indicated. If this installation should fail for any reason,
799                 refer to the operating system manufacturer's documentation for guidance.
800                 </para></step>
802                 <step><para>
803                 Install the &smb.conf; file shown in <link linkend="promisnet"/>, <link linkend="promisnetsvca"/>,
804                 and <link linkend="promisnetsvcb"/>. Concatenate (join) all three files to make a single &smb.conf;
805                 file. The final, fully qualified path for this file should be <filename>/etc/samba/smb.conf</filename>.
807 <example id="promisnet">
808 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; [globals] Section</title>
809 <smbconfblock>
810 <smbconfcomment>Global parameters</smbconfcomment>
811 <smbconfsection name="[global]"/>
812 <smbconfoption name="workgroup">PROMISES</smbconfoption>
813 <smbconfoption name="netbios name">DIAMOND</smbconfoption>
814 <smbconfoption name="interfaces">eth1, eth2, lo</smbconfoption>
815 <smbconfoption name="bind interfaces only">Yes</smbconfoption>
816 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
817 <smbconfoption name="pam password change">Yes</smbconfoption>
818 <smbconfoption name="passwd program">/usr/bin/passwd %u</smbconfoption>
819 <smbconfoption name="passwd chat">*New*Password* %n\n *Re-enter*new*password*%n\n *Password*changed*</smbconfoption>
820 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
821 <smbconfoption name="unix password sync">Yes</smbconfoption>
822 <smbconfoption name="log level">1</smbconfoption>
823 <smbconfoption name="syslog">0</smbconfoption>
824 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
825 <smbconfoption name="max log size">50</smbconfoption>
826 <smbconfoption name="smb ports">139</smbconfoption>
827 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
828 <smbconfoption name="time server">Yes</smbconfoption>
829 <smbconfoption name="printcap name">CUPS</smbconfoption>
830 <smbconfoption name="show add printer wizard">No</smbconfoption>
831 <smbconfoption name="add user script">/usr/sbin/useradd -m '%u'</smbconfoption>
832 <smbconfoption name="delete user script">/usr/sbin/userdel -r '%u'</smbconfoption>
833 <smbconfoption name="add group script">/usr/sbin/groupadd '%g'</smbconfoption>
834 <smbconfoption name="delete group script">/usr/sbin/groupdel '%g'</smbconfoption>
835 <smbconfoption name="add user to group script">/usr/sbin/usermod -G '%g' '%u'</smbconfoption>
836 <smbconfoption name="add machine script">/usr/sbin/useradd -s /bin/false -d /tmp '%u'</smbconfoption>
837 <smbconfoption name="shutdown script">/var/lib/samba/scripts/shutdown.sh</smbconfoption>
838 <smbconfoption name="abort shutdown script">/sbin/shutdown -c</smbconfoption>
839 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
840 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
841 <smbconfoption name="logon drive">X:</smbconfoption>
842 <smbconfoption name="logon home">\\%L\%U</smbconfoption>
843 <smbconfoption name="domain logons">Yes</smbconfoption>
844 <smbconfoption name="preferred master">Yes</smbconfoption>
845 <smbconfoption name="wins support">Yes</smbconfoption>
846 <smbconfoption name="utmp">Yes</smbconfoption>
847 <smbconfoption name="map acl inherit">Yes</smbconfoption>
848 <smbconfoption name="printing">cups</smbconfoption>
849 <smbconfoption name="cups options">Raw</smbconfoption>
850 <smbconfoption name="veto files">/*.eml/*.nws/*.{*}/</smbconfoption>
851 <smbconfoption name="veto oplock files">/*.doc/*.xls/*.mdb/</smbconfoption>
852 </smbconfblock>
853 </example>
855 <example id="promisnetsvca">
856 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part A</title>
857 <smbconfblock>
858 <smbconfsection name="[homes]"/>
859 <smbconfoption name="comment">Home Directories</smbconfoption>
860 <smbconfoption name="valid users">%S</smbconfoption>
861 <smbconfoption name="read only">No</smbconfoption>
862 <smbconfoption name="browseable">No</smbconfoption>
864 <smbconfsection name="[printers]"/>
865 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
866 <smbconfoption name="path">/var/spool/samba</smbconfoption>
867 <smbconfoption name="guest ok">Yes</smbconfoption>
868 <smbconfoption name="printable">Yes</smbconfoption>
869 <smbconfoption name="use client driver">Yes</smbconfoption>
870 <smbconfoption name="default devmode">Yes</smbconfoption>
871 <smbconfoption name="browseable">No</smbconfoption>
873 <smbconfsection name="[netlogon]"/>
874 <smbconfoption name="comment">Network Logon Service</smbconfoption>
875 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
876 <smbconfoption name="guest ok">Yes</smbconfoption>
877 <smbconfoption name="locking">No</smbconfoption>
879 <smbconfsection name="[profiles]"/>
880 <smbconfoption name="comment">Profile Share</smbconfoption>
881 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
882 <smbconfoption name="read only">No</smbconfoption>
883 <smbconfoption name="profile acls">Yes</smbconfoption>
885 <smbconfsection name="[accounts]"/>
886 <smbconfoption name="comment">Accounting Files</smbconfoption>
887 <smbconfoption name="path">/data/accounts</smbconfoption>
888 <smbconfoption name="read only">No</smbconfoption>
889 </smbconfblock>
890 </example>
892 <example id="promisnetsvcb">
893 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part B</title>
894 <smbconfblock>
895 <smbconfsection name="[service]"/>
896 <smbconfoption name="comment">Financial Services Files</smbconfoption>
897 <smbconfoption name="path">/data/service</smbconfoption>
898 <smbconfoption name="read only">No</smbconfoption>
900 <smbconfsection name="[pidata]"/>
901 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
902 <smbconfoption name="path">/data/pidata</smbconfoption>
903 <smbconfoption name="read only">No</smbconfoption>
905 <smbconfsection name="[apps]"/>
906 <smbconfoption name="comment">Application Files</smbconfoption>
907 <smbconfoption name="path">/apps</smbconfoption>
908 <smbconfoption name="read only">Yes</smbconfoption>
909 <smbconfoption name="admin users">bjordan</smbconfoption>
910 </smbconfblock>
911 </example>
912                 </para></step>
914                 <step><para>
915               <indexterm><primary>administrator</primary></indexterm><indexterm>
916                 <primary>smbpasswd</primary>
917               </indexterm>
918                 Add the <constant>root</constant> user to the password backend as follows:
919 <screen>
920 &rootprompt; smbpasswd -a root
921 New SMB password: XXXXXXXX
922 Retype new SMB password: XXXXXXXX
923 &rootprompt;
924 </screen>
925                 The <constant>root</constant> account is the UNIX equivalent of the Windows Domain Administrator.
926                 This account is essential in the regular maintenance of your Samba server. It must never be
927                 deleted. If for any reason the account is deleted, you may not be able to recreate this account
928                 without considerable trouble.
929                 </para></step>
931                 <step><para>
932                 <indexterm><primary>username map</primary></indexterm>
933                 Create the username map file to permit the <constant>root</constant> account to be called
934                 <constant>Administrator</constant> from the Windows network environment. To do this, create
935                 the file <filename>/etc/samba/smbusers</filename> with the following contents:
936 <screen>
937 ####
938 # User mapping file
939 ####
940 # File Format
941 # -----------
942 # Unix_ID = Windows_ID
944 # Examples:
945 # root = Administrator
946 # janes = "Jane Smith"
947 # jimbo = Jim Bones
949 # Note: If the name contains a space it must be double quoted.
950 #       In the example above the name 'jimbo' will be mapped to Windows
951 #       user names 'Jim' and 'Bones' because the space was not quoted.
952 #######################################################################
953 root = Administrator
954 ####
955 # End of File
956 ####
957 </screen>
958                 </para></step>
960                 <step><para>
961                 <indexterm><primary>initGrps.sh</primary></indexterm>
962                 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>add</tertiary></indexterm>
963                 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>modify</tertiary></indexterm>
964                 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>list</tertiary></indexterm>
965                 Create and map Windows Domain Groups to UNIX groups. A sample script is provided in <link linkend="small"/>,
966                 <link linkend="initGrps"/>. Create a file containing this script. We called ours
967                 <filename>/etc/samba/initGrps.sh</filename>. Set this file so it can be executed,
968                 and then execute the script. Sample output should be as follows:
970 <example id="ch4initGrps">
971 <title>Script to Map Windows NT Groups to UNIX Groups</title>
972 <indexterm><primary>initGrps.sh</primary></indexterm>
973 <screen>
974 #!/bin/bash
976 # initGrps.sh
979 # Create UNIX groups
980 groupadd acctsdep
981 groupadd finsrvcs
983 # Map Windows Domain Groups to UNIX groups
984 net groupmap add ntgroup="Domain Admins"  unixgroup=root type=d
985 net groupmap add ntgroup="Domain Users"   unixgroup=users type=d
986 net groupmap add ntgroup="Domain Guests"  unixgroup=nobody type=d
988 # Add Functional Domain Groups
989 net groupmap add ntgroup="Accounts Dept"  unixgroup=acctsdep type=d
990 net groupmap add ntgroup="Financial Services" unixgroup=finsrvcs type=d
991 net groupmap add ntgroup="Insurance Group"     unixgroup=piops type=d
993 # Map Windows NT machine local groups to local UNIX groups
994 # Mapping of local groups is not necessary and not functional
995 # for this installation.
996 </screen>
997 </example>
999 <screen>
1000 &rootprompt; chmod 755 initGrps.sh
1001 &rootprompt; /etc/samba # ./initGrps.sh
1002 Updated mapping entry for Domain Admins
1003 Updated mapping entry for Domain Users
1004 Updated mapping entry for Domain Guests
1005 No rid or sid specified, choosing algorithmic mapping
1006 Successfully added group Accounts Dept to the mapping db
1007 No rid or sid specified, choosing algorithmic mapping
1008 Successfully added group Domain Guests to the mapping db
1010 &rootprompt; /etc/samba # net groupmap list | sort
1011 Account Operators (S-1-5-32-548) -> -1
1012 Accounts Dept (S-1-5-21-179504-2437109-488451-2003) -> acctsdep
1013 Administrators (S-1-5-32-544) -> -1
1014 Backup Operators (S-1-5-32-551) -> -1
1015 Domain Admins (S-1-5-21-179504-2437109-488451-512) -> root
1016 Domain Guests (S-1-5-21-179504-2437109-488451-514) -> nobody
1017 Domain Users (S-1-5-21-179504-2437109-488451-513) -> users
1018 Financial Services (S-1-5-21-179504-2437109-488451-2005) -> finsrvcs
1019 Guests (S-1-5-32-546) -> -1
1020 Power Users (S-1-5-32-547) -> -1
1021 Print Operators (S-1-5-32-550) -> -1
1022 Replicators (S-1-5-32-552) -> -1
1023 System Operators (S-1-5-32-549) -> -1
1024 Users (S-1-5-32-545) -> -1
1025 </screen>
1026                 </para></step>
1028                 <step><para>
1029                 <indexterm><primary>useradd</primary></indexterm>
1030                 <indexterm><primary>adduser</primary></indexterm>
1031                 <indexterm><primary>passwd</primary></indexterm>
1032                 <indexterm><primary>smbpasswd</primary></indexterm>
1033                 <indexterm><primary>/etc/passwd</primary></indexterm>
1034                 <indexterm><primary>password</primary><secondary>backend</secondary></indexterm>
1035                 <indexterm><primary>user</primary><secondary>management</secondary></indexterm>
1036                 There is one preparatory step without which you will not have a working Samba 
1037                 network environment. You must add an account for each network user. 
1038                 For each user who needs to be given a Windows Domain account, make an entry in the
1039                 <filename>/etc/passwd</filename> file as well as in the Samba password backend.
1040                 Use the system tool of your choice to create the UNIX system account, and use the Samba
1041                 <command>smbpasswd</command> to create a Domain user account.
1042                 There are a number of tools for user management under UNIX, such as
1043                 <command>useradd</command>, and <command>adduser</command>, as well as a plethora of custom
1044                 tools. You also want to create a home directory for each user.
1045                 You can do this by executing the following steps for each user:
1046 <screen>
1047 &rootprompt; useradd -m <parameter>username</parameter>
1048 &rootprompt; passwd <parameter>username</parameter>
1049 Changing password for <parameter>username</parameter>.
1050 New password: XXXXXXXX
1051 Re-enter new password: XXXXXXXX
1052 Password changed
1053 &rootprompt; smbpasswd -a <parameter>username</parameter>
1054 New SMB password: XXXXXXXX
1055 Retype new SMB password: XXXXXXXX
1056 Added user <parameter>username</parameter>.
1057 </screen>
1058                 You do of course use a valid user login ID in place of <parameter>username</parameter>.
1059                 </para></step>
1061                 <step><para>
1062                 <indexterm><primary>file system</primary><secondary>access control</secondary></indexterm>
1063                 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1064                 <indexterm><primary>group membership</primary></indexterm>
1065                 Using the preferred tool for your UNIX system, add each user to the UNIX groups created
1066                 previously as necessary. File system access control will be based on UNIX group membership.
1067                 </para></step>
1069                 <step><para>
1070                 Create the directory mount point for the disk subsystem that can be mounted to provide
1071                 data storage for company files. In this case the mount point is indicated in the &smb.conf;
1072                 file is <filename>/data</filename>. Format the file system as required, and mount the formatted
1073                 file system partition using appropriate system tools.
1074                 </para></step>
1076                 <step><para>
1077                 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1078                 Create the top-level file storage directories for data and applications as follows:
1079 <screen>
1080 &rootprompt; mkdir -p /data/{accounts,finsrvcs}
1081 &rootprompt; mkdir -p /apps
1082 &rootprompt; chown -R root:root /data
1083 &rootprompt; chown -R root:root /apps
1084 &rootprompt; chown -R bjordan:acctsdep /data/accounts
1085 &rootprompt; chown -R bjordan:finsrvcs /data/finsrvcs
1086 &rootprompt; chmod -R ug+rwxs,o-rwx /data
1087 &rootprompt; chmod -R ug+rwx,o+rx-w /apps
1088 </screen>
1089                 Each department is responsible for creating its own directory structure within the departmental
1090                 share. The directory root of the <command>accounts</command> share is <filename>/data/accounts</filename>.
1091                 The directory root of the <command>finsvcs</command> share is <filename>/data/finsvcs</filename>.
1092                 The <filename>/apps</filename> directory is the root of the <constant>apps</constant> share
1093                 that provides the application server infrastructure.
1094                 </para></step>
1096                 <step><para>
1097                 The &smb.conf; file specifies an infrastructure to support roaming profiles and network
1098                 logon services. You can now create the file system infrastructure to provide the
1099                 locations on disk that these services require. Adequate planning is essential,
1100                 since desktop profiles can grow to be quite large. For planning purposes, a minimum of
1101                 200 MB of storage should be allowed per user for profile storage. The following
1102                 commands create the directory infrastructure needed:
1103 <screen>
1104 &rootprompt; mkdir -p /var/spool/samba 
1105 &rootprompt; mkdir -p /var/lib/samba/{netlogon/scripts,profiles}
1106 &rootprompt; chown -R root:root /var/spool/samba
1107 &rootprompt; chown -R root:root /var/lib/samba
1108 &rootprompt; chmod a+rwxt /var/spool/samba
1109 &rootprompt; chmod 2775 /var/lib/samba/profiles
1110 &rootprompt; chgrp users /var/lib/samba/profiles
1111 </screen>
1112                 For each user account that is created on the system, the following commands should be
1113                 executed:
1114 <screen>
1115 &rootprompt; mkdir /var/lib/samba/profiles/'username'
1116 &rootprompt; chown 'username':users /var/lib/samba/profiles/'username'
1117 &rootprompt; chmod ug+wrx,o+rx,-w /var/lib/samba/profiles/'username'
1118 </screen>
1119                 </para></step>
1121                 <step><para>
1122                 <indexterm><primary>logon scrip</primary></indexterm>
1123                 <indexterm><primary>unix2dos</primary></indexterm>
1124                 <indexterm><primary>dos2unix</primary></indexterm>
1125                 Create a logon script. It is important that each line is correctly terminated with
1126                 a carriage return and line-feed combination (i.e., DOS encoding). The following procedure
1127                 works if the right tools (<constant>unix2dos</constant> and <constant>dos2unix</constant>) are installed.
1128                 First, create a file called <filename>/var/lib/samba/netlogon/scripts/logon.bat.unix</filename>
1129                 with the following contents:
1130 <screen>
1131 net time \\diamond /set /yes
1132 net use h: /home
1133 net use p: \\diamond\apps
1134 </screen>
1135                 Convert the UNIX file to a DOS file using the <command>unix2dos</command> as shown here:
1136 <screen>
1137 &rootprompt; unix2dos &lt; /var/lib/samba/netlogon/scripts/logon.bat.unix \
1138         &gt; /var/lib/samba/netlogon/scripts/logon.bat
1139 </screen>
1140                 </para></step>
1141         </procedure>
1143         </sect2>
1145         <sect2 id="ch4dhcpdns">
1146         <title>Configuration of DHCP and DNS Servers</title>
1148         <para>
1149         DHCP services are a basic component of the entire network client installation. DNS operation is
1150         foundational to Internet access as well as to trouble-free operation of local networking. When
1151         you have completed this section, the server should be ready for solid duty operation.
1152         </para>
1154         <procedure>
1155         <title>DHCP and DNS Server Configuration Steps</title>
1157                 <step><para>
1158                 <indexterm><primary>/etc/dhcpd.conf</primary></indexterm>
1159                 Create a file called <filename>/etc/dhcpd.conf</filename> with the contents as
1160                 shown in <link linkend="prom-dhcp"/>.
1162 <example id="prom-dhcp">
1163 <title>DHCP Server Configuration File &smbmdash; <filename>/etc/dhcpd.conf</filename></title>
1164 <screen>
1165 # Abmas Accounting Inc.
1166 default-lease-time 86400;
1167 max-lease-time 172800;
1168 default-lease-time 86400;
1169 option ntp-servers 192.168.1.1;
1170 option domain-name "abmas.biz";
1171 option domain-name-servers 192.168.1.1, 192.168.2.1;
1172 option netbios-name-servers 192.168.1.1, 192.168.2.1;
1173 option netbios-node-type 8;       ### Node type = Hybrid ###
1174 ddns-updates on;                  ### Dynamic DNS enabled ###
1175 ddns-update-style interim;
1177 subnet 192.168.1.0 netmask 255.255.255.0 {
1178         range dynamic-bootp 192.168.1.128 192.168.1.254;
1179         option subnet-mask 255.255.255.0;
1180         option routers 192.168.1.1;
1181         allow unknown-clients;
1182         host qmsa {
1183                 hardware ethernet 08:00:46:7a:35:e4;
1184                 fixed-address 192.168.1.20;
1185                 }
1186         host hplj6a {
1187                 hardware ethernet 00:03:47:cb:81:e0;
1188                 fixed-address 192.168.1.30;
1189                 }
1190         }
1191 subnet 192.168.2.0 netmask 255.255.255.0 {
1192         range dynamic-bootp 192.168.2.128 192.168.2.254;
1193         option subnet-mask 255.255.255.0;
1194         option routers 192.168.2.1;
1195         allow unknown-clients;
1196         host qmsf {
1197                 hardware ethernet 01:04:31:db:e1:c0;
1198                 fixed-address 192.168.1.20;
1199                 }
1200         host hplj6f {
1201                 hardware ethernet 00:03:47:cf:83:e2;
1202                 fixed-address 192.168.2.30;
1203                 }
1204         }
1205 subnet 127.0.0.0 netmask 255.0.0.0 {
1206         }
1207 subnet 123.45.67.64 netmask 255.255.255.252 {
1208         }
1209 </screen>
1210 </example>
1211                 </para></step>
1213                 <step><para>
1214                 <indexterm><primary>/etc/named.conf</primary></indexterm>
1215                 Create a file called <filename>/etc/named.conf</filename> that has the combined contents
1216                 of the <link linkend="ch4namedcfg"/>, <link linkend="ch4namedvarfwd"/>, and
1217                 <link linkend="ch4namedvarrev"/> files that are concatenated (merged) in this
1218                 specific order.
1219                 </para></step>
1221                 <step><para>
1222                 Create the files shown in their respective directories as shown in <link linkend="namedrscfiles">DNS
1223                 (named) Resource Files</link>.
1225                         <table id="namedrscfiles">
1226                                 <title>DNS (named) Resource Files</title>
1227                                 <tgroup cols="2">
1228                                         <colspec align="left"/>
1229                                         <colspec align="left"/>
1230                                         <thead>
1231                                                 <row>
1232                                                         <entry>Reference</entry>
1233                                                         <entry>File Location</entry>
1234                                                 </row>
1235                                         </thead>
1236                                         <tbody>
1237                                                 <row>
1238                                                         <entry><link linkend="loopback"/></entry>
1239                                                         <entry>/var/lib/named/localhost.zone</entry>
1240                                                 </row>
1241                                                 <row>
1242                                                         <entry><link linkend="dnsloopy"/></entry>
1243                                                         <entry>/var/lib/named/127.0.0.zone</entry>
1244                                                 </row>
1245                                                 <row>
1246                                                         <entry><link linkend="roothint"/></entry>
1247                                                         <entry>/var/lib/named/root.hint</entry>
1248                                                 </row>
1249                                                 <row>
1250                                                         <entry><link linkend="abmasbiz"/></entry>
1251                                                         <entry>/var/lib/named/master/abmas.biz.hosts</entry>
1252                                                 </row>
1253                                                 <row>
1254                                                         <entry><link linkend="abmasus"/></entry>
1255                                                         <entry>/var/lib/named/abmas.us.hosts</entry>
1256                                                 </row>
1257                                                 <row>
1258                                                         <entry><link linkend="eth1zone"/></entry>
1259                                                         <entry>/var/lib/named/192.168.1.0.rev</entry>
1260                                                 </row>
1261                                                 <row>
1262                                                         <entry><link linkend="eth2zone"/></entry>
1263                                                         <entry>/var/lib/named/192.168.2.0.rev</entry>
1264                                                 </row>
1265                                         </tbody>
1266                                 </tgroup>
1267                         </table>
1269 <example id="ch4namedcfg">
1270 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Master Section</title>
1271 <indexterm><primary>/etc/named.conf</primary></indexterm>
1272 <screen>
1274 # Abmas Biz DNS Control File
1276 # Date: November 15, 2003
1278 options {
1279         directory "/var/lib/named";
1280         forwarders {
1281                 123.45.12.23;
1282                 };
1283         forward first;
1284         listen-on {
1285                 mynet;
1286                 };
1287         auth-nxdomain yes;
1288         multiple-cnames yes;
1289         notify no;
1292 zone "." in {
1293         type hint;
1294         file "root.hint";
1297 zone "localhost" in {
1298         type master;
1299         file "localhost.zone";
1302 zone "0.0.127.in-addr.arpa" in {
1303         type master;
1304         file "127.0.0.zone";
1307 acl mynet {
1308         192.168.1.0/24;
1309         192.168.2.0/24;
1310         127.0.0.1;
1313 acl seconddns {
1314         123.45.54.32;
1317 </screen>
1318 </example>
1320 <example id="ch4namedvarfwd">
1321 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Forward Lookup Definition Section</title>
1322 <screen>
1323 zone "abmas.biz" {
1324         type master;
1325         file "/var/lib/named/master/abmas.biz.hosts";
1326         allow-query {
1327                 mynet;
1328         };
1329         allow-transfer {
1330                 mynet;
1331         };
1332         allow-update {
1333                 mynet;
1334         };
1337 zone "abmas.us" {
1338         type master;
1339         file "/var/lib/named/master/abmas.us.hosts";
1340         allow-query {
1341                 any;
1342         };
1343         allow-transfer {
1344                 seconddns;
1345         };
1347 </screen>
1348 </example>
1350 <example id="ch4namedvarrev">
1351 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Reverse Lookup Definition Section</title>
1352 <screen>
1353 zone "1.168.192.in-addr.arpa" {
1354         type master;
1355         file "/var/lib/named/master/192.168.1.0.rev";
1356         allow-query {
1357                 mynet;
1358         };
1359         allow-transfer {
1360                 mynet;
1361         };
1362         allow-update {
1363                 mynet;
1364         };
1367 zone "2.168.192.in-addr.arpa" {
1368         type master;
1369         file "/var/lib/named/master/192.168.2.0.rev";
1370         allow-query {
1371                 mynet;
1372         };
1373         allow-transfer {
1374                 mynet;
1375         };
1376         allow-update {
1377                 mynet;
1378         };
1380 </screen>
1381 </example>
1383 <example id="eth1zone">
1384 <title>DNS 192.168.1 Reverse Zone File</title>
1385 <screen>
1386 $ORIGIN .
1387 $TTL 38400      ; 10 hours 40 minutes
1388 1.168.192.in-addr.arpa  IN SOA  sleeth.abmas.biz. root.abmas.biz. (
1389                                 2003021825 ; serial
1390                                 10800      ; refresh (3 hours)
1391                                 3600       ; retry (1 hour)
1392                                 604800     ; expire (1 week)
1393                                 38400      ; minimum (10 hours 40 minutes)
1394                                 )
1395                         NS      sleeth1.abmas.biz.
1396 $ORIGIN 1.168.192.in-addr.arpa.
1397 1                       PTR     sleeth1.abmas.biz.
1398 20                      PTR     qmsa.abmas.biz.
1399 30                      PTR     hplj6a.abmas.biz.
1400 </screen>
1401 </example>
1403 <example id="eth2zone">
1404 <title>DNS 192.168.2 Reverse Zone File</title>
1405 <screen>
1406 $ORIGIN .
1407 $TTL 38400      ; 10 hours 40 minutes
1408 2.168.192.in-addr.arpa  IN SOA  sleeth.abmas.biz. root.abmas.biz. (
1409                                 2003021825 ; serial
1410                                 10800      ; refresh (3 hours)
1411                                 3600       ; retry (1 hour)
1412                                 604800     ; expire (1 week)
1413                                 38400      ; minimum (10 hours 40 minutes)
1414                                 )
1415                         NS      sleeth2.abmas.biz.
1416 $ORIGIN 2.168.192.in-addr.arpa.
1417 1                       PTR     sleeth2.abmas.biz.
1418 20                      PTR     qmsf.abmas.biz.
1419 30                      PTR     hplj6f.abmas.biz.
1420 </screen>
1421 </example>
1423 <example id="abmasbiz">
1424 <title>DNS Abmas.biz Forward Zone File</title>
1425 <screen>
1426 $ORIGIN .
1427 $TTL 38400      ; 10 hours 40 minutes
1428 abmas.biz       IN SOA  sleeth1.abmas.biz. root.abmas.biz. (
1429                                 2003021833 ; serial
1430                                 10800      ; refresh (3 hours)
1431                                 3600       ; retry (1 hour)
1432                                 604800     ; expire (1 week)
1433                                 38400      ; minimum (10 hours 40 minutes)
1434                                 )
1435                         NS      dns.abmas.biz.
1436                         MX      10 mail.abmas.biz.
1437 $ORIGIN abmas.biz.
1438 sleeth1                 A       192.168.1.1
1439 sleeth2                 A       192.168.2.1
1440 qmsa                    A       192.168.1.20
1441 hplj6a                  A       192.168.1.30
1442 qmsf                    A       192.168.2.20
1443 hplj6f                  A       192.168.2.30
1444 dns                     CNAME   sleeth1
1445 diamond                 CNAME   sleeth1
1446 mail                    CNAME   sleeth1
1447 </screen>
1448 </example>
1450 <example id="abmasus">
1451 <title>DNS Abmas.us Forward Zone File</title>
1452 <screen>
1453 $ORIGIN .
1454 $TTL 38400      ; 10 hours 40 minutes
1455 abmas.us        IN SOA  server.abmas.us. root.abmas.us. (
1456                                 2003021833 ; serial
1457                                 10800      ; refresh (3 hours)
1458                                 3600       ; retry (1 hour)
1459                                 604800     ; expire (1 week)
1460                                 38400      ; minimum (10 hours 40 minutes)
1461                                 )
1462                         NS      dns.abmas.us.
1463                         NS      dns2.abmas.us.
1464                         MX      10 mail.abmas.us.
1465 $ORIGIN abmas.us.
1466 server                  A       123.45.67.66
1467 dns2                    A       123.45.54.32
1468 gw                      A       123.45.67.65
1469 www                     CNAME   server
1470 mail                    CNAME   server
1471 dns                     CNAME   server
1472 </screen>
1473 </example>
1475                 </para></step>
1477                 <step><para>
1478               <indexterm><primary>/etc/resolv.conf</primary></indexterm><indexterm>
1479                 <primary>name resolution</primary>
1480               </indexterm>
1481                 All DNS name resolution should be handled locally. To ensure that the server is configured
1482                 correctly to handle this, edit <filename>/etc/resolv.conf</filename> to have the following
1483                 content:
1484 <screen>
1485 search abmas.us abmas.biz
1486 nameserver 127.0.0.1
1487 nameserver 123.45.54.23
1488 </screen>
1489               <indexterm>
1490                 <primary>DNS server</primary>
1491               </indexterm>
1492                 This instructs the name resolver function (when configured correctly) to ask the DNS server
1493                 that is running locally to resolve names to addresses. In the event that the local name server
1494                 is not available, ask the name server provided by the ISP. The latter, of course, does not resolve
1495                 purely local names to IP addresses.
1496                 </para></step>
1498                 <step><para>
1499                 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1500                 The final step is to edit the <filename>/etc/nsswitch.conf</filename> file.
1501                 This file controls the operation of the various resolver libraries that are part of the Linux
1502                 Glibc libraries. Edit this file so that it contains the following entries:
1503 <screen>
1504 hosts:      files dns wins
1505 </screen>
1506                 </para></step>
1507         </procedure>
1509         <para>
1510         The basic DHCP and DNS services are now ready for validation testing. Before you can proceed,
1511         there are a few more steps along the road. First, configure the print spooling and print
1512         processing system.  Then you can configure the server so that all services
1513         start automatically on reboot. You must also manually start all services prior to validation testing.
1514         </para>
1516         </sect2>
1518         <sect2 id="ch4ptrcfg">
1519         <title>Printer Configuration</title>
1521         <para>
1522         Network administrators who are new to CUPS based-printing typically experience some difficulty mastering
1523         its powerful features. The steps outlined in this section are designed to navigate around the distractions
1524         of learning CUPS. Instead of implementing smart features and capabilities, our approach is to use it as a
1525         transparent print queue that performs no filtering, and only minimal handling of each print job that is
1526         submitted to it. In other words, our configuration turns CUPS into a raw-mode print queue. This means that
1527         the correct printer driver must be installed on all clients.
1528         </para>
1530         <procedure>
1531         <title>Printer Configuration Steps</title>
1533                 <step><para>
1534                 Configure each printer to be a DHCP client, carefully following the manufacturer's guidelines.
1535                 </para></step>
1537                 <step><para>
1538                 Follow the instructions in the printer manufacturer's manuals to permit printing to port 9100.
1539                 Use any other port the manufacturer specifies for direct-mode raw printing, and adjust the
1540                 port as necessary in the following example commands.
1541                 This allows the CUPS spooler to print using raw mode protocols.
1542                 <indexterm><primary>CUPS</primary></indexterm>
1543                 <indexterm><primary>raw printing</primary></indexterm>
1544                 </para></step>
1546                 <step><para>
1547               <indexterm><primary>CUPS</primary><secondary>queue</secondary></indexterm><indexterm>
1548                 <primary>lpadmin</primary>
1549               </indexterm>
1550                 Configure the CUPS Print Queues as follows:
1551 <screen>
1552 &rootprompt; lpadmin -p qmsa -v socket://qmsa.abmas.biz:9100 -E
1553 &rootprompt; lpadmin -p hplj6a -v socket://hplj6a.abmas.biz:9100 -E
1554 &rootprompt; lpadmin -p qmsf -v socket://qmsf.abmas.biz:9100 -E
1555 &rootprompt; lpadmin -p hplj6f -v socket://hplj6f.abmas.biz:9100 -E
1556 </screen>
1557                 <indexterm><primary>print filter</primary></indexterm>
1558                 This creates the necessary print queues with no assigned print filter.
1559                 </para></step>
1561           <step><para><indexterm>
1562                 <primary>enable</primary>
1563               </indexterm>
1564                 Print queues may not be enabled at creation. Use <command>lpc stat</command> to check
1565                 the status of the print queues and, if necessary, make certain that the queues you have 
1566                 just created are enabled by executing the following:
1567 <screen>
1568 &rootprompt; /usr/bin/enable qmsa
1569 &rootprompt; /usr/bin/enable hplj6a
1570 &rootprompt; /usr/bin/enable qmsf
1571 &rootprompt; /usr/bin/enable hplj6f
1572 </screen>
1573                 </para></step>
1575           <step><para><indexterm>
1576                 <primary>accept</primary>
1577               </indexterm>
1578                 Even though your print queues may be enabled, it is still possible that they
1579                 are not accepting print jobs. A print queue services incoming printing
1580                 requests only when configured to do so. Ensure that your print queues are
1581                 set to accept incoming jobs by executing the following commands:
1582 <screen>
1583 &rootprompt; /usr/sbin/accept qmsa
1584 &rootprompt; /usr/sbin/accept hplj6a
1585 &rootprompt; /usr/sbin/accept qmsf
1586 &rootprompt; /usr/sbin/accept hplj6f
1587 </screen>
1588                 </para></step>
1590                 <step><para>
1591                 <indexterm><primary>mime type</primary></indexterm>
1592                 <indexterm><primary>/etc/mime.convs</primary></indexterm>
1593                 <indexterm><primary>application/octet-stream</primary></indexterm>
1594                 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
1595 <screen>
1596 application/octet-stream     application/vnd.cups-raw      0     -
1597 </screen>
1598                 </para></step>
1600                 <step><para>
1601                 <indexterm><primary>/etc/mime.types</primary></indexterm>
1602                 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
1603 <screen>
1604 application/octet-stream
1605 </screen>
1606                 </para></step>
1608                 <step><para>
1609                 Printing drivers are installed on each network client workstation.
1610                 </para></step>
1611         </procedure>
1613         <para>
1614         Note: If the parameter <parameter>cups options = Raw</parameter> is specified in the &smb.conf; file,
1615         the last two steps can be omitted with CUPS version 1.1.18, or later.
1616         </para>
1618         <para>
1619         The UNIX system print queues have been configured and are ready for validation testing.
1620         </para>
1622         </sect2>
1624         <sect2 id="procstart">
1625         <title>Process Startup Configuration</title>
1627         <para>
1628         <indexterm><primary>chkconfig</primary></indexterm>
1629         There are two essential steps to process startup configuration. First, the process
1630         must be configured so that it automatically restarts each time the server
1631         is rebooted. This step involves use of the <command>chkconfig</command> tool that
1632         creates the appropriate symbolic links from the master daemon control file that is
1633         located in the <filename>/etc/rc.d</filename> directory, to the <filename>/etc/rc'x'.d</filename>
1634         directories. Links are created so that when the system run level is changed, the
1635         necessary start or kill script is run.
1636         </para>
1638         <para>
1639         <indexterm><primary>/etc/xinetd.d</primary></indexterm>
1640         <indexterm><primary>inetd</primary></indexterm>
1641         <indexterm><primary>xinetd</primary></indexterm>
1642         <indexterm><primary>chkconfig</primary></indexterm>
1643         <indexterm><primary>super daemon</primary></indexterm>
1644         In the event that a service is not run as a daemon, but via the internetworking
1645         super daemon (<command>inetd</command> or <command>xinetd</command>), then the <command>chkconfig</command>
1646         tool makes the necessary entries in the <filename>/etc/xinetd.d</filename> directory
1647         and sends a hang-up (HUP) signal to the the super daemon, thus forcing it to
1648         re-read its control files.
1649         </para>
1651         <para>
1652         Last, each service must be started to permit system validation to proceed.
1653         </para>
1655         <procedure>
1656                 <step><para>
1657                 Use the standard system tool to configure each service to restart
1658                 automatically at every system reboot. For example,
1659                 <indexterm><primary>chkconfig</primary></indexterm>
1660 <screen>
1661 &rootprompt; chkconfig dhpcd on
1662 &rootprompt; chkconfig named on
1663 &rootprompt; chkconfig cups on
1664 &rootprompt; chkconfig smb on
1665 </screen>
1666                 </para></step>
1668                 <step><para>
1669                 <indexterm><primary>starting dhcpd</primary></indexterm>
1670                 <indexterm><primary>starting samba</primary></indexterm>
1671                 <indexterm><primary>starting CUPS</primary></indexterm>
1672                 Now start each service to permit the system to be validated.
1673                 Execute each of the following in the sequence shown:
1675 <screen>
1676 &rootprompt; /etc/rc.d/init.d/dhcpd restart
1677 &rootprompt; /etc/rc.d/init.d/named restart
1678 &rootprompt; /etc/rc.d/init.d/cups restart
1679 &rootprompt; /etc/rc.d/init.d/smb restart
1680 </screen>
1681                 </para></step>
1682         </procedure>
1684         </sect2>
1686         <sect2 id="ch4valid">
1687         <title>Validation</title>
1689         <para>
1690         <indexterm><primary>validation</primary></indexterm>
1691         Complex networking problems are most often caused by simple things that are poorly or incorrectly
1692         configured. The validation process adopted here should be followed carefully; it is the result of the
1693         experience gained from years of making and correcting the most common mistakes. Shortcuts often lead to basic errors. You should
1694         refrain from taking shortcuts, from making basic assumptions, and from not exercising due process
1695         and diligence in network validation. By thoroughly testing and validating every step in the process
1696         of network installation and configuration, you can save yourself from sleepless nights and restless
1697         days. A well debugged network is a foundation for happy network users and network administrators. 
1698         Later in this book you learn how to make users happier. For now, it is enough to learn to 
1699         validate. Let's get on with it.
1700         </para>
1702                 <procedure>
1703                 <title>Server Validation Steps</title>
1705                         <step><para>
1706                         <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1707                         One of the most important facets of Samba configuration is to ensure that
1708                         name resolution functions correctly. You can check name resolution
1709                         with a few simple tests. The most basic name resolution is provided from the
1710                         <filename>/etc/hosts</filename> file. To test its operation, make a
1711                         temporary edit to the <filename>/etc/nsswitch.conf</filename> file. Using
1712                         your favorite editor, change the entry for <constant>hosts</constant> to read:
1713 <screen>
1714 hosts:     files
1715 </screen>
1716                         When you have saved this file, execute the following command:
1717 <screen>
1718 &rootprompt; ping diamond
1719 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1720 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.131 ms
1721 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.179 ms
1722 64 bytes from sleeth1 (192.168.1.1): icmp_seq=3 ttl=64 time=0.192 ms
1723 64 bytes from sleeth1 (192.168.1.1): icmp_seq=4 ttl=64 time=0.191 ms
1725 --- sleeth1.abmas.biz ping statistics ---
1726 4 packets transmitted, 4 received, 0% packet loss, time 3016ms
1727 rtt min/avg/max/mdev = 0.131/0.173/0.192/0.026 ms
1728 </screen>
1729                         This proves that name resolution via the <filename>/etc/hosts</filename> file
1730                         is working.
1731                         </para></step>
1733                         <step><para>
1734                         <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1735                         So far, your installation is going particularly well. In this step we validate
1736                         DNS server and name resolution operation. Using your favorite UNIX system editor,
1737                         change the <filename>/etc/nsswitch.conf</filename> file so that the
1738                         <constant>hosts</constant> entry reads:
1739 <screen>
1740 hosts:        dns
1741 </screen>
1742                         </para></step>
1744                         <step><para>
1745                         <indexterm><primary>named</primary></indexterm>
1746                         Before you test DNS operation, it is a good idea to verify that the DNS server
1747                         is running by executing the following:
1748 <screen>
1749 &rootprompt; ps ax | grep named
1750   437 ?        S      0:00 /sbin/syslogd -a /var/lib/named/dev/log
1751   524 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1752   525 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1753   526 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1754   529 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1755   540 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1756  2552 pts/2    S      0:00 grep named
1757 </screen>
1758                         This means that we are ready to check DNS operation. Do so by executing:
1759                         <indexterm><primary>ping</primary></indexterm>
1760 <screen>
1761 &rootprompt; ping diamond
1762 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1763 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.156 ms
1764 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.183 ms
1766 --- sleeth1.abmas.biz ping statistics ---
1767 2 packets transmitted, 2 received, 0% packet loss, time 999ms
1768 rtt min/avg/max/mdev = 0.156/0.169/0.183/0.018 ms
1769 </screen>
1770                         You should take a few more steps to validate DNS server operation, as follows:
1771 <screen>
1772 &rootprompt; host -f diamond.abmas.biz
1773 sleeth1.abmas.biz has address 192.168.1.1
1774 </screen>
1775                         <indexterm><primary>/etc/hosts</primary></indexterm>
1776                         You may now remove the entry called <constant>diamond</constant> from the
1777                         <filename>/etc/hosts</filename> file. It does not hurt to leave it there,
1778                         but its removal reduces the number of administrative steps for this name.
1779                         </para></step>
1781                         <step><para>
1782                         <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1783                         WINS is a great way to resolve NetBIOS names to their IP address. You can test
1784                         the operation of WINS by starting <command>nmbd</command> (manually or by way
1785                         of the Samba startup method shown in <link linkend="procstart"/>). You must edit
1786                         the <filename>/etc/nsswitch.conf</filename> file so that the <constant>hosts</constant>
1787                         entry is as follows:
1788 <screen>
1789 hosts:        wins
1790 </screen>
1791                         The next step is to make certain that Samba is running using <command>ps ax | grep mbd</command>.
1792                         The <command>nmbd</command> daemon will provide the WINS name resolution service when the
1793                         &smb.conf; file <smbconfsection name="global"/> parameter <smbconfoption name="wins
1794                         support">Yes</smbconfoption> has been specified.  Having validated that Samba is operational,
1795                         excute the following:
1796 <screen>
1797 &rootprompt; ping diamond
1798 PING diamond (192.168.1.1) 56(84) bytes of data.
1799 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.094 ms
1800 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.479 ms
1801 </screen>
1802                         <indexterm><primary>ping</primary></indexterm>
1803                         Now that you can relax with the knowledge that all three major forms of name
1804                         resolution to IP address resolution are working, edit the <filename>/etc/nsswitch.conf</filename>
1805                         again. This time you add all three forms of name resolution to this file.
1806                         Your edited entry for <constant>hosts</constant> should now look like this:
1807 <screen>
1808 hosts:       files dns wins
1809 </screen>
1810                         The system is looking good. Let's move on.
1811                         </para></step>
1813                         <step><para>
1814                         It would give you peace of mind to know that the DHCP server is running
1815                         and available for service. You can validate DHCP services by running:
1817 <screen>
1818 &rootprompt; ps ax | grep dhcp
1819  2618 ?        S      0:00 /usr/sbin/dhcpd ...
1820  8180 pts/2    S      0:00 grep dhcp
1821 </screen>
1822                         This shows that the server is running. The proof of whether or not it is working
1823                         comes when you try to add the first DHCP client to the network.
1824                         </para></step>
1826                         <step><para>
1827                         <indexterm><primary>testparm</primary></indexterm>
1828                         This is a good point at which to start validating Samba operation. You are 
1829                         content that name resolution is working for basic TCP/IP needs. Let's move on.
1830                         If your &smb.conf; file has bogus options or parameters, this may cause Samba
1831                         to refuse to start. The first step should always be to validate the contents
1832                         of this file by running:
1833 <screen>
1834 &rootprompt; testparm -s
1835 Load smb config files from smb.conf
1836 Processing section "[homes]"
1837 Processing section "[printers]"
1838 Processing section "[netlogon]"
1839 Processing section "[profiles]"
1840 Processing section "[accounts]"
1841 Processing section "[service]"
1842 Processing section "[apps]"
1843 Loaded services file OK.
1844 # Global parameters
1845 [global]
1846     workgroup = PROMISES
1847     netbios name = DIAMOND
1848     interfaces = eth1, eth2, lo
1849     bind interfaces only = Yes
1850     passdb backend = tdbsam
1851     pam password change = Yes
1852     passwd program = /usr/bin/passwd '%u'
1853     passwd chat = *New*Password* %n\n \
1854              *Re-enter*new*password* %n\n *Password*changed*
1855     username map = /etc/samba/smbusers
1856     unix password sync = Yes
1857     log level = 1
1858     syslog = 0
1859     log file = /var/log/samba/%m
1860     max log size = 50
1861     smb ports = 139
1862     name resolve order = wins bcast hosts
1863     time server = Yes
1864     printcap name = CUPS
1865     show add printer wizard = No
1866     add user script = /usr/sbin/useradd -m '%u'
1867     delete user script = /usr/sbin/userdel -r '%u'
1868     add group script = /usr/sbin/groupadd '%g'
1869     delete group script = /usr/sbin/groupdel '%g'
1870     add user to group script = /usr/sbin/usermod -G '%g' '%u'
1871     add machine script = /usr/sbin/useradd \
1872                               -s /bin/false -d /dev/null '%u'
1873     shutdown script = /var/lib/samba/scripts/shutdown.sh
1874     abort shutdown script = /sbin/shutdown -c
1875     logon script = scripts\logon.bat
1876     logon path = \\%L\profiles\%U
1877     logon drive = X:
1878     logon home = \\%L\%U
1879     domain logons = Yes
1880     preferred master = Yes
1881     wins support = Yes
1882     utmp = Yes
1883     winbind use default domain = Yes
1884     map acl inherit = Yes
1885     cups options = Raw
1886     veto files = /*.eml/*.nws/*.{*}/
1887     veto oplock files = /*.doc/*.xls/*.mdb/
1889 [homes]
1890     comment = Home Directories
1891     valid users = %S
1892     read only = No
1893     browseable = No
1895 ### Remainder cut to save space ###
1896 </screen>
1897                         Clear away all errors before proceeding.
1898                         </para></step>
1900                         <step><para>
1901                         <indexterm><primary>check samba daemons</primary></indexterm>
1902                         <indexterm><primary>smbd</primary></indexterm>
1903                         <indexterm><primary>nmbd</primary></indexterm>
1904                         <indexterm><primary>winbindd</primary></indexterm>
1905                         Check that the Samba server is running:
1906 <screen>
1907 &rootprompt; ps ax | grep mbd
1908 14244 ?        S      0:00 /usr/sbin/nmbd -D
1909 14245 ?        S      0:00 /usr/sbin/nmbd -D
1910 14290 ?        S      0:00 /usr/sbin/smbd -D
1912 $rootprompt; ps ax | grep winbind
1913 14293 ?        S     0:00 /usr/sbin/winbindd -D
1914 14295 ?        S     0:00 /usr/sbin/winbindd -D
1915 </screen>
1916                         The <command>winbindd</command> daemon is running in split mode (normal), so there are also
1917                         two instances<footnote><para>For more information regarding winbindd, see <emphasis>TOSHARG2</emphasis>, 
1918                         Chapter 23, Section 23.3. The single instance of <command>smbd</command> is normal. One additional
1919                         <command>smbd</command> slave process is spawned for each SMB/CIFS client 
1920                         connection.</para></footnote> of it.
1921                         </para></step>
1922         
1923                         <step><para>
1924                         <indexterm><primary>anonymous
1925                   connection</primary></indexterm>
1926               <indexterm>
1927                 <primary>smbclient</primary>
1928               </indexterm>
1929                         Check that an anonymous connection can be made to the Samba server:
1930 <screen>
1931 &rootprompt; smbclient -L localhost -U%
1933         Sharename      Type      Comment
1934         ---------      ----      -------
1935         IPC$           IPC       IPC Service (Samba 3.0.20)
1936         netlogon       Disk      Network Logon Service
1937         profiles       Disk      Profile Share
1938         accounts       Disk      Accounting Files
1939         service        Disk      Financial Services Files
1940         apps           Disk      Application Files
1941         ADMIN$         IPC       IPC Service (Samba 3.0.20)
1942         hplj6a         Printer   hplj6a
1943         hplj6f         Printer   hplj6f
1944         qmsa           Printer   qmsa
1945         qmsf           Printer   qmsf
1947         Server               Comment
1948         ---------            -------
1949         DIAMOND              Samba 3.0.20
1951         Workgroup            Master
1952         ---------            -------
1953         PROMISES             DIAMOND
1954 </screen>
1955                         This demonstrates that an anonymous listing of shares can be obtained. This is the equivalent
1956                         of browsing the server from a Windows client to obtain a list of shares on the server.
1957                         The <constant>-U%</constant> argument means to send a <constant>NULL</constant> username and
1958                         a <constant>NULL</constant> password.
1959                         </para></step>
1961                         <step><para>
1962                         <indexterm><primary>dhcp client validation</primary></indexterm>
1963                         <indexterm><primary>printer validation</primary></indexterm>
1964                         <indexterm><primary>arp</primary></indexterm>
1965                         Verify that each printer has the IP address assigned in the DHCP server configuration file.
1966                         The easiest way to do this is to ping the printer name. Immediately after the ping response
1967                         has been received, execute <command>arp -a</command> to find the MAC address of the printer
1968                         that has responded. Now you can compare the IP address and the MAC address of the printer
1969                         with the configuration information in the <filename>/etc/dhcpd.conf</filename> file. They
1970                         should, of course, match. For example,
1971 <screen>
1972 &rootprompt; ping hplj6
1973 PING hplj6a (192.168.1.30) 56(84) bytes of data.
1974 64 bytes from hplj6a (192.168.1.30): icmp_seq=1 ttl=64 time=0.113 ms
1976 &rootprompt; arp -a
1977 hplj6a (192.168.1.30) at 00:03:47:CB:81:E0 [ether] on eth0
1978 </screen>
1979               <indexterm>
1980                 <primary>/etc/dhcpd.conf</primary>
1981               </indexterm>
1982                         The MAC address <constant>00:03:47:CB:81:E0</constant> matches that specified for the
1983                         IP address from which the printer has responded and with the entry for it in the
1984                         <filename>/etc/dhcpd.conf</filename> file. Repeat this for each printer configured.
1985                         </para></step>
1986         
1987                         <step><para>
1988                         <indexterm><primary>authenticated connection</primary></indexterm>
1989                         Make an authenticated connection to the server using the <command>smbclient</command> tool:
1990 <screen>
1991 &rootprompt; smbclient //diamond/accounts -U gholmes
1992 Password: XXXXXXX
1993 smb: \> dir
1994   .                          D        0  Thu Nov 27 15:07:09 2003
1995   ..                         D        0  Sat Nov 15 17:40:50 2003
1996   zakadmin.exe                   161424  Thu Nov 27 15:06:52 2003
1997   zak.exe                       6066384  Thu Nov 27 15:06:52 2003
1998   dhcpd.conf                       1256  Thu Nov 27 15:06:52 2003
1999   smb.conf                         2131  Thu Nov 27 15:06:52 2003
2000   initGrps.sh                A     1089  Thu Nov 27 15:06:52 2003
2001   POLICY.EXE                      86542  Thu Nov 27 15:06:52 2003
2003                 55974 blocks of size 65536. 33968 blocks available
2004 smb: \> q
2005 </screen>
2006                         </para></step>
2008                         <step><para>
2009                         <indexterm><primary>nmap</primary></indexterm>
2010                         Your new server is connected to an Internet-accessible connection. Before you start
2011                         your firewall, you should run a port scanner against your system. You should repeat that
2012                         after the firewall has been started. This helps you understand to what extent the
2013                         server may be vulnerable to external attack. One way you can do this is by using an
2014                         external service, such as the <ulink url="http://www.dslreports.com/scan">DSL Reports</ulink> 
2015                         tools. Alternately, if you can gain root-level access to a remote
2016                         UNIX/Linux system that has the <command>nmap</command> tool, you can run the following:
2017 <screen>
2018 &rootprompt; nmap -v -sT server.abmas.us
2020 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2021 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2022 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2023 Adding open port 6000/tcp
2024 Adding open port 873/tcp
2025 Adding open port 445/tcp
2026 Adding open port 10000/tcp
2027 Adding open port 901/tcp
2028 Adding open port 631/tcp
2029 Adding open port 25/tcp
2030 Adding open port 111/tcp
2031 Adding open port 32770/tcp
2032 Adding open port 3128/tcp
2033 Adding open port 53/tcp
2034 Adding open port 80/tcp
2035 Adding open port 443/tcp
2036 Adding open port 139/tcp
2037 Adding open port 22/tcp
2038 The Connect() Scan took 0 seconds to scan 1601 ports.
2039 Interesting ports on server.abmas.us (123.45.67.66):
2040 (The 1587 ports scanned but not shown below are in state: closed)
2041 Port       State       Service
2042 22/tcp     open        ssh
2043 25/tcp     open        smtp
2044 53/tcp     open        domain
2045 80/tcp     open        http
2046 111/tcp    open        sunrpc
2047 139/tcp    open        netbios-ssn
2048 443/tcp    open        https
2049 445/tcp    open        microsoft-ds
2050 631/tcp    open        ipp
2051 873/tcp    open        rsync
2052 901/tcp    open        samba-swat
2053 3128/tcp   open        squid-http
2054 6000/tcp   open        X11
2055 10000/tcp  open        snet-sensor-mgmt
2056 32770/tcp  open        sometimes-rpc3
2058 Nmap run completed -- 1 IP address (1 host up) scanned in 1 second
2059 </screen>
2060                         The above scan was run before the external interface was locked down with the NAT-firewall
2061                         script you created above. The following results are obtained after the firewall rules
2062                         have been put into place:
2063 <screen>
2064 &rootprompt; nmap -v -sT server.abmas.us
2066 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2067 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2068 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2069 Adding open port 53/tcp
2070 Adding open port 22/tcp
2071 The Connect() Scan took 168 seconds to scan 1601 ports.
2072 Interesting ports on server.abmas.us (123.45.67.66):
2073 (The 1593 ports scanned but not shown below are in state: filtered)
2074 Port       State       Service
2075 22/tcp     open        ssh
2076 25/tcp     closed      smtp
2077 53/tcp     open        domain
2078 80/tcp     closed      http
2079 443/tcp    closed      https
2081 Nmap run completed -- 1 IP address (1 host up) scanned in 168 seconds
2082 </screen>
2083                         </para></step>
2084         
2085                 </procedure>
2087         </sect2>
2089         <sect2 id="ch4appscfg">
2090         <title>Application Share Configuration</title>
2092         <para>
2093         <indexterm><primary>application server</primary></indexterm>
2094         <indexterm><primary>administrative installation</primary></indexterm>
2095         The use of an application server is a key mechanism by which desktop administration overheads
2096         can be reduced. Check the application manual for your software to identify how best to
2097         create an administrative installation.
2098         </para>
2100         <para>
2101         Some Windows software will only run locally on the desktop computer. Such software
2102         is typically not suited for administrative installation. Administratively installed software
2103         permits one or more of the following installation choices:
2104         </para>
2106         <itemizedlist>
2107                 <listitem><para>
2108                 Install software fully onto a workstation, storing data files on the same workstation.
2109                 </para></listitem>
2111                 <listitem><para>
2112                 Install software fully onto a workstation with central network data file storage.
2113                 </para></listitem>
2115                 <listitem><para>
2116                 Install software to run off a central application server with data files stored
2117                 on the local workstation. This is often called a minimum installation, or a
2118                 network client installation.
2119                 </para></listitem>
2121                 <listitem><para>
2122                 Install software to run off a central application server with data files stored
2123                 on a central network share. This type of installation often prevents storage
2124                 of work files on the local workstation.
2125                 </para></listitem>
2126         </itemizedlist>
2128         <para>
2129         <indexterm><primary></primary></indexterm>
2130         A common application deployed in this environment is an office suite.
2131         Enterprise editions of Microsoft Office XP Professional can be administratively installed
2132         by launching the installation from a command shell. The command that achieves this is
2133         <command>setup /a</command>. It results in a set of prompts through which various
2134         installation choices can be made. Refer to the Microsoft Office Resource SDK and Resource
2135         Kit for more information regarding this mode of installation of MS Office XP Professional.
2136         The full administrative installation of MS Office XP Professional requires approximately
2137         650 MB of disk space.
2138         </para>
2140         <para>
2141         When the MS Office XP Professional product has been installed to the administrative network
2142         share, the product can be installed onto a workstation by executing the normal setup program.
2143         The installation process now provides a choice to either perform a minimum installation
2144         or a full local installation. A full local installation takes over 100 MB of disk space.
2145         A network workstation (minimum) installation requires typically 10 MB to 15 MB of
2146         local disk space. In the latter case, when the applications are used, they load over the network.
2147         </para>
2149         <para>
2150         <indexterm><primary>Service Packs</primary></indexterm>
2151         <indexterm><primary>Microsoft Office</primary></indexterm>
2152         Microsoft Office Service Packs can be unpacked to update an administrative share. This makes
2153         it possible to update MS Office XP Professional for all users from a single installation
2154         of the service pack and generally circumvents the need to run updates on each network
2155         Windows client.
2156         </para> 
2158         <para>
2159         The default location for MS Office XP Professional data files can be set through registry
2160         editing or by way of configuration options inside each Office XP Professional application.
2161         </para>
2163         <para>
2164         <indexterm><primary>OpenOffice</primary></indexterm>
2165         OpenOffice.Org OpenOffice Version 1.1.0 can be installed locally. It can also
2166         be installed to run off a network share. The latter is a most desirable solution for office-bound 
2167         network users and for administrative staff alike. It permits quick and easy updates
2168         to be rolled out to all users with a minimum of disruption and with maximum flexibility.
2169         </para>
2171         <para>
2172         The process for installation of administrative shared OpenOffice involves download of the
2173         distribution ZIP file, followed by extraction of the ZIP file into a temporary disk area.
2174         When fully extracted using the unzipping tool of your choosing, change into the Windows
2175         installation files directory then execute <command>setup -net</command>. You are
2176         prompted on screen for the target installation location. This is the administrative
2177         share point. The full administrative OpenOffice share takes approximately 150 MB of disk
2178         space.
2179         </para>
2181                 <sect3>
2182                 <title>Comments Regarding Software Terms of Use</title>
2183                         <para>
2184                         Many single-user products can be installed into an administrative share, but
2185                         personal versions of products such as Microsoft Office XP Professional do not permit this. 
2186                         Many people do not like terms of use typical with commercial products, so a few comments
2187                         regarding software licensing seem important.
2188                         </para>
2190                         <para>
2191                         Please do not use an administrative installation of proprietary and commercially licensed 
2192                         software products to violate the copyright holders' property. All software is licensed,
2193                         particularly software that is licensed for use free of charge. All software is the property
2194                         of the copyright holder unless the author and/or copyright holder has explicitly disavowed
2195                         ownership and has placed the software into the public domain.
2196                         </para>
2198                         <para>
2199                         Software that is under the GNU General Public License, like proprietary software, is 
2200                         licensed in a way that restricts use. For example, if you modify GPL software and then
2201                         distribute the binary version of your modifications, you must offer to provide the source
2202                         code as well. This restriction is designed to maintain the momentum
2203                         of the diffusion of technology and to protect against the withholding of innovations.
2204                         </para>
2206                         <para>
2207                         Commercial and proprietary software generally restrict use to those who have paid the
2208                         license fees and who comply with the licensee's terms of use. Software that is released
2209                         under the GNU General Public License is restricted to particular terms and conditions
2210                         also. Whatever the licensing terms may be, if you do not approve of the terms of use,
2211                         please do not use the software.
2212                         </para>
2214                         <para>
2215                         <indexterm><primary>GPL</primary></indexterm>
2216                         Samba is provided under the terms of the GNU GPL Version 2, a copy of which is provided
2217                         with the source code.
2218                         </para>
2219                 </sect3>
2221         </sect2>
2223         <sect2 id="ch4wincfg">
2224         <title>Windows Client Configuration</title>
2226         <para>
2227         Christine needs to roll out 130 new desktop systems. There is no doubt that she also needs
2228         to reinstall many of the notebook computers that will be recycled for use with the new network 
2229         configuration. The smartest way to handle the challenge of the roll-out program is to build
2230         a staged system for each type of target machine, and then use an image replication tool such as Norton
2231         Ghost (enterprise edition) to replicate the staged machine to its target desktops. The same can
2232         be done with notebook computers as long as they are identical or sufficiently similar.
2233         </para>
2235         <procedure id="sbewinclntprep">
2236         <title>Windows Client Configuration Procedure</title>
2238                 <step><para>
2239                 <indexterm><primary>WINS</primary></indexterm>
2240                 <indexterm><primary>DHCP</primary></indexterm>
2241                 Install MS Windows XP Professional. During installation, configure the client to use DHCP for 
2242                 TCP/IP protocol configuration. DHCP configures all Windows clients to use the WINS Server
2243                 address that has been defined for the local subnet.
2244                 </para></step>
2246                 <step><para>
2247                 Join the Windows Domain <constant>PROMISES</constant>. Use the Domain Administrator
2248                 username <constant>root</constant> and the SMB password you assigned to this account.
2249                 A detailed step-by-step procedure for joining a Windows 200x/XP Professional client to
2250                 a Windows Domain is given in <link linkend="appendix"/>, <link linkend="domjoin"/>. 
2251                 Reboot the machine as prompted and then log on using the Domain Administrator account
2252                 (<constant>root</constant>).
2253                 </para></step>
2255                 <step><para>
2256                 Verify <constant>DIAMOND</constant> is visible in <guimenu>My Network Places</guimenu>, 
2257                 that it is possible to connect to it and see the shares <guimenuitem>accounts</guimenuitem>,
2258                 <guimenuitem>apps</guimenuitem>, and <guimenuitem>finsvcs</guimenuitem>, and that it is
2259                 possible to open each share to reveal its contents.
2260                 </para></step>
2262                 <step><para>
2263                 Create a drive mapping to the <constant>apps</constant> share on the server <constant>DIAMOND</constant>.
2264                 </para></step>
2266                 <step><para>
2267                 Perform an administrative installation of each application to be used. Select the options
2268                 that you wish to use. Of course, you can choose to run applications over the network, correct?
2269                 </para></step>
2271                 <step><para>
2272                 Now install all applications to be installed locally. Typical tools include Adobe Acrobat,
2273                 NTP-based time synchronization software, drivers for specific local devices such as fingerprint
2274                 scanners, and the like. Probably the most significant application for local installation
2275                 is antivirus software.
2276                 </para></step>
2278                 <step><para>
2279                 Now install all four printers onto the staging system. The printers you install
2280                 include the accounting department HP LaserJet 6 and Minolta QMS Magicolor printers. You will
2281                 also configure identical printers that are located in the financial services department.
2282                 Install printers on each machine following the steps shown in the Windows client printer
2283                 preparation procedure below.
2284                 </para></step>
2286                 <step><para>
2287                 <indexterm><primary>defragmentation</primary></indexterm>
2288                 When you are satisfied that the staging systems are complete, use the appropriate procedure to
2289                 remove the client from the domain. Reboot the system and then log on as the local administrator
2290                 and clean out all temporary files stored on the system. Before shutting down, use the disk
2291                 defragmentation tool so that the file system is in optimal condition before replication.
2292                 </para></step>
2294                 <step><para>
2295                 Boot the workstation using the Norton (Symantec) Ghosting diskette (or CD-ROM) and image the
2296                 machine to a network share on the server.
2297                 </para></step>
2299                 <step><para>
2300                 <indexterm><primary>Windows security identifier</primary><see>SID</see></indexterm>
2301                 <indexterm><primary>SID</primary></indexterm>
2302                 You may now replicate the image to the target machines using the appropriate Norton Ghost 
2303                 procedure. Make sure to use the procedure that ensures each machine has a unique
2304                 Windows security identifier (SID). When the installation of the disk image has completed, boot the PC. 
2305                 </para></step>
2307                 <step><para>
2308                 Log on to the machine as the local Administrator (the only option), and join the machine to
2309                 the Domain, following the procedure set out in <link linkend="appendix"/>, <link linkend="domjoin"/>. The system is now 
2310                 ready for the user to log on, provided you have created a network logon account for that 
2311                 user, of course.
2312                 </para></step>
2314                 <step><para>
2315                 Instruct all users to log on to the workstation using their assigned username and password.
2316                 </para></step>
2317         </procedure>
2319         <procedure id="sbewinclntptrprep">
2320         <title>Windows Client Printer Preparation Procedure</title>
2322                 <step><para>
2323                 Click <menuchoice>
2324                         <guimenu>Start</guimenu>
2325                         <guimenuitem>Settings</guimenuitem>
2326                         <guimenuitem>Printers</guimenuitem>
2327                         <guiicon>Add Printer</guiicon>
2328                         <guibutton>Next</guibutton>
2329                         </menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
2330                         Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
2331                 </para></step>
2333                 <step><para>
2334                 Click <guibutton>Next</guibutton>. In the
2335                 <guimenuitem>Manufacturer:</guimenuitem> panel, select <constant>HP</constant>.
2336                 In the <guimenuitem>Printers:</guimenuitem> panel, select the printer called
2337                 <constant>HP LaserJet 6</constant>. Click <guibutton>Next</guibutton>.
2338                 </para></step>
2340                 <step><para>
2341                 In the <guimenuitem>Available ports:</guimenuitem> panel, select
2342                 <constant>FILE:</constant>. Accept the default printer name by clicking
2343                 <guibutton>Next</guibutton>. When asked, <quote>Would you like to print a
2344                 test page?,</quote> click <guimenuitem>No</guimenuitem>. Click
2345                 <guibutton>Finish</guibutton>.
2346                 </para></step>
2348                 <step><para>
2349                 You may be prompted for the name of a file to print to. If so, close the
2350                 dialog panel. Right-click <menuchoice>
2351                         <guiicon>HP LaserJet 6</guiicon>
2352                         <guimenuitem>Properties</guimenuitem>
2353                         <guisubmenu>Details (Tab)</guisubmenu>
2354                         <guimenuitem>Add Port</guimenuitem>
2355                         </menuchoice>.
2356                 </para></step>
2358                 <step><para>
2359                 In the <guimenuitem>Network</guimenuitem> panel, enter the name of
2360                 the print queue on the Samba server as follows: <constant>\\DIAMOND\hplj6a</constant>.
2361                 Click <menuchoice> 
2362                         <guibutton>OK</guibutton>
2363                         <guibutton>OK</guibutton>
2364                         </menuchoice> to complete the installation.
2365                 </para></step>
2367                 <step><para>
2368                 Repeat the printer installation steps above for both HP LaserJet 6 printers
2369                 as well as for both QMS Magicolor laser printers.
2370                 </para></step>
2371         </procedure>
2373         </sect2>
2375         <sect2>
2376         <title>Key Points Learned</title>
2378                 <para>
2379                 How do you feel? You have built a capable network, a truly ambitious project.
2380                 Future network updates can be handled by
2381                 your staff. You must be a satisfied manager. Let's review the achievements.
2382                 </para>
2384                 <itemizedlist>
2385                         <listitem><para>
2386                         A simple firewall has been configured to protect the server in the event that
2387                         the ISP firewall service should fail.
2388                         </para></listitem>
2390                         <listitem><para>
2391                         The Samba configuration uses measures to ensure that only local network users
2392                         can connect to SMB/CIFS services.
2393                         </para></listitem>
2395                         <listitem><para>
2396                         Samba uses the new <constant>tdbsam</constant> passdb backend facility.
2397                         Considerable complexity was added to Samba functionality.
2398                         </para></listitem>
2400                         <listitem><para>
2401                         A DHCP server was configured to implement dynamic DNS (DDNS) updates to the DNS
2402                         server.
2403                         </para></listitem>
2405                         <listitem><para>
2406                         The DNS server was configured to permit DDNS only for local network clients. This
2407                         server also provides primary DNS services for the company Internet presence.
2408                         </para></listitem>
2410                         <listitem><para>
2411                         You introduced an application server as well as the concept of cloning a Windows
2412                         client in order to effect improved standardization of desktops and to reduce
2413                         the costs of network management.
2414                         </para></listitem>
2415                 </itemizedlist>
2417         </sect2>
2419 </sect1>
2421 <sect1>
2422         <title>Questions and Answers</title>
2424         <para>
2425         </para>
2427         <qandaset defaultlable="missed01" type="number">
2428         <qandaentry>
2429         <question>
2431                 <para>
2432                 What is the maximum number of account entries that the <parameter>tdbsam</parameter>
2433                 passdb backend can handle?
2434                 </para>
2436         </question>
2437         <answer>
2439                 <para>
2440                 The tdb data structure and support system can handle more entries than the number of
2441                 accounts that are possible on most UNIX systems. A practical limit would come into
2442                 play long before a performance boundary would be anticipated. That practical limit
2443                 is controlled by the nature of Windows networking. There are few Windows file and
2444                 print servers that can handle more than a few hundred concurrent client connections.
2445                 The key limiting factors that predicate offloading of services to additional servers
2446                 are memory capacity, the number of CPUs, network bandwidth, and disk I/O limitations.
2447                 All of these are readily exhausted by just a few hundred concurrent active users.
2448                 Such bottlenecks can best be removed by segmentation of the network (distributing
2449                 network load across multiple networks).
2450                 </para>
2452                 <para>
2453                 As the network grows, it becomes necessary to provide additional authentication
2454                 servers (domain controllers).  The tdbsam is limited to a single machine and cannot
2455                 be reliably replicated.  This means that practical limits on network design dictate
2456                 the point at which a distributed passdb backend is required; at this time, there is
2457                 no real alternative other than ldapsam (LDAP).
2458                 </para>
2460                 <para>
2461                 The guideline provided in <emphasis>TOSHARG2</emphasis>, Chapter 10, Section 10.1.2,
2462                 is to limit the number of accounts in the tdbsam backend to 250. This is the point
2463                 at which most networks tend to want backup domain controllers (BDCs). Samba-3 does
2464                 not provide a mechanism for replicating tdbsam data so it can be used by a BDC. The
2465                 limitation of 250 users per tdbsam is predicated only on the need for replication,
2466                 not on the limits<footnote><para>Bench tests have shown that tdbsam is a very
2467                 effective database technology.  There is surprisingly little performance loss even
2468                 with over 4000 users.</para></footnote> of the tdbsam backend itself. 
2469                 </para>
2471         </answer>
2472         </qandaentry>
2474         <qandaentry>
2475         <question>
2477                 <para>
2478                 Would Samba operate any better if the OS level is set to a value higher than 35?
2479                 </para>
2481         </question>
2482         <answer>
2484                 <para>
2485                 No. MS Windows workstations and servers do not use a value higher than 33. Setting this to a value
2486                 of 35 already assures Samba of precedence over MS Windows products in browser elections. There is
2487                 no gain to be had from setting this higher.
2488                 </para>
2490         </answer>
2491         </qandaentry>
2493         <qandaentry>
2494         <question>
2496                 <para>
2497                 Why in this example have you provided UNIX group to Windows Group mappings for only Domain Groups?
2498                 </para>
2500         </question>
2501         <answer>
2503                 <para>
2504                 At this time, Samba has the capacity to use only Domain Groups mappings. It is possible that at
2505                 a later date Samba may make use of Windows Local Groups, as well as of the Active Directory special
2506                 Groups. Proper operation requires Domain Groups to be mapped to valid UNIX groups.
2507                 </para>
2509         </answer>
2510         </qandaentry>
2512         <qandaentry>
2513         <question>
2515                 <para>
2516                 Why has a path been specified in the <parameter>IPC$</parameter> share?
2517                 </para>
2519         </question>
2520         <answer>
2522                 <para>
2523                 This is done so that in the event that a software bug may permit a client connection to the IPC$ share to
2524                 obtain access to the file system, it does so at a location that presents least risk. Under normal operation
2525                 this type of paranoid step should not be necessary. The use of this parameter should not be necessary. 
2526                 </para>
2528         </answer>
2529         </qandaentry>
2531         <qandaentry>
2532         <question>
2534                 <para>
2535                 Why does the &smb.conf; file in this exercise include an entry for <smbconfoption name="smb ports"/>?
2536                 </para>
2538         </question>
2539         <answer>
2541                 <para>
2542                 The default order by which Samba-3 attempts to communicate with MS Windows clients is via port 445 (the TCP port
2543                 used by Windows clients when NetBIOS-less SMB over TCP/IP is in use). TCP port 139 is the primary port used for NetBIOS
2544                 over TCP/IP. In this configuration Windows network operations are predicated around NetBIOS over TCP/IP. By
2545                 specifying the use of only port 139, the intent is to reduce unsuccessful service connection attempts.
2546                 The result of this is improved network performance. Where Samba-3 is installed as an Active Directory Domain
2547                 member, the default behavior is highly beneficial and should not be changed.
2548                 </para>
2550         </answer>
2551         </qandaentry>
2553         <qandaentry>
2554         <question>
2556                 <para>
2557                 What is the difference between a print queue and a printer?
2558                 </para>
2560         </question>
2561         <answer>
2563                 <para>
2564                 A printer is a physical device that is connected either directly to the network or to a computer 
2565                 via a serial, parallel, or USB connection so that print jobs can be submitted to it to create a 
2566                 hard copy printout. Network-attached printers that use TCP/IP-based printing generally accept a 
2567                 single print data stream and block all secondary attempts to dispatch jobs concurrently to the 
2568                 same device. If many clients were to concurrently print directly via TCP/IP to the same printer, 
2569                 it would result in a huge amount of network traffic through continually failing connection attempts.
2570                 </para>
2572                 <para>
2573                 A print server (like CUPS or LPR/LPD) accepts multiple concurrent input streams or
2574                 print requests. When the data stream has been fully received, the input stream is closed,
2575                 and the job is then submitted to a sequential print queue where the job is stored until
2576                 the printer is ready to receive the job.
2577                 </para>
2579         </answer>
2580         </qandaentry>
2582         <qandaentry>
2583         <question>
2585                 <para>
2586                 Can all MS Windows application software be installed onto an application server share?
2587                 </para>
2589         </question>
2590         <answer>
2592                 <para>
2593                 Much older Windows software is not compatible with installation to and execution from
2594                 an application server. Enterprise versions of Microsoft Office XP Professional can
2595                 be installed to an application server. Retail consumer versions of Microsoft Office XP
2596                 Professional do not permit installation to an application server share and can be installed
2597                 and used only to/from a local workstation hard disk.
2598                 </para>
2600         </answer>
2601         </qandaentry>
2603         <qandaentry>
2604         <question>
2606                 <para>
2607                 Why use dynamic DNS (DDNS)?
2608                 </para>
2610         </question>
2611         <answer>
2613                 <para>
2614                 When DDNS records are updated directly from the DHCP server, it is possible for
2615                 network clients that are not NetBIOS-enabled, and thus cannot use WINS, to locate
2616                 Windows clients via DNS.
2617                 </para>
2619         </answer>
2620         </qandaentry>
2622         <qandaentry>
2623         <question>
2625                 <para>
2626                 Why would you use WINS as well as DNS-based name resolution?
2627                 </para>
2629         </question>
2630         <answer>
2632                 <para>
2633                 WINS is to NetBIOS names as DNS is to fully qualified domain names (FQDN). The FQDN is
2634                 a name like <quote>myhost.mydomain.tld</quote> where <parameter>tld</parameter>
2635                 means <constant>top-level domain</constant>. A FQDN is a longhand but easy-to-remember
2636                 expression that may be up to 1024 characters in length and that represents an IP address. 
2637                 A NetBIOS name is always 16 characters long. The 16<superscript>th</superscript> character
2638                 is a name type indicator. A specific name type is registered<footnote><para>
2639                 See <emphasis>TOSHARG2</emphasis>, Chapter 9, for more information.</para></footnote> for each 
2640                 type of service that is provided by the Windows server or client and that may be registered
2641                 where a WINS server is in use.
2642                 </para>
2644                 <para>
2645                 WINS is a mechanism by which a client may locate the IP Address that corresponds to a
2646                 NetBIOS name. The WINS server may be queried to obtain the IP Address for a NetBIOS name 
2647                 that includes a particular registered NetBIOS name type. DNS does not provide a mechanism
2648                 that permits handling of the NetBIOS name type information.
2649                 </para>
2651                 <para>
2652                 DNS provides a mechanism by which TCP/IP clients may locate the IP address of a particular 
2653                 hostname or service name that has been registered in the DNS database for a particular domain. 
2654                 A DNS server has limited scope of control and is said to be authoritative for the zone over
2655                 which it has control.
2656                 </para>
2658                 <para>
2659                 Windows 200x Active Directory requires the registration in the DNS zone for the domain it 
2660                 controls of service locator<footnote><para>See TOSHARG2, Chapter 9, Section 9.3.3.</para></footnote> records 
2661                 that Windows clients and servers will use to locate Kerberos and LDAP services. ADS also 
2662                 requires the registration of special records that are called global catalog (GC) entries 
2663                 and site entries by which domain controllers and other essential ADS servers may be located. 
2664                 </para>
2666         </answer>
2667         </qandaentry>
2669         <qandaentry>
2670         <question>
2672                 <para>
2673                 What are the major benefits of using an application server?
2674                 </para>
2676         </question>
2677         <answer>
2679                 <para>
2680                 The use of an application server can significantly reduce application update maintenance.
2681                 By providing a centralized application share, software updates need be applied to only
2682                 one location for all major applications used. This results in faster update roll-outs and
2683                 significantly better application usage control.
2684                 </para>
2686         </answer>
2687         </qandaentry>
2689         </qandaset>
2691 </sect1>
2693 </chapter>