Fixes letterpages + smbconfexample
[Samba.git] / docs / Samba3-ByExample / SBE-SecureOfficeServer.xml
blob1a43987222e4e31bee0a73b66d68a46b06c0df59
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>TOSHARG</emphasis>, Chapter 3.
524                 This is necessary so that Samba can act as a Domain Controller (PDC); see
525                 <emphasis>TOSHARG</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 -i ip_tables
702 /sbin/modprobe -i ip_conntrack
703 /sbin/modprobe -i ip_conntrack_ftp
704 /sbin/modprobe -i iptable_nat
705 /sbin/modprobe -i 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 445</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 modify ntgroup="Domain Admins"  unixgroup=root
985 net groupmap modify ntgroup="Domain Users"   unixgroup=users
986 net groupmap modify ntgroup="Domain Guests"  unixgroup=nobody
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,finsvcs}
1081 &rootprompt; mkdir -p /apps
1082 &rootprompt; chown -R root:root /data
1083 &rootprompt; chown -R root:root /apps
1084 &rootprompt; chown -R bjordan:accounts /data/accounts
1085 &rootprompt; chown -R bjordan:finsvcs /data/finsvcs
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 </screen>
1110                 For each user account that is created on the system, the following commands should be
1111                 executed:
1112 <screen>
1113 &rootprompt; mkdir /var/lib/samba/profiles/'username'
1114 &rootprompt; chown 'username':users /var/lib/samba/profiles/'username'
1115 &rootprompt; chmod ug+wrx,o+rx,-w /var/lib/samba/profiles/'username'
1116 </screen>
1117                 </para></step>
1119                 <step><para>
1120                 <indexterm><primary>logon scrip</primary></indexterm>
1121                 <indexterm><primary>unix2dos</primary></indexterm>
1122                 <indexterm><primary>dos2unix</primary></indexterm>
1123                 Create a logon script. It is important that each line is correctly terminated with
1124                 a carriage return and line-feed combination (i.e., DOS encoding). The following procedure
1125                 works if the right tools (<constant>unix2dos</constant> and <constant>dos2unix</constant>) are installed.
1126                 First, create a file called <filename>/var/lib/samba/netlogon/scripts/logon.bat.unix</filename>
1127                 with the following contents:
1128 <screen>
1129 net time \\diamond /set /yes
1130 net use h: /home
1131 net use p: \\diamond\apps
1132 </screen>
1133                 Convert the UNIX file to a DOS file using the <command>unix2dos</command> as shown here:
1134 <screen>
1135 &rootprompt; unix2dos &lt; /var/lib/samba/netlogon/scripts/logon.bat.unix \
1136         &gt; /var/lib/samba/netlogon/scripts/logon.bat
1137 </screen>
1138                 </para></step>
1139         </procedure>
1141         </sect2>
1143         <sect2 id="ch4dhcpdns">
1144         <title>Configuration of DHCP and DNS Servers</title>
1146         <para>
1147         DHCP services are a basic component of the entire network client installation. DNS operation is
1148         foundational to Internet access as well as to trouble-free operation of local networking. When
1149         you have completed this section, the server should be ready for solid duty operation.
1150         </para>
1152         <procedure>
1153         <title>DHCP and DNS Server Configuration Steps</title>
1155                 <step><para>
1156                 <indexterm><primary>/etc/dhcpd.conf</primary></indexterm>
1157                 Create a file called <filename>/etc/dhcpd.conf</filename> with the contents as
1158                 shown in <link linkend="prom-dhcp"/>.
1160 <example id="prom-dhcp">
1161 <title>DHCP Server Configuration File &smbmdash; <filename>/etc/dhcpd.conf</filename></title>
1162 <screen>
1163 # Abmas Accounting Inc.
1164 default-lease-time 86400;
1165 max-lease-time 172800;
1166 default-lease-time 86400;
1167 option ntp-servers 192.168.1.1;
1168 option domain-name "abmas.biz";
1169 option domain-name-servers 192.168.1.1, 192.168.2.1;
1170 option netbios-name-servers 192.168.1.1, 192.168.2.1;
1171 option netbios-node-type 8;       ### Node type = Hybrid ###
1172 ddns-updates on;                  ### Dynamic DNS enabled ###
1173 ddns-update-style interim;
1175 subnet 192.168.1.0 netmask 255.255.255.0 {
1176         range dynamic-bootp 192.168.1.128 192.168.1.254;
1177         option subnet-mask 255.255.255.0;
1178         option routers 192.168.1.1;
1179         allow unknown-clients;
1180         host qmsa {
1181                 hardware ethernet 08:00:46:7a:35:e4;
1182                 fixed-address 192.168.1.20;
1183                 }
1184         host hplj6a {
1185                 hardware ethernet 00:03:47:cb:81:e0;
1186                 fixed-address 192.168.1.30;
1187                 }
1188         }
1189 subnet 192.168.2.0 netmask 255.255.255.0 {
1190         range dynamic-bootp 192.168.2.128 192.168.2.254;
1191         option subnet-mask 255.255.255.0;
1192         option routers 192.168.2.1;
1193         allow unknown-clients;
1194         host qmsf {
1195                 hardware ethernet 01:04:31:db:e1:c0;
1196                 fixed-address 192.168.1.20;
1197                 }
1198         host hplj6f {
1199                 hardware ethernet 00:03:47:cf:83:e2;
1200                 fixed-address 192.168.2.30;
1201                 }
1202         }
1203 subnet 127.0.0.0 netmask 255.0.0.0 {
1204         }
1205 subnet 123.45.67.64 netmask 255.255.255.252 {
1206         }
1207 </screen>
1208 </example>
1209                 </para></step>
1211                 <step><para>
1212                 <indexterm><primary>/etc/named.conf</primary></indexterm>
1213                 Create a file called <filename>/etc/named.conf</filename> that has the combined contents
1214                 of the <link linkend="ch4namedcfg"/>, <link linkend="ch4namedvarfwd"/>, and
1215                 <link linkend="ch4namedvarrev"/> files that are concatenated (merged) in this
1216                 specific order.
1217                 </para></step>
1219                 <step><para>
1220                 Create the files shown in their directories as follows: (John, on this page, the numbered entry comes after the table it's referencing!!!!!)
1222                         <table id="namedrscfiles">
1223                                 <title>DNS (named) Resource Files</title>
1224                                 <tgroup cols="2">
1225                                         <colspec align="left"/>
1226                                         <colspec align="left"/>
1227                                         <thead>
1228                                                 <row>
1229                                                         <entry>Reference</entry>
1230                                                         <entry>File Location</entry>
1231                                                 </row>
1232                                         </thead>
1233                                         <tbody>
1234                                                 <row>
1235                                                         <entry><link linkend="loopback"/></entry>
1236                                                         <entry>/var/lib/named/localhost.zone</entry>
1237                                                 </row>
1238                                                 <row>
1239                                                         <entry><link linkend="dnsloopy"/></entry>
1240                                                         <entry>/var/lib/named/127.0.0.zone</entry>
1241                                                 </row>
1242                                                 <row>
1243                                                         <entry><link linkend="roothint"/></entry>
1244                                                         <entry>/var/lib/named/root.hint</entry>
1245                                                 </row>
1246                                                 <row>
1247                                                         <entry><link linkend="abmasbiz"/></entry>
1248                                                         <entry>/var/lib/named/master/abmas.biz.hosts</entry>
1249                                                 </row>
1250                                                 <row>
1251                                                         <entry><link linkend="abmasus"/></entry>
1252                                                         <entry>/var/lib/named/abmas.us.hosts</entry>
1253                                                 </row>
1254                                                 <row>
1255                                                         <entry><link linkend="eth1zone"/></entry>
1256                                                         <entry>/var/lib/named/192.168.1.0.rev</entry>
1257                                                 </row>
1258                                                 <row>
1259                                                         <entry><link linkend="eth2zone"/></entry>
1260                                                         <entry>/var/lib/named/192.168.2.0.rev</entry>
1261                                                 </row>
1262                                         </tbody>
1263                                 </tgroup>
1264                         </table>
1266 <example id="ch4namedcfg">
1267 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Master Section</title>
1268 <indexterm><primary>/etc/named.conf</primary></indexterm>
1269 <screen>
1271 # Abmas Biz DNS Control File
1273 # Date: November 15, 2003
1275 options {
1276         directory "/var/lib/named";
1277         forwarders {
1278                 123.45.12.23;
1279                 };
1280         forward first;
1281         listen-on {
1282                 mynet;
1283                 };
1284         auth-nxdomain yes;
1285         multiple-cnames yes;
1286         notify no;
1289 zone "." in {
1290         type hint;
1291         file "root.hint";
1294 zone "localhost" in {
1295         type master;
1296         file "localhost.zone";
1299 zone "0.0.127.in-addr.arpa" in {
1300         type master;
1301         file "127.0.0.zone";
1304 acl mynet {
1305         192.168.1.0/24;
1306         192.168.2.0/24;
1307         127.0.0.1;
1310 acl seconddns {
1311         123.45.54.32;
1314 </screen>
1315 </example>
1317 <example id="ch4namedvarfwd">
1318 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Forward Lookup Definition Section</title>
1319 <screen>
1320 zone "abmas.biz" {
1321         type master;
1322         file "/var/lib/named/master/abmas.biz.hosts";
1323         allow-query {
1324                 mynet;
1325         };
1326         allow-transfer {
1327                 mynet;
1328         };
1329         allow-update {
1330                 mynet;
1331         };
1334 zone "abmas.us" {
1335         type master;
1336         file "/var/lib/named/master/abmas.us.hosts";
1337         allow-query {
1338                 all;
1339         };
1340         allow-transfer {
1341                 seconddns;
1342         };
1344 </screen>
1345 </example>
1347 <example id="ch4namedvarrev">
1348 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Reverse Lookup Definition Section</title>
1349 <screen>
1350 zone "1.168.192.in-addr.arpa" {
1351         type master;
1352         file "/var/lib/named/master/192.168.1.0.rev";
1353         allow-query {
1354                 mynet;
1355         };
1356         allow-transfer {
1357                 mynet;
1358         };
1359         allow-update {
1360                 mynet;
1361         };
1364 zone "2.168.192.in-addr.arpa" {
1365         type master;
1366         file "/var/lib/named/master/192.168.2.0.rev";
1367         allow-query {
1368                 mynet;
1369         };
1370         allow-transfer {
1371                 mynet;
1372         };
1373         allow-update {
1374                 mynet;
1375         };
1377 </screen>
1378 </example>
1380 <example id="eth1zone">
1381 <title>DNS 192.168.1 Reverse Zone File</title>
1382 <screen>
1383 $ORIGIN .
1384 $TTL 38400      ; 10 hours 40 minutes
1385 1.168.192.in-addr.arpa  IN SOA  sleeth.abmas.biz. root.abmas.biz. (
1386                                 2003021825 ; serial
1387                                 10800      ; refresh (3 hours)
1388                                 3600       ; retry (1 hour)
1389                                 604800     ; expire (1 week)
1390                                 38400      ; minimum (10 hours 40 minutes)
1391                                 )
1392                         NS      sleeth1.abmas.biz.
1393 $ORIGIN 1.168.192.in-addr.arpa.
1394 1                       PTR     sleeth1.abmas.biz.
1395 20                      PTR     qmsa.abmas.biz.
1396 30                      PTR     hplj6a.abmas.biz.
1397 </screen>
1398 </example>
1400 <example id="eth2zone">
1401 <title>DNS 192.168.2 Reverse Zone File</title>
1402 <screen>
1403 $ORIGIN .
1404 $TTL 38400      ; 10 hours 40 minutes
1405 2.168.192.in-addr.arpa  IN SOA  sleeth.abmas.biz. root.abmas.biz. (
1406                                 2003021825 ; serial
1407                                 10800      ; refresh (3 hours)
1408                                 3600       ; retry (1 hour)
1409                                 604800     ; expire (1 week)
1410                                 38400      ; minimum (10 hours 40 minutes)
1411                                 )
1412                         NS      sleeth2.abmas.biz.
1413 $ORIGIN 2.168.192.in-addr.arpa.
1414 1                       PTR     sleeth2.abmas.biz.
1415 20                      PTR     qmsf.abmas.biz.
1416 30                      PTR     hplj6f.abmas.biz.
1417 </screen>
1418 </example>
1420 <example id="abmasbiz">
1421 <title>DNS Abmas.biz Forward Zone File</title>
1422 <screen>
1423 $ORIGIN .
1424 $TTL 38400      ; 10 hours 40 minutes
1425 abmas.biz       IN SOA  sleeth1.abmas.biz. root.abmas.biz. (
1426                                 2003021833 ; serial
1427                                 10800      ; refresh (3 hours)
1428                                 3600       ; retry (1 hour)
1429                                 604800     ; expire (1 week)
1430                                 38400      ; minimum (10 hours 40 minutes)
1431                                 )
1432                         NS      dns.abmas.biz.
1433                         MX      10 mail.abmas.biz.
1434 $ORIGIN abmas.biz.
1435 sleeth1                 A       192.168.1.1
1436 sleeth2                 A       192.168.2.1
1437 qmsa                    A       192.168.1.20
1438 hplj6a                  A       192.168.1.30
1439 qmsf                    A       192.168.2.20
1440 hplj6f                  A       192.168.2.30
1441 dns                     CNAME   sleeth1
1442 diamond                 CNAME   sleeth1
1443 mail                    CNAME   sleeth1
1444 </screen>
1445 </example>
1447 <example id="abmasus">
1448 <title>DNS Abmas.us Forward Zone File</title>
1449 <screen>
1450 $ORIGIN .
1451 $TTL 38400      ; 10 hours 40 minutes
1452 abmas.us        IN SOA  server.abmas.us. root.abmas.us. (
1453                                 2003021833 ; serial
1454                                 10800      ; refresh (3 hours)
1455                                 3600       ; retry (1 hour)
1456                                 604800     ; expire (1 week)
1457                                 38400      ; minimum (10 hours 40 minutes)
1458                                 )
1459                         NS      dns.abmas.us.
1460                         NS      dns2.abmas.us.
1461                         MX      10 mail.abmas.us.
1462 $ORIGIN abmas.us.
1463 server                  A       123.45.67.66
1464 dns2                    A       123.45.54.32
1465 gw                      A       123.45.67.65
1466 www                     CNAME   server
1467 mail                    CNAME   server
1468 dns                     CNAME   server
1469 </screen>
1470 </example>
1472                 </para></step>
1474                 <step><para>
1475               <indexterm><primary>/etc/resolv.conf</primary></indexterm><indexterm>
1476                 <primary>name resolution</primary>
1477               </indexterm>
1478                 All DNS name resolution should be handled locally. To ensure that the server is configured
1479                 correctly to handle this, edit <filename>/etc/resolv.conf</filename> to have the following
1480                 content:
1481 <screen>
1482 search abmas.us abmas.biz
1483 nameserver 127.0.0.1
1484 nameserver 123.45.54.23
1485 </screen>
1486               <indexterm>
1487                 <primary>DNS server</primary>
1488               </indexterm>
1489                 This instructs the name resolver function (when configured correctly) to ask the DNS server
1490                 that is running locally to resolve names to addresses. In the event that the local name server
1491                 is not available, ask the name server provided by the ISP. The latter, of course, does not resolve
1492                 purely local names to IP addresses.
1493                 </para></step>
1495                 <step><para>
1496                 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1497                 The final step is to edit the <filename>/etc/nsswitch.conf</filename> file.
1498                 This file controls the operation of the various resolver libraries that are part of the Linux
1499                 Glibc libraries. Edit this file so that it contains the following entries:
1500 <screen>
1501 hosts:      files dns wins
1502 </screen>
1503                 </para></step>
1504         </procedure>
1506         <para>
1507         The basic DHCP and DNS services are now ready for validation testing. Before you can proceed,
1508         there are a few more steps along the road. First, configure the print spooling and print
1509         processing system.  Then you can configure the server so that all services
1510         start automatically on reboot. You must also manually start all services prior to validation testing.
1511         </para>
1513         </sect2>
1515         <sect2 id="ch4ptrcfg">
1516         <title>Printer Configuration</title>
1518         <para>
1519         Network administrators who are new to CUPS based printing typically experience some difficulty mastering
1520         its powerful features. The steps outlined in this section are designed to navigate around the distractions
1521         of learning CUPS. Instead of implementing smart features and capabilties our approach is to use it as a
1522         transparent print queue that performs no filtering, and only minimal handling of each print job that is
1523         submitted to it. In other words, our configuration turns CUPS into a raw-mode print queue. This means that
1524         the correct printer driver must be installed on all clients.
1525         </para>
1527         <procedure>
1528         <title>Printer Configuration Steps</title>
1530                 <step><para>
1531                 Configure each printer to be a DHCP client, carefully following the manufacturer's guidelines.
1532                 </para></step>
1534                 <step><para>
1535                 Follow the instructions in the printer manufacturer's manuals to permit printing to port 9100.
1536                 Use any other port the manufacturer specifies for direct-mode raw printing, and adjust the
1537                 port as necessary in the following example commands.
1538                 This allows the CUPS spooler to print using raw mode protocols.
1539                 <indexterm><primary>CUPS</primary></indexterm>
1540                 <indexterm><primary>raw printing</primary></indexterm>
1541                 </para></step>
1543                 <step><para>
1544               <indexterm><primary>CUPS</primary><secondary>queue</secondary></indexterm><indexterm>
1545                 <primary>lpadmin</primary>
1546               </indexterm>
1547                 Configure the CUPS Print Queues as follows:
1548 <screen>
1549 &rootprompt; lpadmin -p qmsa -v socket://qmsa.abmas.biz:9100 -E
1550 &rootprompt; lpadmin -p hplj6a -v socket://hplj6a.abmas.biz:9100 -E
1551 &rootprompt; lpadmin -p qmsf -v socket://qmsf.abmas.biz:9100 -E
1552 &rootprompt; lpadmin -p hplj6f -v socket://hplj6f.abmas.biz:9100 -E
1553 </screen>
1554                 <indexterm><primary>print filter</primary></indexterm>
1555                 This creates the necessary print queues with no assigned print filter.
1556                 </para></step>
1558           <step><para><indexterm>
1559                 <primary>enable</primary>
1560               </indexterm>
1561                 Print queues may not be enabled at creation. Use <command>lpc stat</command> to check
1562                 the status of the print queues and, if necessary, make certain that the queues you have 
1563                 just created are enabled by executing the following:
1564 <screen>
1565 &rootprompt; /usr/bin/enable qmsa
1566 &rootprompt; /usr/bin/enable hplj6a
1567 &rootprompt; /usr/bin/enable qmsf
1568 &rootprompt; /usr/bin/enable hplj6f
1569 </screen>
1570                 </para></step>
1572           <step><para><indexterm>
1573                 <primary>accept</primary>
1574               </indexterm>
1575                 Even though your print queues may be enabled, it is still possible that they
1576                 are not accepting print jobs. A print queue services incoming printing
1577                 requests only when configured to do so. Ensure that your print queues are
1578                 set to accept incoming jobs by executing the following commands:
1579 <screen>
1580 &rootprompt; /usr/bin/accept qmsa
1581 &rootprompt; /usr/bin/accept hplj6a
1582 &rootprompt; /usr/bin/accept qmsf
1583 &rootprompt; /usr/bin/accept hplj6f
1584 </screen>
1585                 </para></step>
1587                 <step><para>
1588                 <indexterm><primary>mime type</primary></indexterm>
1589                 <indexterm><primary>/etc/mime.convs</primary></indexterm>
1590                 <indexterm><primary>application/octet-stream</primary></indexterm>
1591                 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
1592 <screen>
1593 application/octet-stream     application/vnd.cups-raw      0     -
1594 </screen>
1595                 </para></step>
1597                 <step><para>
1598                 <indexterm><primary>/etc/mime.types</primary></indexterm>
1599                 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
1600 <screen>
1601 application/octet-stream
1602 </screen>
1603                 </para></step>
1605                 <step><para>
1606                 Printing drivers are installed on each network client workstation.
1607                 </para></step>
1608         </procedure>
1610         <para>
1611         Note: If the parameter <parameter>cups options = Raw</parameter> is specified in the &smb.conf; file,
1612         the last two steps can be omitted where CUPS version 1.1.18, or later.
1613         </para>
1615         <para>
1616         The UNIX system print queues have been configured and are ready for validation testing.
1617         </para>
1619         </sect2>
1621         <sect2 id="procstart">
1622         <title>Process Startup Configuration</title>
1624         <para>
1625         <indexterm><primary>chkconfig</primary></indexterm>
1626         There are two essential steps to process startup configuration. First, the process
1627         must be configured so that it automatically restarts each time the server
1628         is rebooted. This step involves use of the <command>chkconfig</command> tool that
1629         creates the appropriate symbolic links from the master daemon control file that is
1630         located in the <filename>/etc/rc.d</filename> directory, to the <filename>/etc/rc'x'.d</filename>
1631         directories. Links are created so that when the system run level is changed, the
1632         necessary start or kill script is run.
1633         </para>
1635         <para>
1636         <indexterm><primary>/etc/xinetd.d</primary></indexterm>
1637         <indexterm><primary>inetd</primary></indexterm>
1638         <indexterm><primary>xinetd</primary></indexterm>
1639         <indexterm><primary>chkconfig</primary></indexterm>
1640         <indexterm><primary>super daemon</primary></indexterm>
1641         In the event that a service is not run as a daemon, but via the internetworking
1642         super daemon (<command>inetd</command> or <command>xinetd</command>), then the <command>chkconfig</command>
1643         tool makes the necessary entries in the <filename>/etc/xinetd.d</filename> directory
1644         and sends a hang-up (HUP) signal to the the super daemon, thus forcing it to
1645         re-read its control files.
1646         </para>
1648         <para>
1649         Last, each service must be started to permit system validation to proceed.
1650         </para>
1652         <procedure>
1653                 <step><para>
1654                 Use the standard system tool to configure each service to restart
1655                 automatically at every system reboot. For example,
1656                 <indexterm><primary>chkconfig</primary></indexterm>
1657 <screen>
1658 &rootprompt; chkconfig dhpc on
1659 &rootprompt; chkconfig named on
1660 &rootprompt; chkconfig cups on
1661 &rootprompt; chkconfig smb on
1662 </screen>
1663                 </para></step>
1665                 <step><para>
1666                 <indexterm><primary>starting dhcpd</primary></indexterm>
1667                 <indexterm><primary>starting samba</primary></indexterm>
1668                 <indexterm><primary>starting CUPS</primary></indexterm>
1669                 Now start each service to permit the system to be validated.
1670                 Execute each of the following in the sequence shown:
1672 <screen>
1673 &rootprompt; /etc/rc.d/init.d/dhcp restart
1674 &rootprompt; /etc/rc.d/init.d/named restart
1675 &rootprompt; /etc/rc.d/init.d/cups restart
1676 &rootprompt; /etc/rc.d/init.d/smb restart
1677 </screen>
1678                 </para></step>
1679         </procedure>
1681         </sect2>
1683         <sect2 id="ch4valid">
1684         <title>Validation</title>
1686         <para>
1687         <indexterm><primary>validation</primary></indexterm>
1688         Complex networking problems are most often caused by simple things that are poorly or incorrectly
1689         configured. The validation process adopted here should be followed carefully; it is the result of the
1690         experience gained from years of making and correcting the most common mistakes. Shortcuts often lead to basic errors. You should
1691         refrain from taking shortcuts, from making basic assumptions, and from not exercising due process
1692         and diligence in network validation. By thoroughly testing and validating every step in the process
1693         of network installation and configuration, you can save yourself from sleepless nights and restless
1694         days. A well debugged network is a foundation for happy network users and network administrators. 
1695         Later in this book you learn how to make users happier. For now, it is enough to learn to 
1696         validate. Let's get on with it.
1697         </para>
1699                 <procedure>
1700                 <title>Server Validation Steps</title>
1702                         <step><para>
1703                         <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1704                         One of the most important facets of Samba configuration is to ensure that
1705                         name resolution functions correctly. You can check name resolution
1706                         with a few simple tests. The most basic name resolution is provided from the
1707                         <filename>/etc/hosts</filename> file. To test its operation, make a
1708                         temporary edit to the <filename>/etc/nsswitch.conf</filename> file. Using
1709                         your favorite editor, change the entry for <constant>hosts</constant> to read:
1710 <screen>
1711 hosts:     files
1712 </screen>
1713                         When you have saved this file, execute the following command:
1714 <screen>
1715 &rootprompt; ping diamond
1716 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1717 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.131 ms
1718 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.179 ms
1719 64 bytes from sleeth1 (192.168.1.1): icmp_seq=3 ttl=64 time=0.192 ms
1720 64 bytes from sleeth1 (192.168.1.1): icmp_seq=4 ttl=64 time=0.191 ms
1722 --- sleeth1.abmas.biz ping statistics ---
1723 4 packets transmitted, 4 received, 0% packet loss, time 3016ms
1724 rtt min/avg/max/mdev = 0.131/0.173/0.192/0.026 ms
1725 </screen>
1726                         This proves that name resolution via the <filename>/etc/hosts</filename> file
1727                         is working.
1728                         </para></step>
1730                         <step><para>
1731                         <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1732                         So far, your installation is going particularly well. In this step we validate
1733                         DNS server and name resolution operation. Using your favorite UNIX system editor,
1734                         change the <filename>/etc/nsswitch.conf</filename> file so that the
1735                         <constant>hosts</constant> entry reads:
1736 <screen>
1737 hosts:        dns
1738 </screen>
1739                         </para></step>
1741                         <step><para>
1742                         <indexterm><primary>named</primary></indexterm>
1743                         Before you test DNS operation, it is a good idea to verify that the DNS server
1744                         is running by executing the following:
1745 <screen>
1746 &rootprompt; ps ax | grep named
1747   437 ?        S      0:00 /sbin/syslogd -a /var/lib/named/dev/log
1748   524 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1749   525 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1750   526 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1751   529 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1752   540 ?        S      0:00 /usr/sbin/named -t /var/lib/named -u named
1753  2552 pts/2    S      0:00 grep named
1754 </screen>
1755                         This means that we are ready to check DNS operation. Do so by executing:
1756                         <indexterm><primary>ping</primary></indexterm>
1757 <screen>
1758 &rootprompt; ping diamond
1759 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1760 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.156 ms
1761 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.183 ms
1763 --- sleeth1.abmas.biz ping statistics ---
1764 2 packets transmitted, 2 received, 0% packet loss, time 999ms
1765 rtt min/avg/max/mdev = 0.156/0.169/0.183/0.018 ms
1766 </screen>
1767                         You should take a few more steps to validate DNS server operation, as follows:
1768 <screen>
1769 &rootprompt; host -f diamond.abmas.biz
1770 sleeth1.abmas.biz has address 192.168.1.1
1771 </screen>
1772                         <indexterm><primary>/etc/hosts</primary></indexterm>
1773                         You may now remove the entry called <constant>diamond</constant> from the
1774                         <filename>/etc/hosts</filename> file. It does not hurt to leave it there,
1775                         but its removal reduces the number of administrative steps for this name.
1776                         </para></step>
1778                         <step><para>
1779                         <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1780                         WINS is a great way to resolve NetBIOS names to their IP address. You can test
1781                         the operation of WINS by starting <command>nmbd</command> (manually or by way
1782                         of the Samba startup method shown in <link linkend="procstart"/>). You must edit
1783                         the <filename>/etc/nsswitch.conf</filename> file so that the <constant>hosts</constant>
1784                         entry is as follows:
1785 <screen>
1786 hosts:        wins
1787 </screen>
1788                         The next step is to make certain that Samba is running using <command>ps ax|grep mbd</command>, and then execute the following:
1789 <screen>
1790 &rootprompt; ping diamond
1791 PING diamond (192.168.1.1) 56(84) bytes of data.
1792 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.094 ms
1793 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.479 ms
1794 </screen>
1795                         <indexterm><primary>ping</primary></indexterm>
1796                         Now that you can relax with the knowledge that all three major forms of name
1797                         resolution to IP address resolution are working, edit the <filename>/etc/nsswitch.conf</filename>
1798                         again. This time you add all three forms of name resolution to this file.
1799                         Your edited entry for <constant>hosts</constant> should now look like this:
1800 <screen>
1801 hosts:       files dns wins
1802 </screen>
1803                         The system is looking good. Let's move on.
1804                         </para></step>
1806                         <step><para>
1807                         It would give you peace of mind to know that the DHCP server is running
1808                         and available for service. You can validate DHCP services by running:
1810 <screen>
1811 &rootprompt; ps ax | grep dhcp
1812  2618 ?        S      0:00 /usr/sbin/dhcpd ...
1813  8180 pts/2    S      0:00 grep dhcp
1814 </screen>
1815                         This shows that the server is running. The proof of whether or not it is working
1816                         comes when you try to add the first DHCP client to the network.
1817                         </para></step>
1819                         <step><para>
1820                         <indexterm><primary>testparm</primary></indexterm>
1821                         This is a good point at which to start validating Samba operation. You are 
1822                         content that name resolution is working for basic TCP/IP needs. Let's move on.
1823                         If your &smb.conf; file has bogus options or parameters, this may cause Samba
1824                         to refuse to start. The first step should always be to validate the contents
1825                         of this file by running:
1826 <screen>
1827 &rootprompt; testparm -s
1828 Load smb config files from smb.conf
1829 rocessing section "[homes]"
1830 Processing section "[printers]"
1831 Processing section "[netlogon]"
1832 Processing section "[profiles]"
1833 Processing section "[accounts]"
1834 Processing section "[service]"
1835 Processing section "[apps]"
1836 Loaded services file OK.
1837 # Global parameters
1838 [global]
1839     workgroup = PROMISES
1840     netbios name = DIAMOND
1841     interfaces = eth1, eth2, lo
1842     bind interfaces only = Yes
1843     passdb backend = tdbsam
1844     pam password change = Yes
1845     passwd program = /usr/bin/passwd '%u'
1846     passwd chat = *New*Password* %n\n \
1847              *Re-enter*new*password* %n\n *Password*changed*
1848     username map = /etc/samba/smbusers
1849     unix password sync = Yes
1850     log level = 1
1851     syslog = 0
1852     log file = /var/log/samba/%m
1853     max log size = 50
1854     smb ports = 139 445
1855     name resolve order = wins bcast hosts
1856     time server = Yes
1857     printcap name = CUPS
1858     show add printer wizard = No
1859     add user script = /usr/sbin/useradd -m '%u'
1860     delete user script = /usr/sbin/userdel -r '%u'
1861     add group script = /usr/sbin/groupadd '%g'
1862     delete group script = /usr/sbin/groupdel '%g'
1863     add user to group script = /usr/sbin/usermod -G '%g' '%u'
1864     add machine script = /usr/sbin/useradd \
1865                               -s /bin/false -d /dev/null '%u'
1866     shutdown script = /var/lib/samba/scripts/shutdown.sh
1867     abort shutdown script = /sbin/shutdown -c
1868     logon script = scripts\logon.bat
1869     logon path = \\%L\profiles\%U
1870     logon drive = X:
1871     logon home = \\%L\%U
1872     domain logons = Yes
1873     preferred master = Yes
1874     wins support = Yes
1875     utmp = Yes
1876     winbind use default domain = Yes
1877     map acl inherit = Yes
1878     cups options = Raw
1879     veto files = /*.eml/*.nws/*.{*}/
1880     veto oplock files = /*.doc/*.xls/*.mdb/
1882 [homes]
1883     comment = Home Directories
1884     valid users = %S
1885     read only = No
1886     browseable = No
1888 ### Remainder cut to save space ###
1889 </screen>
1890                         Clear away all errors before proceeding.
1891                         </para></step>
1893                         <step><para>
1894                         <indexterm><primary>check samba daemons</primary></indexterm>
1895                         <indexterm><primary>smbd</primary></indexterm>
1896                         <indexterm><primary>nmbd</primary></indexterm>
1897                         <indexterm><primary>winbindd</primary></indexterm>
1898                         Check that the Samba server is running:
1899 <screen>
1900 &rootprompt; ps ax | grep mbd
1901 14244 ?        S      0:00 /usr/sbin/nmbd -D
1902 14245 ?        S      0:00 /usr/sbin/nmbd -D
1903 14290 ?        S      0:00 /usr/sbin/smbd -D
1905 $rootprompt; ps ax | grep winbind
1906 14293 ?        S     0:00 /usr/sbin/winbindd -B
1907 14295 ?        S     0:00 /usr/sbin/winbindd -B
1908 </screen>
1909                         The <command>winbindd</command> daemon is running in split mode (normal), so there are also
1910                         two instances<footnote><para>For more information regarding winbindd, see <emphasis>TOSHARG</emphasis>, 
1911                         Chapter 23, Section 23.3. The single instance of <command>smbd</command> is normal. One additional
1912                         <command>smbd</command> slave process is spawned for each SMB/CIFS client 
1913                         connection.</para></footnote> of it.
1914                         </para></step>
1915         
1916                         <step><para>
1917                         <indexterm><primary>anonymous
1918                   connection</primary></indexterm>
1919               <indexterm>
1920                 <primary>smbclient</primary>
1921               </indexterm>
1922                         Check that an anonymous connection can be made to the Samba server:
1923 <screen>
1924 &rootprompt; smbclient -L localhost -U%
1926         Sharename      Type      Comment
1927         ---------      ----      -------
1928         IPC$           IPC       IPC Service (Samba 3.0.20)
1929         netlogon       Disk      Network Logon Service
1930         profiles       Disk      Profile Share
1931         accounts       Disk      Accounting Files
1932         service        Disk      Financial Services Files
1933         apps           Disk      Application Files
1934         ADMIN$         IPC       IPC Service (Samba 3.0.20)
1935         hplj6a         Printer   hplj6a
1936         hplj6f         Printer   hplj6f
1937         qmsa           Printer   qmsa
1938         qmsf           Printer   qmsf
1940         Server               Comment
1941         ---------            -------
1942         DIAMOND              Samba 3.0.20
1944         Workgroup            Master
1945         ---------            -------
1946         PROMISES             DIAMOND
1947 </screen>
1948                         This demonstrates that an anonymous listing of shares can be obtained. This is the equivalent
1949                         of browsing the server from a Windows client to obtain a list of shares on the server.
1950                         The <constant>-U%</constant> argument means to send a <constant>NULL</constant> username and
1951                         a <constant>NULL</constant> password.
1952                         </para></step>
1954                         <step><para>
1955                         <indexterm><primary>dhcp client validation</primary></indexterm>
1956                         <indexterm><primary>printer validation</primary></indexterm>
1957                         <indexterm><primary>arp</primary></indexterm>
1958                         Verify that each printer has the IP address assigned in the DHCP server configuration file.
1959                         The easiest way to do this is to ping the printer name. Immediately after the ping response
1960                         has been received, execute <command>arp -a</command> to find the MAC address of the printer
1961                         that has responded. Now you can compare the IP address and the MAC address of the printer
1962                         with the configuration information in the <filename>/etc/dhcpd.conf</filename> file. They
1963                         should, of course, match. For example,
1964 <screen>
1965 &rootprompt; ping hplj6
1966 PING hplj6a (192.168.1.30) 56(84) bytes of data.
1967 64 bytes from hplj6a (192.168.1.30): icmp_seq=1 ttl=64 time=0.113 ms
1969 &rootprompt; arp -a
1970 hplj6a (192.168.1.30) at 00:03:47:CB:81:E0 [ether] on eth0
1971 </screen>
1972               <indexterm>
1973                 <primary>/etc/dhcpd.conf</primary>
1974               </indexterm>
1975                         The MAC address <constant>00:03:47:CB:81:E0</constant> matches that specified for the
1976                         IP address from which the printer has responded and with the entry for it in the
1977                         <filename>/etc/dhcpd.conf</filename> file. Repeat this for each printer configured.
1978                         </para></step>
1979         
1980                         <step><para>
1981                         <indexterm><primary>authenticated connection</primary></indexterm>
1982                         Make an authenticated connection to the server using the <command>smbclient</command> tool:
1983 <screen>
1984 &rootprompt; smbclient //diamond/accounts -U gholmes
1985 Password: XXXXXXX
1986 smb: \> dir
1987   .                          D        0  Thu Nov 27 15:07:09 2003
1988   ..                         D        0  Sat Nov 15 17:40:50 2003
1989   zakadmin.exe                   161424  Thu Nov 27 15:06:52 2003
1990   zak.exe                       6066384  Thu Nov 27 15:06:52 2003
1991   dhcpd.conf                       1256  Thu Nov 27 15:06:52 2003
1992   smb.conf                         2131  Thu Nov 27 15:06:52 2003
1993   initGrps.sh                A     1089  Thu Nov 27 15:06:52 2003
1994   POLICY.EXE                      86542  Thu Nov 27 15:06:52 2003
1996                 55974 blocks of size 65536. 33968 blocks available
1997 smb: \> q
1998 </screen>
1999                         </para></step>
2001                         <step><para>
2002                         <indexterm><primary>nmap</primary></indexterm>
2003                         Your new server is connected to an Internet-accessible connection. Before you start
2004                         your firewall, you should run a port scanner against your system. You should repeat that
2005                         after the firewall has been started. This helps you understand to what extent the
2006                         server may be vulnerable to external attack. One way you can do this is by using an
2007                         external service, such as the <ulink url="http://www.dslreports.com/scan">DSL Reports</ulink> 
2008                         tools. Alternately, if you can gain root-level access to a remote
2009                         UNIX/Linux system that has the <command>nmap</command> tool, you can run the following:
2010 <screen>
2011 &rootprompt; nmap -v -sT server.abmas.us
2013 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2014 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2015 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2016 Adding open port 6000/tcp
2017 Adding open port 873/tcp
2018 Adding open port 445/tcp
2019 Adding open port 10000/tcp
2020 Adding open port 901/tcp
2021 Adding open port 631/tcp
2022 Adding open port 25/tcp
2023 Adding open port 111/tcp
2024 Adding open port 32770/tcp
2025 Adding open port 3128/tcp
2026 Adding open port 53/tcp
2027 Adding open port 80/tcp
2028 Adding open port 443/tcp
2029 Adding open port 139/tcp
2030 Adding open port 22/tcp
2031 The Connect() Scan took 0 seconds to scan 1601 ports.
2032 Interesting ports on server.abmas.us (123.45.67.66):
2033 (The 1587 ports scanned but not shown below are in state: closed)
2034 Port       State       Service
2035 22/tcp     open        ssh
2036 25/tcp     open        smtp
2037 53/tcp     open        domain
2038 80/tcp     open        http
2039 111/tcp    open        sunrpc
2040 139/tcp    open        netbios-ssn
2041 443/tcp    open        https
2042 445/tcp    open        microsoft-ds
2043 631/tcp    open        ipp
2044 873/tcp    open        rsync
2045 901/tcp    open        samba-swat
2046 3128/tcp   open        squid-http
2047 6000/tcp   open        X11
2048 10000/tcp  open        snet-sensor-mgmt
2049 32770/tcp  open        sometimes-rpc3
2051 Nmap run completed -- 1 IP address (1 host up) scanned in 1 second
2052 </screen>
2053                         The above scan was run before the external interface was locked down with the NAT-firewall
2054                         script you created above. The following results are obtained after the firewall rules
2055                         have been put into place:
2056 <screen>
2057 &rootprompt; nmap -v -sT server.abmas.us
2059 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2060 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2061 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2062 Adding open port 53/tcp
2063 Adding open port 22/tcp
2064 The Connect() Scan took 168 seconds to scan 1601 ports.
2065 Interesting ports on server.abmas.us (123.45.67.66):
2066 (The 1593 ports scanned but not shown below are in state: filtered)
2067 Port       State       Service
2068 22/tcp     open        ssh
2069 25/tcp     closed      smtp
2070 53/tcp     open        domain
2071 80/tcp     closed      http
2072 443/tcp    closed      https
2074 Nmap run completed -- 1 IP address (1 host up) scanned in 168 seconds
2075 </screen>
2076                         </para></step>
2077         
2078                 </procedure>
2080         </sect2>
2082         <sect2 id="ch4appscfg">
2083         <title>Application Share Configuration</title>
2085         <para>
2086         <indexterm><primary>application server</primary></indexterm>
2087         <indexterm><primary>administrative installation</primary></indexterm>
2088         The use of an application server is a key mechanism by which desktop administration overheads
2089         can be reduced. Check the application manual for your software to identify how best to
2090         create an administrative installation.
2091         </para>
2093         <para>
2094         Some Windows software will only run locally on the desktop computer. Such software
2095         is typically not suited for administrative installation. Administratively installed software
2096         permits one or more of the following installation choices:
2097         </para>
2099         <itemizedlist>
2100                 <listitem><para>
2101                 Install software fully onto a workstation, storing data files on the same workstation.
2102                 </para></listitem>
2104                 <listitem><para>
2105                 Install software fully onto a workstation with central network data file storage.
2106                 </para></listitem>
2108                 <listitem><para>
2109                 Install software to run off a central application server with data files stored
2110                 on the local workstation. This is often called a minimum installation, or a
2111                 network client installation.
2112                 </para></listitem>
2114                 <listitem><para>
2115                 Install software to run off a central application server with data files stored
2116                 on a central network share. This type of installation often prevents storage
2117                 of work files on the local workstation.
2118                 </para></listitem>
2119         </itemizedlist>
2121         <para>
2122         <indexterm><primary></primary></indexterm>
2123         A common application deployed in this environment is an office suite.
2124         Enterprise editions of Microsoft Office XP Professional can be administratively installed
2125         by launching the installation from a command shell. The command that achieves this is
2126         <command>setup /a</command>. It results in a set of prompts through which various
2127         installation choices can be made. Refer to the Microsoft Office Resource SDK and Resource
2128         Kit for more information regarding this mode of installation of MS Office XP Professional.
2129         The full administrative installation of MS Office XP Professional requires approximately
2130         650 MB of disk space.
2131         </para>
2133         <para>
2134         When the MS Office XP Professional product has been installed to the administrative network
2135         share, the product can be installed onto a workstation by executing the normal setup program.
2136         The installation process now provides a choice to either perform a minimum installation
2137         or a full local installation. A full local installation takes over 100 MB of disk space.
2138         A network workstation (minimum) installation requires typically 10 MB to 15 MB of
2139         local disk space. In the latter case, when the applications are used, they load over the network.
2140         </para>
2142         <para>
2143         <indexterm><primary>Service Packs</primary></indexterm>
2144         <indexterm><primary>Microsoft Office</primary></indexterm>
2145         Microsoft Office Service Packs can be unpacked to update an administrative share. This makes
2146         it possible to update MS Office XP Professional for all users from a single installation
2147         of the service pack and generally circumvents the need to run updates on each network
2148         Windows client.
2149         </para> 
2151         <para>
2152         The default location for MS Office XP Professional data files can be set through registry
2153         editing or by way of configuration options inside each Office XP Professional application.
2154         </para>
2156         <para>
2157         <indexterm><primary>OpenOffice</primary></indexterm>
2158         OpenOffice.Org OpenOffice Version 1.1.0 can be installed locally. It can also
2159         be installed to run off a network share. The latter is a most desirable solution for office-bound 
2160         network users and for administrative staff alike. It permits quick and easy updates
2161         to be rolled out to all users with a minimum of disruption and with maximum flexibility.
2162         </para>
2164         <para>
2165         The process for installation of administrative shared OpenOffice involves download of the
2166         distribution ZIP file, followed by extraction of the ZIP file into a temporary disk area.
2167         When fully extracted using the unzipping tool of your choosing, change into the Windows
2168         installation files directory then execute <command>setup -net</command>. You are
2169         prompted on screen for the target installation location. This is the administrative
2170         share point. The full administrative OpenOffice share takes approximately 150 MB of disk
2171         space.
2172         </para>
2174                 <sect3>
2175                 <title>Comments Regarding Software Terms of Use</title>
2176                         <para>
2177                         Many single-user products can be installed into an administrative share, but
2178                         personal versions of products such as Microsoft Office XP Professional do not permit this. 
2179                         Many people do not like terms of use typical with commercial products, so a few comments
2180                         regarding software licensing seem important.
2181                         </para>
2183                         <para>
2184                         Please do not use an administrative installation of proprietary and commercially licensed 
2185                         software products to violate the copyright holders' property. All software is licensed,
2186                         particularly software that is licensed for use free of charge. All software is the property
2187                         of the copyright holder unless the author and/or copyright holder has explicitly disavowed
2188                         ownership and has placed the software into the public domain.
2189                         </para>
2191                         <para>
2192                         Software that is under the GNU General Public License, like proprietary software, is 
2193                         licensed in a way that restricts use. For example, if you modify GPL software and then
2194                         distribute the binary version of your modifications, you must offer to provide the source
2195                         code as well. This restriction is designed to maintain the momentum
2196                         of the diffusion of technology and to protect against the withholding of innovations.
2197                         </para>
2199                         <para>
2200                         Commercial and proprietary software generally restrict use to those who have paid the
2201                         license fees and who comply with the licensee's terms of use. Software that is released
2202                         under the GNU General Public License is restricted to particular terms and conditions
2203                         also. Whatever the licensing terms may be, if you do not approve of the terms of use,
2204                         please do not use the software.
2205                         </para>
2207                         <para>
2208                         <indexterm><primary>GPL</primary></indexterm>
2209                         Samba is provided under the terms of the GNU GPL Version 2, a copy of which is provided
2210                         with the source code.
2211                         </para>
2212                 </sect3>
2214         </sect2>
2216         <sect2 id="ch4wincfg">
2217         <title>Windows Client Configuration</title>
2219         <para>
2220         Christine needs to roll out 130 new desktop systems. There is no doubt that she also needs
2221         to reinstall many of the notebook computers that will be recycled for use with the new network 
2222         configuration. The smartest way to handle the challenge of the roll-out program is to build
2223         a staged system for each type of target machine, and then use an image replication tool such as Norton
2224         Ghost (enterprise edition) to replicate the staged machine to its target desktops. The same can
2225         be done with notebook computers as long as they are identical or sufficiently similar.
2226         </para>
2228         <procedure id="sbewinclntprep">
2229         <title>Windows Client Configuration Procedure</title>
2231                 <step><para>
2232                 <indexterm><primary>WINS</primary></indexterm>
2233                 <indexterm><primary>DHCP</primary></indexterm>
2234                 Install MS Windows XP Professional. During installation, configure the client to use DHCP for 
2235                 TCP/IP protocol configuration. DHCP configures all Windows clients to use the WINS Server
2236                 address that has been defined for the local subnet.
2237                 </para></step>
2239                 <step><para>
2240                 Join the Windows Domain <constant>PROMISES</constant>. Use the Domain Administrator
2241                 username <constant>root</constant> and the SMB password you assigned to this account.
2242                 A detailed step-by-step procedure for joining a Windows 200x/XP Professional client to
2243                 a Windows Domain is given in Appendix A, <link linkend="domjoin"/>. 
2244                 Reboot the machine as prompted and then log on using the Domain Administrator account
2245                 (<constant>root</constant>).
2246                 </para></step>
2248                 <step><para>
2249                 Verify <constant>DIAMOND</constant> is visible in <guimenu>My Network Places</guimenu>, 
2250                 that it is possible to connect to it and see the shares <guimenuitem>accounts</guimenuitem>,
2251                 <guimenuitem>apps</guimenuitem>, and <guimenuitem>finsvcs</guimenuitem>, and that it is
2252                 possible to open each share to reveal its contents.
2253                 </para></step>
2255                 <step><para>
2256                 Create a drive mapping to the <constant>apps</constant> share on the server <constant>DIAMOND</constant>.
2257                 </para></step>
2259                 <step><para>
2260                 Perform an administrative installation of each application to be used. Select the options
2261                 that you wish to use. Of course, you can choose to run applications over the network, correct?
2262                 </para></step>
2264                 <step><para>
2265                 Now install all applications to be installed locally. Typical tools include Adobe Acrobat,
2266                 NTP-based time synchronization software, drivers for specific local devices such as fingerprint
2267                 scanners, and the like. Probably the most significant application for local installation
2268                 is antivirus software.
2269                 </para></step>
2271                 <step><para>
2272                 Now install all four printers onto the staging system. The printers you install
2273                 include the accounting department HP LaserJet 6 and Minolta QMS Magicolor printers. You will
2274                 also configure identical printers that are located in the financial services department.
2275                 Install printers on each machine following the steps shown in the Windows client printer
2276                 preparation procedure below.
2277                 </para></step>
2279                 <step><para>
2280                 <indexterm><primary>defragmentation</primary></indexterm>
2281                 When you are satisfied that the staging systems are complete, use the appropriate procedure to
2282                 remove the client from the domain. Reboot the system and then log on as the local administrator
2283                 and clean out all temporary files stored on the system. Before shutting down, use the disk
2284                 defragmentation tool so that the file system is in optimal condition before replication.
2285                 </para></step>
2287                 <step><para>
2288                 Boot the workstation using the Norton (Symantec) Ghosting diskette (or CD-ROM) and image the
2289                 machine to a network share on the server.
2290                 </para></step>
2292                 <step><para>
2293                 <indexterm><primary>Windows security identifier</primary><see>SID</see></indexterm>
2294                 <indexterm><primary>SID</primary></indexterm>
2295                 You may now replicate the image to the target machines using the appropriate Norton Ghost 
2296                 procedure. Make sure to use the procedure that ensures each machine has a unique
2297                 Windows security identifier (SID). When the installation of the disk image has completed, boot the PC. 
2298                 </para></step>
2300                 <step><para>
2301                 Log onto the machine as the local Administrator (the only option), and join the machine to
2302                 the Domain, following the procedure set out in Appendix A, <link linkend="domjoin"/>. The system is now 
2303                 ready for the user to log on, provided you have created a network logon account for that 
2304                 user, of course.
2305                 </para></step>
2307                 <step><para>
2308                 Instruct all users to log onto the workstation using their assigned username and password.
2309                 </para></step>
2310         </procedure>
2312         <procedure id="sbewinclntptrprep">
2313         <title>Windows Client Printer Preparation Procedure</title>
2315                 <step><para>
2316                 Click <menuchoice>
2317                         <guimenu>Start</guimenu>
2318                         <guimenuitem>Settings</guimenuitem>
2319                         <guimenuitem>Printers</guimenuitem>
2320                         <guiicon>Add Printer</guiicon>
2321                         <guibutton>Next</guibutton>
2322                         </menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
2323                         Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
2324                 </para></step>
2326                 <step><para>
2327                 Click <guibutton>Next</guibutton>. In the
2328                 <guimenuitem>Manufacturer:</guimenuitem> panel, select <constant>HP</constant>.
2329                 In the <guimenuitem>Printers:</guimenuitem> panel, select the printer called
2330                 <constant>HP LaserJet 6</constant>. Click <guibutton>Next</guibutton>.
2331                 </para></step>
2333                 <step><para>
2334                 In the <guimenuitem>Available ports:</guimenuitem> panel, select
2335                 <constant>FILE:</constant>. Accept the default printer name by clicking
2336                 <guibutton>Next</guibutton>. When asked, <quote>Would you like to print a
2337                 test page?,</quote> click <guimenuitem>No</guimenuitem>. Click
2338                 <guibutton>Finish</guibutton>.
2339                 </para></step>
2341                 <step><para>
2342                 You may be prompted for the name of a file to print to. If so, close the
2343                 dialog panel. Right-click <menuchoice>
2344                         <guiicon>HP LaserJet 6</guiicon>
2345                         <guimenuitem>Properties</guimenuitem>
2346                         <guisubmenu>Details (Tab)</guisubmenu>
2347                         <guimenuitem>Add Port</guimenuitem>
2348                         </menuchoice>.
2349                 </para></step>
2351                 <step><para>
2352                 In the <guimenuitem>Network</guimenuitem> panel, enter the name of
2353                 the print queue on the Samba server as follows: <constant>\\DIAMOND\hplj6a</constant>.
2354                 Click <menuchoice> 
2355                         <guibutton>OK</guibutton>
2356                         <guibutton>OK</guibutton>
2357                         </menuchoice> to complete the installation.
2358                 </para></step>
2360                 <step><para>
2361                 Repeat the printer installation steps above for both HP LaserJet 6 printers
2362                 as well as for both QMS Magicolor laser printers.
2363                 </para></step>
2364         </procedure>
2366         </sect2>
2368         <sect2>
2369         <title>Key Points Learned</title>
2371                 <para>
2372                 How do you feel? You have built a capable network, a truly ambitious project.
2373                 Future network updates can be handled by
2374                 your staff. You must be a satisfied manager. Let's review the achievements.
2375                 </para>
2377                 <itemizedlist>
2378                         <listitem><para>
2379                         A simple firewall has been configured to protect the server in the event that
2380                         the ISP firewall service should fail.
2381                         </para></listitem>
2383                         <listitem><para>
2384                         The Samba configuration uses measures to ensure that only local network users
2385                         can connect to SMB/CIFS services.
2386                         </para></listitem>
2388                         <listitem><para>
2389                         Samba uses the new <constant>tdbsam</constant> passdb backend facility.
2390                         Considerable complexity was added to Samba functionality.
2391                         </para></listitem>
2393                         <listitem><para>
2394                         A DHCP server was configured to implement dynamic DNS (DDNS) updates to the DNS
2395                         server.
2396                         </para></listitem>
2398                         <listitem><para>
2399                         The DNS server was configured to permit DDNS only for local network clients. This
2400                         server also provides primary DNS services for the company Internet presence.
2401                         </para></listitem>
2403                         <listitem><para>
2404                         You introduced an application server as well as the concept of cloning a Windows
2405                         client in order to effect improved standardization of desktops and to reduce
2406                         the costs of network management.
2407                         </para></listitem>
2408                 </itemizedlist>
2410         </sect2>
2412 </sect1>
2414 <sect1>
2415         <title>Questions and Answers</title>
2417         <para>
2418         </para>
2420         <qandaset>
2421         <qandaentry>
2422         <question>
2424                 <para>
2425                 What is the maximum number of account entries that the <parameter>tdbsam</parameter>
2426                 passdb backend can handle?
2427                 </para>
2429         </question>
2430         <answer>
2432                 <para>
2433                 The tdb data structure and support system can handle more entries than the number of
2434                 accounts that are possible on most UNIX systems. A practical limit would come into
2435                 play long before a performance boundary would be anticipated. That practical limit
2436                 is controlled by the nature of Windows networking. There are few Windows file and
2437                 print servers that can handle more than a few hundred concurrent client connections.
2438                 The key limiting factors that predicate offloading of services to additional servers
2439                 are memory capacity, the number of CPUs, network bandwidth, and disk I/O limitations.
2440                 All of these are readily exhausted by just a few hundred concurrent active users.
2441                 Such bottlenecks can best be removed by segmentation of the network (distributing
2442                 network load across multiple networks).
2443                 </para>
2445                 <para>
2446                 As the network grows, it becomes necessary to provide additional authentication
2447                 servers (domain controllers).  The tdbsam is limited to a single machine and cannot
2448                 be reliably replicated.  This means that practical limits on network design dictate
2449                 the point at which a distributed passdb backend is required; at this time, there is
2450                 no real alternative other than ldapsam (LDAP).
2451                 </para>
2453                 <para>
2454                 The guideline provided in <emphasis>TOSHARG</emphasis>, Chapter 10, Section 10.1.2,
2455                 is to limit the number of accounts in the tdbsam backend to 250. This is the point
2456                 at which most networks tend to want backup domain controllers (BDCs). Samba-3 does
2457                 not provide a mechanism for replicating tdbsam data so it can be used by a BDC. The
2458                 limitation of 250 users per tdbsam is predicated only on the need for replication,
2459                 not on the limits<footnote><para>Bench tests have shown that tdbsam is a very
2460                 effective database technology.  There is surprisingly little performance loss even
2461                 with over 4000 users.</para></footnote> of the tdbsam backend itself. 
2462                 </para>
2464         </answer>
2465         </qandaentry>
2467         <qandaentry>
2468         <question>
2470                 <para>
2471                 Would Samba operate any better if the OS level is set to a value higher than 35?
2472                 </para>
2474         </question>
2475         <answer>
2477                 <para>
2478                 No. MS Windows workstations and servers do not use a value higher than 33. Setting this to a value
2479                 of 35 already assures Samba of precedence over MS Windows products in browser elections. There is
2480                 no gain to be had from setting this higher.
2481                 </para>
2483         </answer>
2484         </qandaentry>
2486         <qandaentry>
2487         <question>
2489                 <para>
2490                 Why in this example have you provided UNIX group to Windows Group mappings for only Domain Groups?
2491                 </para>
2493         </question>
2494         <answer>
2496                 <para>
2497                 At this time, Samba has the capacity to use only Domain Groups mappings. It is possible that at
2498                 a later date Samba may make use of Windows Local Groups, as well as of the Active Directory special
2499                 Groups. Proper operation requires Domain Groups to be mapped to valid UNIX groups.
2500                 </para>
2502         </answer>
2503         </qandaentry>
2505         <qandaentry>
2506         <question>
2508                 <para>
2509                 Why has a path been specified in the <parameter>IPC$</parameter> share?
2510                 </para>
2512         </question>
2513         <answer>
2515                 <para>
2516                 This is done so that in the event that a software bug may permit a client connection to the IPC$ share to
2517                 obtain access to the file system, it does so at a location that presents least risk. Under normal operation
2518                 this type of paranoid step should not be necessary. The use of this parameter should not be necessary. 
2519                 </para>
2521         </answer>
2522         </qandaentry>
2524         <qandaentry>
2525         <question>
2527                 <para>
2528                 Why does the &smb.conf; file in this exercise include an entry for <smbconfoption name="smb ports"/>?
2529                 </para>
2531         </question>
2532         <answer>
2534                 <para>
2535                 The default order by which Samba-3 attempts to communicate with MS Windows clients is via port 445 (the TCP port
2536                 used by Windows clients when NetBIOS-less SMB over TCP/IP is in use). TCP port 139 is the primary port used for NetBIOS
2537                 over TCP/IP. In this configuration Windows network operations are predicated around NetBIOS over TCP/IP. By
2538                 specifying the use of port 139 before port 445, the intent is to reduce unsuccessful service connection attempts.
2539                 The result of this is improved network performance. Where Samba-3 is installed as an Active Directory Domain
2540                 member, the default behavior is highly beneficial and should not be changed.
2541                 </para>
2543         </answer>
2544         </qandaentry>
2546         <qandaentry>
2547         <question>
2549                 <para>
2550                 What is the difference between a print queue and a printer?
2551                 </para>
2553         </question>
2554         <answer>
2556                 <para>
2557                 A printer is a physical device that is connected either directly to the network or to a computer 
2558                 via a serial, parallel, or USB connection so that print jobs can be submitted to it to create a 
2559                 hard copy printout. Network-attached printers that use TCP/IP-based printing generally accept a 
2560                 single print data stream and block all secondary attempts to dispatch jobs concurrently to the 
2561                 same device. If many clients were to concurrently print directly via TCP/IP to the same printer, 
2562                 it would result in a huge amount of network traffic through continually failing connection attempts.
2563                 </para>
2565                 <para>
2566                 A print server (like CUPS or LPR/LPD) accepts multiple concurrent input streams or
2567                 print requests. When the data stream has been fully received, the input stream is closed,
2568                 and the job is then submitted to a sequential print queue where the job is stored until
2569                 the printer is ready to receive the job.
2570                 </para>
2572         </answer>
2573         </qandaentry>
2575         <qandaentry>
2576         <question>
2578                 <para>
2579                 Can all MS Windows application software be installed onto an application server share?
2580                 </para>
2582         </question>
2583         <answer>
2585                 <para>
2586                 Much older Windows software is not compatible with installation to and execution from
2587                 an application server. Enterprise versions of Microsoft Office XP Professional can
2588                 be installed to an application server. Retail consumer versions of Microsoft Office XP
2589                 Professional do not permit installation to an application server share and can be installed
2590                 and used only to/from a local workstation hard disk.
2591                 </para>
2593         </answer>
2594         </qandaentry>
2596         <qandaentry>
2597         <question>
2599                 <para>
2600                 Why use dynamic DNS (DDNS)?
2601                 </para>
2603         </question>
2604         <answer>
2606                 <para>
2607                 When DDNS records are updated directly from the DHCP server, it is possible for
2608                 network clients that are not NetBIOS-enabled, and thus cannot use WINS, to locate
2609                 Windows clients via DNS.
2610                 </para>
2612         </answer>
2613         </qandaentry>
2615         <qandaentry>
2616         <question>
2618                 <para>
2619                 Why would you use WINS as well as DNS-based name resolution?
2620                 </para>
2622         </question>
2623         <answer>
2625                 <para>
2626                 WINS is to NetBIOS names as DNS is to fully qualified domain names (FQDN). The FQDN is
2627                 a name like <quote>myhost.mydomain.tld</quote> where <parameter>tld</parameter>
2628                 means <constant>top-level domain</constant>. A FQDN is a longhand but easy-to-remember
2629                 expression that may be up to 1024 characters in length and that represents an IP address. 
2630                 A NetBIOS name is always 16 characters long. The 16<superscript>th</superscript> character
2631                 is a name type indicator. A specific name type is registered<footnote><para>
2632                 See <emphasis>TOSHARG</emphasis>, Chapter 9, for more information.</para></footnote> for each 
2633                 type of service that is provided by the Windows server or client and that may be registered
2634                 where a WINS server is in use.
2635                 </para>
2637                 <para>
2638                 WINS is a mechanism by which a client may locate the IP Address that corresponds to a
2639                 NetBIOS name. The WINS server may be queried to obtain the IP Address for a NetBIOS name 
2640                 that includes a particular registered NetBIOS name type. DNS does not provide a mechanism
2641                 that permits handling of the NetBIOS name type information.
2642                 </para>
2644                 <para>
2645                 DNS provides a mechanism by which TCP/IP clients may locate the IP address of a particular 
2646                 hostname or service name that has been registered in the DNS database for a particular domain. 
2647                 A DNS server has limited scope of control and is said to be authoritative for the zone over
2648                 which it has control.
2649                 </para>
2651                 <para>
2652                 Windows 200x Active Directory requires the registration in the DNS zone for the domain it 
2653                 controls of service locator<footnote><para>See TOSHARG, Chapter 9, Section 9.3.3.</para></footnote> records 
2654                 that Windows clients and servers will use to locate Kerberos and LDAP services. ADS also 
2655                 requires the registration of special records that are called global catalog (GC) entries 
2656                 and site entries by which domain controllers and other essential ADS servers may be located. 
2657                 </para>
2659         </answer>
2660         </qandaentry>
2662         <qandaentry>
2663         <question>
2665                 <para>
2666                 What are the major benefits of using an application server?
2667                 </para>
2669         </question>
2670         <answer>
2672                 <para>
2673                 The use of an application server can significantly reduce application update maintenance.
2674                 By providing a centralized application share, software updates need be applied to only
2675                 one location for all major applications used. This results in faster update roll-outs and
2676                 significantly better application usage control.
2677                 </para>
2679         </answer>
2680         </qandaentry>
2682         </qandaset>
2684 </sect1>
2686 </chapter>