Validation updates to Samba3 By Example
[ira/wip.git] / docs / Samba-Guide / Chap02-SimpleOfficeServer.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="simple">
4   <title>No Frills Samba Servers</title>
5
6         <para>
7         Congratulations, you managed to get past the opening chapter. To some, this is where the interesting
8         exercises begin. This is the start of the real journey toward the Samba deployment of a lifetime.
9         </para>
10
11 <sect1>
12         <title>Introduction</title>
13
14         <para>
15         This chapter lays the groundwork for understanding the basics of Samba operation. 
16         Instead of a bland technical discussion, each principle is demonstrated by way of a 
17         real-world scenario for which a working solution<footnote><para>The examples given mirror those documented
18         in TOSHARG Chapter 2, Section 2.3.1. You may gain additional insight from the Stand-alone server
19         configurations covered in TOSHARG sections 2.3.1.2 through 2.3.1.4.
20         </para></footnote> is fully described.
21         </para>
22
23         <para>
24         The practical exercises take you on a journey through a drafting office, a charity administration
25         office, and an accounting office. You may choose to apply any or all of these to your own environment.
26         </para>
27
28         <para>
29         Every assignment case can be implemented far more creatively, but remember that the solutions you
30         create are designed to demonstrate a particular solution possibility. With experience, you should
31         find much improved solutions compared with those presented here. By the time you complete this book,
32         you should aim to be a Samba expert, so do attempt to find better solutions and try them as you work your
33         way through the examples.
34         </para>
35
36 </sect1>
37 <sect1>
38         <title>Assignment Tasks</title>
39
40         <para>
41         Each case presented highlights different aspects of Windows networking for which a simple 
42         Samba-based solution can be provided. Each has subtly different requirements taken from real-world cases.
43         Each is briefly reviewed to cover points of highlight. In each example, instructions are based
44         on the assumption that the official Samba Team RPM package has been installed.
45         </para>
46
47         <para>
48         This chapter has three assignments built around ficticious companies: 
49         </para>
50
51         <para>
52         <itemizedlist>
53                 <listitem><para>A drafting office</para></listitem>
54                 <listitem><para>A charity administration office</para></listitem>
55                 <listitem><para>An accounting office</para></listitem>
56         </itemizedlist>
57         </para>
58
59         <para>
60         Let's get started.
61         </para>
62
63         <sect2>
64         <title>Drafting Office</title>
65
66         <para>
67         Our fictitious company is called <emphasis>Abmas Design Inc.</emphasis> This is a three-person
68         computer-aided design (CAD) business that often has more work than can be handled. The 
69         business owner hires contract draftspeople from wherever he can. They bring their own 
70         notebook computers into the office. There are four permanent drafting machines. Abmas has a 
71         collection of over 10 years of plans that must be available for all draftsmen to reference. 
72         Abmas hires the services of an experienced network engineer to update the 
73         plans that are stored on a central server one day per month. She knows how to upload 
74         plans from each machine. The files available from the server must remain read-only. 
75         Anyone should be able to access the plans at any time and without barriers or difficulty.
76         </para>
77
78         <para><indexterm><primary>Red Hat</primary></indexterm>
79                 <indexterm><primary>Fedora</primary></indexterm>
80         Mr. Bob Jordan has asked you to install the new server as economically as possible. The central
81         server has a Pentium-IV 1.6GHz CPU, 768MB RAM, a 20GB IDE boot drive, a 160GB IDE second disk
82         to store plans, and a 100-base-T Ethernet card. You have already installed Red Hat Fedora Core2 and
83         have upgraded Samba to version 3.0.12 using the RPM package that is provided from the Samba
84         <ulink url="http://www.samba.org">FTP</ulink> sites.
85         </para>
86
87         <para><indexterm>
88             <primary>consultant</primary>
89           </indexterm>
90         The four permanent drafting machines (Microsoft Windows workstations) have attached printers 
91         and plotters that are shared on a peer-to-peer basis by any/all network users. The intent 
92         is to continue to share printers in this manner. The three permanent staff work together with 
93         all contractors to store all new work on one PC. A daily copy is made of the work storage 
94         area to another PC for safekeeping.  When the network consultant arrives, the weekly work 
95         area is copied to the central server and the files are removed from the main weekly storage 
96         machine. The office works best with this arrangement and does not want to change anything. 
97         Old habits are too ingrained.
98         </para>
99
100                 <sect3>
101                 <title>Dissection and Discussion</title>
102
103           <para><indexterm>
104               <primary>file server</primary>
105               <secondary>read-only</secondary>
106             </indexterm>
107                 The requirements for this server installation demand simplicity. An anonymous read-only
108                 file server adequately meets all needs. The network consultant determines how
109                 to upload all files from the weekly storage area to the server. This installation should
110                 focus only on critical aspects of the installation.
111                 </para>
112
113                 <para>
114                 It is not necessary to have specific users on the server. The site has a method for storing
115                 all design files (plans). Each plan is stored in a directory that is named YYYYWW<footnote><para>
116                 This information is given purely as an example of how data may be stored in such a way that it
117                 will be easy to locate records at a later date. The example is not meant to imply any instructions
118                 that may be construed as essential to the design of the solution, this is something you will almost
119                 certainly want to determine for yourself.</para></footnote>, where
120                 YYYY is the year, and WW is the week of the year. This arrangement allows work to be stored
121                 by week of year to preserve the filing technique the site is familiar with.
122                 There is another customer directory that is alphabetically listed. At the top level are 26
123                 directories (A-Z), in each is a second level of directory for the first plus second letter of the name
124                 (A-Z); inside each is a directory by the customers' name. Inside each directory is a symbolic
125                 link to each design drawing/plan. This way of storing customer data files permits all
126                 plans to be located both by customer name, as well as by the date the work was performed, without
127                 demanding the disk space that would be needed if a duplicate file copy were to be stored. 
128                 The share containing the plans is called <emphasis>Plans</emphasis>.
129                 </para>
130
131                 </sect3>
132
133                 <sect3>
134                 <title>Implementation</title>
135
136                 <para>
137                 It is assumed that the server is fully installed and ready for installation and 
138                 configuration of Samba 3.0.12 and any support files needed. All TCP/IP addresses 
139                 have been hard coded. In our case the IP address of the Samba server is 
140                 <constant>192.168.1.1</constant> and the netmask is <constant>255.255.255.0</constant>. 
141                 The host name of the server used was <constant>server</constant>.
142                 </para>
143
144                 <procedure>
145                 <title>Samba Server Configuration</title>
146
147                         <step><para>
148                         Download the Samba-3 RPM packages for Red Hat Fedora Core2 from the Samba
149                         <ulink url="http://www.samba.org">FTP servers.</ulink>
150                         </para></step>
151
152             <step><para><indexterm>
153                   <primary>RPM</primary>
154                   <secondary>install</secondary>
155                 </indexterm><indexterm>
156                   <primary>package</primary>
157                 </indexterm>
158                         Install the RPM package as using either the Red Hat Linux preferred GUI
159                         tool or using the <command>rpm</command>, as follows:
160 <screen>
161 &rootprompt; rpm -Uvh samba-3.0.12-1.i386.rpm
162 </screen>
163                         </para></step>
164
165                         <step><para>
166                         Create a mount point for the file system that will be used to store all data files.
167                         You can create a directory called <filename>/plans</filename> as follows:
168 <screen>
169 &rootprompt; mkdir /plans
170 &rootprompt; chmod 755 /plans
171 </screen>
172                         The 755 permissions on this directory (mount point) permit the owner to read, write
173                         and execute, and the group and everyone else to read and execute only.
174                         </para>
175
176               <para><indexterm>
177                   <primary>file system</primary>
178                   <secondary>Ext3</secondary>
179                 </indexterm>
180                         Use Red Hat Linux system tools (refer to Red Hat instructions for instructions)
181                         to format the 160GB hard drive with a suitable file system. An Ext3 file system
182                         is suitable. Configure this drive to automatically mount using the <filename>/plans</filename>
183                         directory as the mount point.
184                         </para></step>
185
186                         <step><para>
187                         Install the &smb.conf; file shown in <link linkend="draft-smbconf"/> in the
188                         <filename>/etc/samba</filename> directory.
189
190 <smbconfexample id="draft-smbconf">
191 <title>Drafting Office &smb.conf; File</title>
192 <smbconfcomment>Global Parameters</smbconfcomment>
193 <smbconfsection name="[global]"/>
194 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
195 <smbconfoption name="security">SHARE</smbconfoption>
196
197 <smbconfsection name="[Plans]"/>
198 <smbconfoption name="path">/plans</smbconfoption>
199 <smbconfoption name="read only">Yes</smbconfoption>
200 <smbconfoption name="guest ok">Yes</smbconfoption>
201 </smbconfexample>
202                         </para></step>
203
204             <step><para><indexterm>
205                   <primary>/etc/hosts</primary>
206                 </indexterm>
207                         Verify that the <filename>/etc/hosts</filename> file contains the following entry:
208 <screen>
209 192.168.1.1     server
210 </screen>
211                         </para></step>
212
213             <step><para><indexterm>
214                   <primary>samba</primary>
215                   <secondary>starting samba</secondary>
216                 </indexterm><indexterm>
217                   <primary>chkconfig</primary>
218                 </indexterm>
219                         <indexterm><primary>starting samba</primary></indexterm>
220                         Use the standard system tool to start Samba and to configure it to restart
221                         automatically at every system reboot. For example:
222 <screen>
223 &rootprompt; chkconfig smb on
224 &rootprompt; /etc/rc.d/init.d/smb restart
225 </screen>
226                         </para></step>
227
228                 </procedure>
229
230                 <procedure>
231                 <title>Windows Client Configuration</title>
232
233                         <step><para>
234                         Make certain that all clients are set to the same network address range as
235                         has been used for the Samba server. For example, one client might have an IP
236                         address 192.168.1.10.
237                         </para></step>
238
239             <step><para><indexterm>
240                   <primary>netmask</primary>
241                 </indexterm>
242                         Ensure that the netmask used on the Windows clients matches that used
243                         for the Samba server. All clients must have the same netmask. For example,
244                         255.255.255.0.
245                         </para></step>
246
247             <step><para><indexterm>
248                   <primary>workgroup</primary>
249                 </indexterm>
250                         Set the workgroup name on all clients to <constant>MIDEARTH</constant>.
251                         </para></step>
252
253                         <step><para>
254                         Verify on each client that the machine called <constant>SERVER</constant>
255                         is visible in the <guimenu>Network Neighborhood</guimenu>, that it is
256                         possible to connect to it and see the share <guimenuitem>Plans</guimenuitem>,
257                         and that it is possible to open that share to reveal its contents.
258                         </para></step>
259
260                 </procedure>
261
262                 </sect3>
263
264                 <sect3 id="validate1">
265                 <title>Validation</title>
266
267           <para><indexterm>
268               <primary>validation</primary>
269             </indexterm>
270                 The first priority in validating the new Samba configuration should be to check
271                 that Samba answers on the loop-back interface. Then it is time to check that Samba
272                 answers its own name correctly. Last, check that a client can connect to the Samba
273                 server.
274                 </para>
275
276                 <procedure>
277             <step><para><indexterm>
278                   <primary>smbd</primary>
279                 </indexterm><indexterm>
280                   <primary>daemon</primary>
281                 </indexterm><indexterm>
282                   <primary>smbclient</primary>
283                 </indexterm>
284                         To check the ability to access the <command>smbd</command> daemon
285                         services, execute the following:
286 <screen>
287 &rootprompt; smbclient -L localhost -U%
288         Sharename     Type     Comment
289         ---------     ----     -------
290         Plans         Disk
291         IPC$          IPC      IPC Service (Samba 3.0.12)
292         ADMIN$        IPC      IPC Service (Samba 3.0.12)
293
294         Server             Comment
295         ---------          -------
296         SERVER             Samba 3.0.12
297
298         Workgroup          Master
299         ---------          --------
300         MIDEARTH           SERVER 
301 </screen>
302                 <indexterm>
303                   <primary>loopback</primary>
304                 </indexterm><indexterm>
305                   <primary>NULL connection</primary>
306                 </indexterm>
307                         This indicates that Samba is able to respond on the loopback interface to
308                         a NULL connection. The <parameter>-U%</parameter> means send an empty
309                         username and an empty password. This command should be repeated after
310                         Samba has been running for 15 minutes.
311                         </para></step>
312
313                         <step><para>
314                         Now verify that Samba correctly handles being passed a username
315                         and password, and that it answers its own name. Execute the following:
316 <screen>
317 &rootprompt; smbclient -L server -Uroot%password
318 </screen>
319                         The output should be identical to the previous response. Samba has been
320                         configured to ignore all usernames given; instead it uses the
321                         <parameter>guest account</parameter> for all connections.
322                         </para></step>
323
324             <step><para><indexterm>
325                   <primary>Windows Explorer</primary>
326                 </indexterm><indexterm>
327                   <primary>Network Neighborhood</primary>
328                 </indexterm>
329                         From the Windows 9x/Me client, launch Windows Explorer, 
330                         <menuchoice>
331                                 <guiicon>[Desktop: right-click] Network Neighborhood</guiicon>
332                                 <guimenu>Explore</guimenu>
333                                 <guimenuitem>[Left Panel]  [+] Entire Network</guimenuitem>
334                                 <guimenuitem>[Left Panel] [+] Server</guimenuitem>
335                                 <guimenuitem>[Left Panel] [+] Plans</guimenuitem>
336                         </menuchoice>. In the right panel you should see the files and directories
337                         (folders) that are in the <guiicon>Plans</guiicon> share.
338                         </para></step>
339                 </procedure>
340
341                 </sect3>
342
343         </sect2>
344
345         <sect2>
346         <title>Charity Administration Office</title>
347
348         <para>
349         The fictitious charity organization is called <emphasis>Abmas Vision NL</emphasis>. This is an
350         office that has five networked computers. Staff are all volunteers with frequent staff changes.
351         Ms. Amy May, the director of operations, wants a no-hassle network. Anyone should be able to
352         use any PC. Only two Windows applications are used: a custom funds tracking and management package
353         that stores all files on the central server and Microsoft Word. The office prepares mail-out
354         letters, letters of invitation, and thank-you notes. All files must be stored in perpetuity.
355         The custom funds tracking and management (FTM) software has been configured to use a server named
356         <constant>SERVER</constant>, a share named <constant>FTMFILES</constant>, and a printer queue
357         named <constant>PRINTQ</constant> that uses preprinted stationery, thus demanding a
358         dedicated printer. This printer does not need to be mapped to a local printer on the workstations.
359         </para>
360
361         <para>
362         The FTM software has been in use since the days of Windows 3.11. The software was configured
363         by the vendor who has since gone out of business. The name of the identities of the file
364         server and the printer are hard coded in a configuration file that was created using a
365         setup tool that the vendor did not provide to Abmas Vision NL or to its predecessors. The
366         company that produced the software is no longer in business. In order to avoid risk of
367         any incompatibilities the share name and the name of the target print queue is being set
368         precisely as the application expects. In actual fact, share names and print queue names
369         should be treated as case insensitive (i.e.: Case does not matter) but Abmas Vision claim
370         that if the share name is not in lower case the application claims it can not find the
371         file share.
372         </para>
373
374         <para><indexterm>
375             <primary>print queue</primary>
376           </indexterm><indexterm>
377             <primary>print spooler</primary>
378           </indexterm>
379         Printer handling in Samba results in a significant level of confusion. Samba presents to the
380         MS Windows client only a print queue. The Samba <command>smbd</command> process passes a
381         print job sent to it from the Windows client to the native UNIX printing system. The native
382         UNIX printing system (spooler) places the job in a print queue from which it is
383         delivered to the printer. In this book, network diagrams refer to a printer by the name 
384         of the print queue that services that printer. It does not matter what the fully qualified 
385         name (or the host name) of a network attached printer is. The UNIX print spooler is configured 
386         to correctly deliver all jobs to the printer.
387         </para>
388
389         <para>
390         This organization has a policy forbidding use of privately owned computers on site as a measure
391         to prevent leakage of confidential information. Only the five PCs owned by Abmas Vision NL are
392         used on this network.
393         </para>
394
395         <para><indexterm>
396             <primary>SUSE Enterprise Linux Server</primary>
397           </indexterm>
398         The central server was donated by a local computer store. It is a dual processor Pentium-III
399         server, has 1GB RAM, a 3-Ware IDE RAID Controller that has 4 x 200GB IDE hard drives, and a
400         100-base-T network card. The office has 100-base-T permanent network connections that go to
401         a central hub and all equipment is new. The five network computers all are equipped with Microsoft
402         Windows Me. Funding is limited, so the server has no operating system on it. You have approval
403         to install Samba on Linux, but just make sure it works without problems. There are two HP LaserJet
404         5 PS printers that are network connected.  The second printer is to be used for general
405         office and letter printing. Your recommendation to allow only the Linux server to print directly
406         to the printers was accepted. You have supplied SUSE Enterprise Linux Server 9 and
407         have upgraded Samba to version 3.0.12.
408         </para>
409
410                 <sect3>
411                 <title>Dissection and Discussion</title>
412
413                 <para>
414             <indexterm><primary>force user</primary></indexterm><indexterm>
415               <primary>nt acl support</primary>
416             </indexterm><indexterm>
417               <primary>UID</primary>
418             </indexterm><indexterm>
419               <primary>Posix</primary>
420             </indexterm>
421                 This installation demands simplicity. Frequent turn-over of volunteer staff would indicate that
422                 a network environment that requires users to logon might be problematic. It is suggested that the
423                 best solution for this office would be one where the user can log onto any PC with any username
424                 and password. Samba can accommodate an office like this by using the <parameter>force user</parameter>
425                 parameter in share and printer definitions. The use of the <parameter>force user</parameter>
426                 ensures that all files are owned by same user identifier (UID) and thus ensures that there
427                 will never be a problem with file access due to file access permissions. Additionally, you elect
428                 to use the <parameter>nt acl support = No</parameter> option to ensure that no attempts can be
429                 made to write access control lists (Posix type) to any file or directory. This prevents
430                 an inadvertent ACL from overriding actual file permissions.
431                 </para>
432
433                 <para>
434                 <indexterm><primary>SUID</primary></indexterm>
435                 <indexterm><primary>SGID</primary></indexterm>
436                 <indexterm><primary>security</primary><secondary>share mode</secondary></indexterm>
437                 This organization is a prime candidate for Share Mode security. The <parameter>force user</parameter>
438                 allows all files to be owned by the same user and group. In addition to this, it would not hurt to
439                 set SUID and set SGID shared directories. This means that all new files that are created, no matter
440                 who creates it, are owned by the owner or group of the directory in which they are created.
441                 For further information regarding the significance of the SUID/SGID settings, see 
442                 <link linkend="ch12-SUIDSGID"/>.
443                 </para>
444
445                 <para>
446                 <indexterm><primary>CUPS</primary></indexterm>
447             <indexterm><primary>printing</primary><secondary>raw</secondary></indexterm><indexterm>
448               <primary>Red Hat Linux</primary>
449             </indexterm><indexterm>
450               <primary>SUSE Linux</primary>
451             </indexterm>
452                 All client workstations print to a print queue on the server. This ensures that print jobs
453                 continue to print in the event that a user may shut down the workstation immediately after
454                 sending a job to the printer. Today, both Red Hat Linux and SUSE Linux use CUPS-based printing. 
455                 Older Linux systems offered a choice to use either the LPRng printing system, or CUPS. It appears, however,
456                 that CUPS has now become the leading UNIX printing technology.
457                 </para>
458
459                 <para>
460                 <indexterm><primary>print queue</primary></indexterm>
461                 The print queues are set up as <constant>Raw</constant> devices, which means that CUPS will 
462                 not do intelligent print processing, and vendor supplied drivers be installed locally on the 
463                 Windows clients.
464                 </para>
465
466                 <para>
467                 The hypothetical software (Funds Tracking and Management) referred to is representative of 
468                 custom-built software that directly uses a NetBIOS interface. Most such software originated in
469                 the days of MS/PC DOS. NetBIOS names are upper-case (and functionally are case insensitive), 
470                 thus some old software applications would permit only upper-case names to be entered.
471                 Some such applications were later ported to MS Windows but retain the upper-case network
472                 resource naming conventions because customers are familiar with that. We made the decision
473                 to name shares and print queues for this application in upper-case also for the same reason.
474                 Nothing would break if you were to use lower-case names, but that decision might create a need
475                 to re-educate staff &smbmdash; something well avoided at this time.
476                 </para>
477
478                 <para>
479                 NetBIOS networking does not print directly to a printer. Instead, all printing is done to a
480                 print queue. The print spooling system is responsible for communicating with the physical
481                 printer. In this example, therefore, the resource that is referred to as <constant>PRINTQ</constant>
482                 really is just a print queue. The name of the print queue is held to be representative of
483                 the device to which the print spooler delivers print jobs.
484                 </para>
485
486                 </sect3>
487
488                 <sect3>
489                 <title>Implementation</title>
490
491                 <para>
492                 It is assumed that the server is fully installed and ready for configuration of
493                 Samba 3.0.12 and for necessary support files. All TCP/IP addresses should be hard coded.
494                 In our case, the IP address of the Samba server is 192.168.1.1 and the netmask is
495                 255.255.255.0. The host name of the server used was <constant>server</constant>.
496                 The office network is built as shown in <link linkend="charitynet"/>.
497                 </para>
498
499                 <image id="charitynet">
500                         <imagedescription>Charity Administration Office Network</imagedescription>
501                         <imagefile scale="66">Charity-Network</imagefile>
502                 </image>
503
504                 <procedure>
505                 <title>Samba Server Configuration</title>
506
507             <step><para><indexterm>
508                   <primary>groupadd</primary>
509                 </indexterm>
510                         Create a group account for office file storage as follows:
511 <screen>
512 &rootprompt; groupadd office
513 </screen>
514                         </para></step>
515
516             <step><para><indexterm>
517                   <primary>useradd</primary>
518                 </indexterm><indexterm>
519                   <primary>passwd</primary>
520                 </indexterm>
521                         Create a user account for office file storage as follows:
522 <screen>
523 &rootprompt; useradd -m abmas 
524 &rootprompt; passwd abmas 
525 Changing password for abmas.
526 New password: XXXXXXXX
527 Re-enter new password: XXXXXXXX
528 Password changed
529 </screen>
530                         where XXXXXXXX is a secret password.
531                         </para></step>
532
533                                 <step><para>
534                                 Use the 3-Ware IDE RAID Controller firmware utilities to configure the four 200GB
535                                 drives as a single RAID level 5 drive, with one drive set aside as the hot spare.
536                                 (Refer to the 3-Ware RAID Controller Manual for the manufacturers' preferred procedure.)
537                                 The resulting drive has a capacity of approximately 500GB of usable space.
538                                 </para></step>
539
540             <step><para><indexterm>
541                   <primary>permissions</primary>
542                 </indexterm>
543                                 Create a mount point for the file system that can be used to store all data files.
544                                 Create a directory called <filename>/data</filename> as follows:
545 <screen>
546 &rootprompt; mkdir /data
547 &rootprompt; chmod 755 /data
548 </screen>
549                                 The 755 permissions on this directory (mount point) permit the owner to read, write and execute,
550                                 and the group and everyone else to read and execute only.
551                                 </para></step>
552
553                                 <step><para>
554                                 Use SUSE Linux system tools (refer to the SUSE Administrators Guide for correct
555                                 procedures) to format the partition with a suitable file system. The reiserfs file system
556                                 is suitable. Configure this drive to automount using the <filename>/data</filename>
557                                 directory as the mount point. It must be mounted before proceeding.
558                                 </para></step>
559
560                                 <step><para>
561                                 Under the directory called <filename>/data</filename> create two directories
562                                 named <filename>ftmfiles</filename> and <filename>officefiles</filename>, and set
563                                 ownership and permissions as follows:
564 <screen>
565 &rootprompt; mkdir -p /data/{ftmfiles,officefiles/{letters,invitations,misc}}
566 &rootprompt; chown -R abmas.office /data
567 &rootprompt; chmod -R ug+rwxs,o-w,o+rx /data
568 </screen>
569                                 These demonstrate compound operations. The <command>mkdir</command> command
570                                 creates in one step these directories:
571 <programlisting>
572 /data/fmtfiles
573 /data/officefiles
574 /data/officefiles/letters
575 /data/officefiles/invitations
576 /data/officefiles/misc
577 </programlisting>
578                                 The <command>chown</command> operation sets the owner to the user <constant>abmas</constant>
579                                 and the group to <constant>office</constant> on all directories just created. And
580                                 the <command>chmod</command> operation recursively sets the permissions so that
581                                 the owner and group have SUID/SGID with read/write/execute permission, and everyone else has 
582                                 read and execute permission. This means that all files and directories are created
583                                 with the same owner and group as the directory in which they are created. Any new
584                                 directories created still have the same owner, group, and permissions as the
585                                 directory they are in. This should eliminate all permissions-based file access problems.
586                                 For more information on this subject, refer to <emphasis>TOSHARG</emphasis>, Chapter 13, <emphasis>File, Directory
587                                 and Share Access Controls</emphasis>, or refer to the UNIX man page for the 
588                                 <command>chmod</command> and the <command>chown</command> commands.
589                                 
590                                 </para></step>
591
592                                 <step><para>
593                                 Install the &smb.conf; file shown in <link linkend="charity-smbconf"/> in the
594                                 <filename>/etc/samba</filename> directory.
595                                 </para></step>
596
597                                 <step><para>
598                                 <indexterm><primary>smbd</primary></indexterm>
599                                 We must ensure that the <command>smbd</command> can resolve the name of the Samba
600                                 server to its IP address. Verify that the <filename>/etc/hosts</filename> file
601                                 contains the following entry:
602 <screen>
603 192.168.1.1     server
604 </screen>
605                                 </para></step>
606
607                                 <step><para>
608                                 Configure the printers with the IP address as shown in <link linkend="charitynet"/>.
609                                 Follow the instructions in the manufacturers' manual to permit printing to port 9100,
610                                 so that the CUPS spooler can print using raw mode protocols.
611                                 </para></step>
612
613             <step><para><indexterm>
614                   <primary>lpadmin</primary>
615                 </indexterm>
616                                 Configure the CUPS Print Queues as follows:
617 <screen>
618 &rootprompt; lpadmin -p PRINTQ -v socket://192.168.1.20:9100 -E
619 &rootprompt; lpadmin -p hplj5 -v socket://192.168.1.30:9100 -E
620 </screen>
621                                 This creates the necessary print queues with no assigned print filter.
622                                 </para></step>
623
624                                 <step><para>
625                 <indexterm><primary>mime type</primary></indexterm><indexterm>
626                   <primary>/etc/cups/mime.convs</primary>
627                 </indexterm><indexterm>
628                   <primary>application/octet-stream</primary>
629                 </indexterm>
630                                 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
631 <screen>
632 application/octet-stream     application/vnd.cups-raw      0     -
633 </screen>
634                                 </para></step>
635
636             <step><para><indexterm>
637                   <primary>/etc/cups/mime.types</primary>
638                 </indexterm>
639                                 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
640 <screen>
641 application/octet-stream
642 </screen>
643                                 </para></step>
644
645                                 <step><para>
646                                 <indexterm><primary>starting samba</primary></indexterm>
647                                 Use the standard system tool to start Samba and CUPS to configure them to restart
648                                 automatically at every system reboot. For example:
649                                 </para>
650
651                                 <para>
652                                 <indexterm><primary>starting samba</primary></indexterm>
653                 <indexterm><primary>starting
654                     CUPS</primary></indexterm><indexterm>
655                   <primary>chkconfig</primary>
656                 </indexterm>
657 <screen>
658 &rootprompt; chkconfig smb on
659 &rootprompt; chkconfig cups on
660 &rootprompt; /etc/rc.d/init.d/smb restart
661 &rootprompt; /etc/rc.d/init.d/cups restart
662 </screen>
663                                 </para></step>
664
665                         </procedure>
666
667 <smbconfexample id="charity-smbconf">
668 <title>Charity Administration Office &smb.conf; File</title>
669 <smbconfcomment>Global Parameters</smbconfcomment>
670 <smbconfsection name="[global]"/>
671 <smbconfoption name="workgroup">MIDEARTH</smbconfoption>
672 <smbconfoption name="security">SHARE</smbconfoption>
673 <smbconfoption name="printing">CUPS</smbconfoption>
674 <smbconfoption name="printcap name">CUPS</smbconfoption>
675 <smbconfoption name="disable spoolss">Yes</smbconfoption>
676 <smbconfoption name="show add printer wizard">No</smbconfoption>
677 <smbconfoption name="wins support">yes</smbconfoption>
678
679 <smbconfsection name="[FTMFILES]"/>
680 <smbconfoption name="comment">Funds Tracking &amp; Management Files</smbconfoption>
681 <smbconfoption name="path">/data/ftmfiles</smbconfoption>
682 <smbconfoption name="read only">No</smbconfoption>
683 <smbconfoption name="force user">abmas</smbconfoption>
684 <smbconfoption name="force group">office</smbconfoption>
685 <smbconfoption name="guest ok">Yes</smbconfoption>
686 <smbconfoption name="nt acl support">No</smbconfoption>
687
688 <smbconfsection name="[office]"/>
689 <smbconfoption name="comment">General Office Files</smbconfoption>
690 <smbconfoption name="path">/data/officefiles</smbconfoption>
691 <smbconfoption name="read only">No</smbconfoption>
692 <smbconfoption name="force user">abmas</smbconfoption>
693 <smbconfoption name="force group">office</smbconfoption>
694 <smbconfoption name="guest ok">Yes</smbconfoption>
695 <smbconfoption name="nt acl support">No</smbconfoption>
696
697 <smbconfsection name="[printers]"/>
698 <smbconfoption name="comment">Print Temporary Spool Configuration</smbconfoption>
699 <smbconfoption name="path">/var/spool/samba</smbconfoption>
700 <smbconfoption name="printable">Yes</smbconfoption>
701 <smbconfoption name="guest ok">Yes</smbconfoption>
702 <smbconfoption name="use client driver">Yes</smbconfoption>
703 <smbconfoption name="browseable">No</smbconfoption>
704 </smbconfexample>
705
706                         <procedure>
707                         <title>Windows Client Configuration</title>
708
709                                 <step><para>
710                                 Configure clients to the network settings shown in <link linkend="charitynet"/>.
711                                 </para></step>
712
713                                 <step><para>
714                                 Ensure that the netmask used on the Windows clients matches that used
715                                 for the Samba server. All clients must have the same netmask. For example,
716                                 <constant>255.255.255.0</constant>.
717                                 </para></step>
718
719                                 <step><para>
720                                 <indexterm><primary>WINS</primary></indexterm>
721                                 On all Windows clients, set the WINS Server address to <constant>192.168.1.1</constant>,
722                                 the IP address of the server.
723                                 </para></step>
724
725                                 <step><para>
726                                 Set the workgroup name on all clients to <constant>MIDEARTH</constant>.
727                                 </para></step>
728
729             <step><para><indexterm>
730                   <secondary>logon</secondary>
731                 </indexterm>
732                                 Install the <quote>Client for Microsoft Networks.</quote> Ensure that the only option
733                                 enabled in its properties is the option <quote>Logon and restore network connections.</quote>
734                                 </para></step>
735
736                                 <step><para>
737                                 Click <guibutton>OK</guibutton> when you are prompted to reboot the system. Reboot the
738                                 system, then logon using any user name and password you choose.
739                                 </para></step>
740
741             <step><para><indexterm>
742                   <primary>My Network Places</primary>
743                 </indexterm>
744                                 Verify on each client that the machine called <constant>SERVER</constant>
745                                 is visible in <guimenu>My Network Places</guimenu>, that it is
746                                 possible to connect to it and see the share <guimenuitem>office</guimenuitem>,
747                                 and that it is possible to open that share to reveal its contents.
748                                 </para></step>
749
750             <step><para><indexterm>
751                   <primary>password caching</primary>
752                 </indexterm><indexterm>
753                   <primary>regedit</primary>
754                 </indexterm>
755                                 Disable password caching on all Windows 9x/Me machines using the registry change file
756                                 shown in <link linkend="MEreg"/>. Be sure to remove all files that have the
757                                 <filename>PWL</filename> extension that are in the <filename>C:\WINDOWS</filename>
758                                 directory.
759 <example id="MEreg">
760 <title>Windows Me &smbmdash; Registry Edit File: Disable Password Caching</title>
761 <screen>
762 REGEDIT4
763
764 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
765         Windows\CurrrentVersion\Policies\Network]
766         "DisablePwdCaching"=dword:00000001
767 </screen>
768 </example>
769                                 The best way to apply this is to save the patch in a file called 
770                                 <filename>ME-dpwc.reg</filename> and then execute:
771 <screen>
772 C:\WINDOWS: regedit ME-dpwc.reg
773 </screen>
774                                 </para></step>
775
776                                 <step><para>
777                                 Instruct all users to log onto the workstation using a name of their own
778                                 choosing, with a password of their own choosing. The Samba server has been
779                                 configured to ignore the username and password given.
780                                 </para></step>
781
782                                 <step><para>
783                                 On each Windows Me workstation, configure a network drive mapping to drive <filename>G:</filename>
784                                 that redirects to the uniform naming convention (UNC) resource 
785                                 <filename>\\server\office</filename>. Make this a permanent drive connection as follows:
786                                 </para>
787                                         <procedure>
788                                                 <step><para>
789                                                         <menuchoice>
790                                                                 <guimenu>(Right-click) My Network</guimenu>
791                                                                 <guimenuitem>Map Network Drive...</guimenuitem>
792                                                         </menuchoice>
793                                                 </para></step>
794
795                                                 <step><para>
796                                                 In the box labeled <quote>Drive:</quote>, type G.
797                                                 </para></step>
798
799                                                 <step><para>
800                                                 In the box labeled <quote>Path:</quote>, enter 
801                                                 <filename>\\server\officefiles</filename>.
802                                                 </para></step>
803
804                                                 <step><para>
805                                                 Click <guimenuitem>Reconnect at logon</guimenuitem>.
806                                                 Click <guibutton>OK</guibutton>.
807                                                 </para></step>
808
809                                         </procedure>
810                                 </step>
811
812                                 <step><para>
813                                 On each workstation, install the Funds Tracking and Management software following the
814                                 manufacturer's instructions.
815                                 </para>
816                                         <procedure>
817                                         <step><para>
818                                         During installation, you are prompted for the name of the Windows 98
819                                         server. Enter the name <constant>SERVER</constant>.
820                                         </para></step>
821                                         <step><para>
822                                         You are prompted for the name of the data share.
823                                         The prompt defaults to <constant>FTMFILES</constant>. Press enter to accept the default value.
824                                         </para></step>
825                                         <step><para>
826                                         You are now prompted for the print queue name. The default prompt is the name of
827                                         the server you entered (<constant>SERVER</constant> as follows:
828                                         <constant>\\SERVER\PRINTQ</constant>). Simply accept the default and press enter to
829                                         continue. The software now completes the installation.
830                                         </para></step>
831                                         </procedure>
832                                 </step>
833
834                                 <step><para>
835                                 Install an office automation software package of the customer's choice. Either Microsoft
836                                 Office 2003 Standard or OpenOffice 1.1.0 suffices for any functions the office may
837                                 need to perform. Repeat this on each workstation.
838                                 </para></step>
839
840                                 <step><para>
841                                 Install a printer on each using the following steps:
842                                 </para>
843
844                                         <procedure>
845                                                 <step><para>
846                                                 Click <menuchoice>
847                                                         <guimenu>Start</guimenu>
848                                                         <guimenuitem>Settings</guimenuitem>
849                                                         <guimenuitem>Printers</guimenuitem>
850                                                         <guiicon>Add Printer</guiicon>
851                                                         <guibutton>Next</guibutton>
852                                                         </menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
853                                                         Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
854                                                 </para></step>
855
856                                                 <step><para>
857                                                 Click <guibutton>Next</guibutton>. In the panel labeled
858                                                 <guimenuitem>Manufacturer:</guimenuitem>, select <constant>HP</constant>.
859                                                 In the <guimenuitem>Printers:</guimenuitem> panel, select the printer called
860                                                 <constant>HP LaserJet 5/5M Postscript</constant>. Click <guibutton>Next</guibutton>.
861                                                 </para></step>
862
863                                                 <step><para>
864                                                 In the panel labeled <guimenuitem>Available ports:</guimenuitem>, select
865                                                 <constant>FILE:</constant>. Accept the default printer name by clicking
866                                                 <guibutton>Next</guibutton>. When asked, <quote>Would you like to print a
867                                                 test page?</quote>, click <guimenuitem>No</guimenuitem>. Click
868                                                 <guibutton>Finish</guibutton>.
869                                                 </para></step>
870
871                                                 <step><para>
872                                                 You may be prompted for the name of a file to print to. If so, close the
873                                                 dialog panel. Right-click <menuchoice>
874                                                         <guiicon>HP LaserJet 5/5M Postscript</guiicon>
875                                                         <guimenuitem>Properties</guimenuitem>
876                                                         <guisubmenu>Details (Tab)</guisubmenu>
877                                                         <guimenuitem>Add Port</guimenuitem>
878                                                         </menuchoice>.
879                                                 </para></step>
880
881                                                 <step><para>
882                                                 In the panel labeled <guimenuitem>Network</guimenuitem>, enter the name of
883                                                 the print queue on the Samba server as follows: <constant>\\SERVER\hplj5</constant>.
884                                                 Click <menuchoice> 
885                                                         <guibutton>OK</guibutton>
886                                                         <guibutton>OK</guibutton>
887                                                         </menuchoice> to complete the installation.
888                                                 </para></step>
889
890                                                 <step><para>
891                                                 It is a good idea to test the functionality of the complete installation before
892                                                 handing the newly configured network over to the Charity Administration Office
893                                                 for production use.
894                                                 </para></step>
895
896                                         </procedure>
897
898                                 </step>
899
900                         </procedure>
901
902                 </sect3>
903
904                 <sect3>
905                 <title>Validation</title>
906
907                 <para>
908                 Use the same validation process as was followed in <link linkend="validate1"/>.
909                 </para>
910
911                 </sect3>
912
913         </sect2>
914
915         <sect2 id="AccountingOffice">
916         <title>Accounting Office</title>
917
918         <para>
919         The office of Abmas Accounting Inc. is a 40-year-old family-run business. There are nine permanent
920         computer users. The network clients were upgraded two years ago. All computers run Windows 2000
921         Professional. This year the server will be upgraded from an old Windows NT4 server (actually
922         running Windows NT4 Workstation, which worked fine as there were fewer than 10 users) that has
923         run in workgroup (Stand-Alone) mode, to a new Linux server running Samba.
924         </para>
925
926         <para>
927         The office does not want a Domain Server. Mr. Alan Meany wants to keep the Windows 2000 Professional
928         clients running as workgroup machines so that any staff member can take a machine home and keep 
929         working.  It has worked well so far and your task is to replace the old server. All users have 
930         their own workstation logon (you configured it that way when the machines were installed). 
931         Mr. Meany wants the new system to operate the same way as the old Windows NT4 server &smbmdash; users 
932         cannot access each others' files, but he can access everyone's files. Each person's work files are 
933         in a separate share on the server. Users logon to their Windows workstation with their username 
934         and enter an assigned password; they do not need to enter a password when accessing their files 
935         on the server.
936         </para>
937
938         <para><indexterm>
939             <primary>Red Hat Linux</primary>
940           </indexterm>
941         The new server will run Red Hat Fedora Core2. You should install Samba-3.0.12 and 
942         copy all files off the old system to the new one. The existing Windows NT4 server has a parallel
943         port HP LaserJet 4 printer that is shared by all. The printer driver is installed on each
944         workstation. You must not change anything on the workstations. Mr. Meany gave instructions to
945         replace the server <quote>but leave everything else alone to avoid staff unrest.</quote>
946         </para>
947
948         <para>
949         You have tried to educate Mr. Meany and found that he has no interest to understand networking.
950         He believes that Windows for Workgroups 3.11 was <quote>the best server Microsoft ever sold
951         </quote> and that Windows NT and 2000 are <quote>too fang-dangled complex!</quote>
952         </para>
953
954                 <sect3>
955                 <title>Dissection and Discussion</title>
956
957                         <para>
958                         <indexterm><primary>security</primary><secondary>user mode</secondary></indexterm>
959                         The requirements of this network installation are not unusual. The staff are not interested in the
960                         details of networking. Passwords are never changed. In this example solution, we demonstrate the use
961                         of User Mode security in a simple context. Directories should be set SGID to ensure that members
962                         of a common group can access the contents. Each user has his or her own share to which only they
963                         can connect. Mr. Meany's share will be a top level directory above the share point for each employee.
964                         Mr. Meany is a member of the same group as his staff and is able to access their work files.
965                         The well used HP LaserJet 4 is available as a service called <constant>hplj</constant>.
966                         </para>
967
968                         <para>
969                         You have finished configuring the new hardware and have just completed installation of Red Hat 
970                         Fedora Core2. Roll up your sleeves and let's get to work.
971                         </para>
972
973                 </sect3>
974
975                 <sect3 id="AcctgNet">
976                 <title>Implementation</title>
977
978                 <para>
979                 The workstations have fixed IP addresses. The old server runs Windows NT4 Workstation, so it 
980                 cannot be running as a WINS server. It is best that the new configuration preserves the same
981                 configuration. The office does not use Internet access, so security really is not an issue.
982                 </para>
983
984                 <para>
985                 The core information regarding the users, their passwords, the directory share point, and the
986                 share name is given in <link linkend="acctingnet"/>. The overall network topology is shown in
987                 <link linkend="acctingnet2"/>. All machines have been configured as indicated prior to the
988                 start of Samba configuration. The following prescriptive steps may now commence.
989                 </para>
990
991                 <image id="acctingnet2">
992                         <imagedescription>Accounting Office Network Topology</imagedescription>
993                         <imagefile scale="66">AccountingNetwork</imagefile>
994                 </image>
995
996                 <table id="acctingnet">
997                         <title>Accounting Office Network Information</title>
998                         <tgroup cols="6">
999                                 <colspec align="left"/>
1000                                 <colspec align="left"/>
1001                                 <colspec align="left"/>
1002                                 <colspec align="left"/>
1003                                 <colspec align="left"/>
1004                                 <colspec align="left"/>
1005                                 <thead>
1006                                         <row>
1007                                                 <entry>User</entry>
1008                                                 <entry>Login-ID</entry>
1009                                                 <entry>Password</entry>
1010                                                 <entry>Share Name</entry>
1011                                                 <entry>Directory</entry>
1012                                                 <entry>Wkst</entry>
1013                                         </row>
1014                                 </thead>
1015                                 <tbody>
1016                                         <row>
1017                                                 <entry>Alan Meany</entry>
1018                                                 <entry>alan</entry>
1019                                                 <entry>alm1961</entry>
1020                                                 <entry>alan</entry>
1021                                                 <entry>/data</entry>
1022                                                 <entry>PC1</entry>
1023                                         </row>
1024                                         <row>
1025                                                 <entry>James Meany</entry>
1026                                                 <entry>james</entry>
1027                                                 <entry>jimm1962</entry>
1028                                                 <entry>james</entry>
1029                                                 <entry>/data/james</entry>
1030                                                 <entry>PC2</entry>
1031                                         </row>
1032                                         <row>
1033                                                 <entry>Jeannie Meany</entry>
1034                                                 <entry>jeannie</entry>
1035                                                 <entry>jema1965</entry>
1036                                                 <entry>jeannie</entry>
1037                                                 <entry>/data/jeannie</entry>
1038                                                 <entry>PC3</entry>
1039                                         </row>
1040                                         <row>
1041                                                 <entry>Suzy Millicent</entry>
1042                                                 <entry>suzy</entry>
1043                                                 <entry>suzy1967</entry>
1044                                                 <entry>suzy</entry>
1045                                                 <entry>/data/suzy</entry>
1046                                                 <entry>PC4</entry>
1047                                         </row>
1048                                         <row>
1049                                                 <entry>Ursula Jenning</entry>
1050                                                 <entry>ujen</entry>
1051                                                 <entry>ujen1974</entry>
1052                                                 <entry>ursula</entry>
1053                                                 <entry>/data/ursula</entry>
1054                                                 <entry>PC5</entry>
1055                                         </row>
1056                                         <row>
1057                                                 <entry>Peter Pan</entry>
1058                                                 <entry>peter</entry>
1059                                                 <entry>pete1984</entry>
1060                                                 <entry>peter</entry>
1061                                                 <entry>/data/peter</entry>
1062                                                 <entry>PC6</entry>
1063                                         </row>
1064                                         <row>
1065                                                 <entry>Dale Roland</entry>
1066                                                 <entry>dale</entry>
1067                                                 <entry>dale1986</entry>
1068                                                 <entry>dale</entry>
1069                                                 <entry>/data/dale</entry>
1070                                                 <entry>PC7</entry>
1071                                         </row>
1072                                         <row>
1073                                                 <entry>Bertrand E Paoletti</entry>
1074                                                 <entry>eric</entry>
1075                                                 <entry>eric1993</entry>
1076                                                 <entry>eric</entry>
1077                                                 <entry>/data/eric</entry>
1078                                                 <entry>PC8</entry>
1079                                         </row>
1080                                         <row>
1081                                                 <entry>Russell Lewis</entry>
1082                                                 <entry>russ</entry>
1083                                                 <entry>russ2001</entry>
1084                                                 <entry>russell</entry>
1085                                                 <entry>/data/russell</entry>
1086                                                 <entry>PC9</entry>
1087                                         </row>
1088                                 </tbody>
1089                         </tgroup>
1090                 </table>
1091
1092 <?latex \newpage ?>
1093
1094                 <procedure>
1095                 <title>Migration from Windows NT4 Workstation System to Samba-3</title>
1096
1097             <step><para><indexterm>
1098                   <primary>migration</primary>
1099                 </indexterm>
1100                         Rename the old server from <constant>CASHPOOL</constant> to <constant>STABLE</constant>
1101                         by logging onto the console as the <constant>Administrator</constant>. Restart the machine
1102                         following system prompts.
1103                         </para></step>
1104
1105                         <step><para>
1106                         Name the new server <constant>CASHPOOL</constant> using the standard configuration method.
1107                         Restart the machine following system prompts.
1108                         </para></step>
1109
1110                         <step><para>
1111                         Install the latest Samba-3 binary Red Hat Linux RPM that is available from the
1112                         Samba FTP site.
1113                         </para></step>
1114
1115             <step><para><indexterm>
1116                   <primary>group account</primary>
1117                 </indexterm><indexterm>
1118                   <primary>groupadd</primary>
1119                 </indexterm>
1120                         Add a group account for the office to use. Execute the following:
1121 <screen>
1122 &rootprompt; groupadd accts
1123 </screen>
1124                         </para></step>
1125
1126                         <step><para>
1127                                         Install the &smb.conf; file shown<footnote><para>This example makes use of the 
1128                         <parameter>smbpasswd</parameter> file. It does so in an obtuse way since the use of 
1129                         the <parameter>passdb backend</parameter> has not been specified in the &smb.conf; 
1130                         file. This means that you are depending on correct default behavior.</para></footnote> 
1131                         in <link linkend="acctconf"/>.
1132                         </para></step>
1133
1134             <step><para><indexterm>
1135                   <primary>useradd</primary>
1136                 </indexterm><indexterm>
1137                   <primary>passwd</primary>
1138                 </indexterm><indexterm>
1139                   <primary>smbpasswd</primary>
1140                 </indexterm>
1141                         For each user who uses this system (see <link linkend="acctingnet"/>),
1142                         execute the following:
1143 <screen>
1144 &rootprompt; useradd -m -G accts -c "Name of User" "LoginID"
1145 &rootprompt; passwd "LoginID"
1146 Changing password for user "LoginID"
1147 New Password: XXXXXXXXX &lt;-- the password from the table
1148 Retype new password: XXXXXXXXX
1149 &rootprompt; smbpasswd -a "LoginID"
1150 New SMB password: XXXXXXXXX &lt;-- the password from the table
1151 Retype new SMB password: XXXXXXXXX
1152 Added user "LoginID"
1153 </screen>
1154                         </para></step>
1155
1156             <step><para><indexterm>
1157                   <primary>data storage</primary>
1158                 </indexterm>
1159                         Create the directory structure for the file shares by executing the following:
1160 <screen>
1161 &rootprompt; mkdir -p /data
1162 &rootprompt; chown alan /data
1163 &rootprompt; for i in james suzy ursula peter dale eric jeannie russell
1164 > do
1165 >       mkdir -p /data/$i
1166 >       chown $i /data/$i
1167 > done
1168 &rootprompt; chgrp -R accts /data
1169 &rootprompt; chmod -R ug+rwxs,o-r+x /data
1170 </screen>
1171                         The data storage structure is now prepared for use.
1172                         </para></step>
1173
1174             <step><para><indexterm>
1175                   <primary>lpadmin</primary>
1176                 </indexterm>
1177                         Configure the CUPS Print Queues as follows:
1178 <screen>
1179 &rootprompt; lpadmin -p hplj -v parallel:/dev/lp0 -E
1180 </screen>
1181                         This creates the necessary print queues with no assigned print filter.
1182                         </para></step>
1183
1184                         <step><para>
1185                 <indexterm><primary>mime types</primary></indexterm><indexterm>
1186                   <primary>/etc/cups/mime.convs</primary>
1187                 </indexterm>
1188                         Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
1189 <screen>
1190 application/octet-stream     application/vnd.cups-raw      0     -
1191 </screen>
1192                         </para></step>
1193
1194             <step><para><indexterm>
1195                   <primary>/etc/cups/mime.types</primary>
1196                 </indexterm><indexterm>
1197                   <primary>application/octet-stream</primary>
1198                 </indexterm>
1199                         Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
1200 <screen>
1201 application/octet-stream
1202 </screen>
1203                         </para></step>
1204
1205             <step><para>
1206                         <indexterm><primary>starting samba</primary></indexterm>
1207                         Use the standard system tool to start Samba and CUPS to configure them to restart
1208                         automatically at every system reboot. For example:
1209                         </para>
1210
1211                         <para>
1212                         <indexterm><primary>starting samba</primary></indexterm>
1213                 <indexterm><primary>starting
1214                     CUPS</primary></indexterm><indexterm>
1215                   <primary>chkconfig</primary>
1216                 </indexterm>
1217 <screen>
1218 &rootprompt; chkconfig smb on
1219 &rootprompt; chkconfig cups on
1220 &rootprompt; /etc/rc.d/init.d/smb restart
1221 &rootprompt; /etc/rc.d/init.d/cups restart
1222 </screen>
1223                         </para></step>
1224
1225                         <step><para>
1226                         On Alan's workstation, use Windows explorer to migrate the files from the old server
1227                         to the new server. The new server should appear in the <guimenu>Network Neighborhood</guimenu>
1228                         with the name of the old server (<constant>CASHPOOL</constant>).
1229                         </para>
1230
1231                                 <procedure>
1232
1233                                         <step><para>
1234                                         Logon to Alan's workstation as the user <constant>alan</constant>.
1235                                         </para></step>
1236
1237                                         <step><para>
1238                                         Launch a second instance of Windows explorer and navigate to the share called
1239                                         <guiicon>files</guiicon> on the server called <guimenu>STABLE</guimenu>.
1240                                         </para></step>
1241
1242                                         <step><para>
1243                                         Click in the right panel, and press <guimenu>Ctrl-A</guimenu> to select all files and
1244                                         directories. Press <guimenu>Ctrl-C</guimenu> to instruct Windows that you wish to
1245                                         copy all selected items.
1246                                         </para></step>
1247
1248                                         <step><para>
1249                                         Launch the Windows explorer, and navigate to the share called <guiicon>files</guiicon>
1250                                         on the server called <guimenu>CASHPOOL</guimenu>. Click in the right panel, and then press
1251                                         <guimenu>Ctrl-V</guimenu> to commence the copying process.
1252                                         </para></step>
1253
1254                                 </procedure>
1255                         </step>
1256
1257                         <step><para>
1258                         Verify that the files are being copied correctly from the Windows NT4 machine to the Samba-3 server.
1259                         This is best done on the Samba-3 server. Check the contents of the directory tree under 
1260                         <filename>/data</filename>. This can be done by executing the following command:
1261 <screen>
1262 &rootprompt; ls -aR /data
1263 </screen>
1264                         Make certain to check the ownership and permissions on all files. If in doubt, execute the following:
1265 <screen>
1266 &rootprompt; chown alan /data
1267 &rootprompt; for i in james suzy ursula peter dale eric jeannie russell
1268 > do
1269 >       chown $i /data/$i
1270 > done
1271 &rootprompt; chgrp -R accts /data
1272 &rootprompt; chmod -R ug+rwxs,o-r+x /data
1273 </screen>
1274                         </para></step>
1275
1276                         <step><para>
1277                         The migration of all data should now be complete. It is time to validate the installation.
1278                         For this, you should make sure all applications, including printing, work before asking the
1279                         customer to test drive the new network.
1280                         </para></step>
1281
1282                 </procedure>
1283
1284 <smbconfexample id="acctconf">
1285 <title>Accounting Office Network &smb.conf; File</title>
1286 <smbconfcomment>Global parameters</smbconfcomment>
1287 <smbconfsection name="[global]"/>
1288 <smbconfoption name="workgroup">BILLMORE</smbconfoption>
1289 <smbconfoption name="printing">CUPS</smbconfoption>
1290 <smbconfoption name="printcap name">CUPS</smbconfoption>
1291 <smbconfoption name="disable spoolss">Yes</smbconfoption>
1292 <smbconfoption name="show add printer wizard">No</smbconfoption>
1293
1294 <smbconfsection name="[files]"/>
1295 <smbconfoption name="comment">Work area files</smbconfoption>
1296 <smbconfoption name="path">/data/%U</smbconfoption>
1297 <smbconfoption name="valid users">%S</smbconfoption>
1298 <smbconfoption name="read only">No</smbconfoption>
1299
1300 <smbconfsection name="[master]"/>
1301 <smbconfoption name="comment">Master work area files</smbconfoption>
1302 <smbconfoption name="path">/data</smbconfoption>
1303 <smbconfoption name="valid users">alan</smbconfoption>
1304 <smbconfoption name="read only">No</smbconfoption>
1305
1306 <smbconfsection name="[printers]"/>
1307 <smbconfoption name="comment">Print Temporary Spool Configuration</smbconfoption>
1308 <smbconfoption name="path">/var/spool/samba</smbconfoption>
1309 <smbconfoption name="printable">Yes</smbconfoption>
1310 <smbconfoption name="guest ok">Yes</smbconfoption>
1311 <smbconfoption name="use client driver">Yes</smbconfoption>
1312 <smbconfoption name="browseable">No</smbconfoption>
1313 </smbconfexample>
1314
1315                 </sect3>
1316         </sect2>
1317 </sect1>
1318
1319 <sect1>
1320         <title>Questions and Answers</title>
1321
1322         <para>
1323         The following questions and answers draw from the examples in this chapter.
1324         Many design decisions are impacted by the configurations chosen. The intent
1325         is to expose some of the hidden implications.
1326         </para>
1327
1328         <qandaset defaultlabel="chap02qa">
1329         <qandaentry>
1330         <question>
1331
1332                 <para>
1333                 What makes an anonymous Samba server more simple than an non-anonymous Samba server?
1334                 </para>
1335
1336         </question>
1337         <answer>
1338
1339                 <para>
1340                 In the anonymous server, the only account used is the <constant>guest</constant> account.
1341                 In a non-anonymous configuration, it is necessary to add real user accounts to both the
1342                 UNIX system and to the Samba configuration. Non-anonymous servers require additional
1343                 administration.
1344                 </para>
1345
1346         </answer>
1347         </qandaentry>
1348
1349         <qandaentry>
1350         <question>
1351
1352                 <para>
1353                 How is the operation of the parameter <parameter>force user</parameter> different from
1354                 setting the root directory of the share SUID?
1355                 </para>
1356
1357         </question>
1358         <answer>
1359
1360                 <para>
1361                 The parameter <parameter>force user</parameter> causes all operations on the share to assume the UID
1362                 of the forced user. The new default GID that applies is the primary GID of the forced user.
1363                 This gives all users of this resource the actual privilege of the forced user.
1364                 </para>
1365
1366                 <para>
1367                 When a directory is set SUID, the operating system forces files that are written within it
1368                 to be owned by the owner of the directory. While this happens, the user who is using the share
1369                 has only the level of privilege he or she is assigned within the operating system context.
1370                 </para>
1371
1372                 <para>
1373                 The parameter <parameter>force user</parameter> has potential security implications that go
1374                 beyond the actual share root directory. Be careful and wary of using this parameter.
1375                 </para>
1376
1377         </answer>
1378         </qandaentry>
1379
1380         <qandaentry>
1381         <question>
1382
1383                 <para>
1384                 When would you use both the per share parameter <parameter>force user</parameter> as well
1385                 as setting the share root directory SUID?
1386                 </para>
1387
1388         </question>
1389         <answer>
1390
1391                 <para>
1392                 You would use both parameters when it is necessary to guarantee that all share handling operations
1393                 are conducted as the forced user, while all file and directory creation are done as the SUID
1394                 directory owner.
1395                 </para>
1396
1397         </answer>
1398         </qandaentry>
1399
1400         <qandaentry>
1401         <question>
1402
1403                 <para>
1404                 What is better about CUPS printing than LPRng printing?
1405                 </para>
1406
1407         </question>
1408         <answer>
1409
1410                 <para>
1411                 CUPS is a print spooling system that has integrated remote management facilities, provides completely
1412                 automated print processing/preprocessing, and has the potential to be configured to automatically
1413                 apply print preprocessing filters to ensure that a print job submitted is correctly rendered for the
1414                 target printer. CUPS includes an image file RIP that supports printing of image files to 
1415                 non-PostScript printers. CUPS has lots of bells and whistles and is more like a super-charged MS Windows
1416                 NT/200x print monitor and processor. Its complexity can be eliminated or turbo-charged to suit
1417                 any fancy.
1418                 </para>
1419
1420                 <para>
1421                 The LPRng software is an enhanced, extended, and portable implementation of the Berkeley LPR print 
1422                 spooler functionality. It provides the same interface and meets RFC1179 requirements. LPRng is capable
1423                 of being configured to act like CUPS, but it is in principle a replacement for the old Berkeley lpr/lpd
1424                 spooler. LPRng is generally preferred by those who are familiar with Berkeley lpr/lpd.
1425                 </para>
1426
1427                 <para>
1428                 Which is better is a matter of personal taste. It depends on what you want to do and how you want to
1429                 do it and manage it. Most modern Linux systems ship with CUPS as the default print management system.
1430                 </para>
1431
1432         </answer>
1433         </qandaentry>
1434
1435         <qandaentry>
1436         <question>
1437
1438                 <para>
1439                 When should Windows client IP addresses be hard coded?
1440                 </para>
1441
1442         </question>
1443         <answer>
1444
1445                 <para>
1446                 When there are few MS Windows clients, little client change, no mobile users, and users are not
1447                 inclined to tamper with network settings, it is a safe and convenient matter to hard-code Windows
1448                 client TCP/IP settings. Given that it is possible to lock down the Windows desktop and remove
1449                 user ability to access network configuration controls, fixed configuration eliminates the need
1450                 for a DHCP server. This reduces maintenance overheads and eliminates a possible point of network
1451                 failure.
1452                 </para>
1453
1454         </answer>
1455         </qandaentry>
1456
1457         <qandaentry>
1458         <question>
1459
1460                 <para>
1461                 Under what circumstances would it be best to use a DHCP server?
1462                 </para>
1463
1464         </question>
1465         <answer>
1466
1467                 <para>
1468                 In network configurations where there are mobile users, or where Windows client PCs move around
1469                 (particularly between offices or between subnets), it makes complete sense to control all Windows
1470                 client configurations using a DHCP server. Additionally, when users do tamper with the network
1471                 settings, the use of DHCP can be used to normalize all client settings. 
1472                 </para>
1473
1474                 <para>
1475                 One of the least appreciated benefits of using a DHCP server to assign all network client
1476                 device TCP/IP settings is that it makes it a pain-free process to change network TCP/IP
1477                 settings, change network addressing, or enhance the ability of client devices to
1478                 benefit from new network services.
1479                 </para>
1480
1481                 <para>
1482                 Another benefit of modern DHCP servers is the ability of the DHCP server to register dynamically
1483                 assigned IP addresses with the DNS server. The benefits of Dynamic DNS (DDNS) are considerable in 
1484                 a large Windows network environment.
1485                 </para>
1486
1487         </answer>
1488         </qandaentry>
1489
1490         <qandaentry>
1491         <question>
1492
1493                 <para>
1494                 What is the purpose of setting the parameter <parameter>guest ok</parameter> on a share?
1495                 </para>
1496
1497         </question>
1498         <answer>
1499
1500                 <para>
1501                 If this parameter is yes for a service, then no password is required to connect to the service.
1502                 Privileges are those of the guest account.
1503                 </para>
1504
1505         </answer>
1506         </qandaentry>
1507
1508         <qandaentry>
1509         <question>
1510
1511                 <para>
1512                 When would you set the global parameter <parameter>disable spoolss</parameter>?
1513                 </para>
1514
1515         </question>
1516         <answer>
1517
1518                 <para>
1519                 Setting this parameter to <constant>Yes</constant> disables Samba's support for the SPOOLSS set of 
1520                 MS-RPC's and yields behavior identical to Samba 2.0.x. Windows NT/2000 clients can downgrade to 
1521                 using LanMan style printing commands. Windows 9x/ME are unaffected by the parameter. However, this 
1522                 disables the ability to upload printer drivers to a Samba server via the Windows NT/200x Add Printer 
1523                 Wizard or by using the NT printer properties dialog window. It also disables the capability of 
1524                 Windows NT/200x clients to download print drivers from the Samba host on demand. Be extremely careful about 
1525                 setting this parameter.
1526                 </para>
1527
1528                 <para>
1529                 The alternate parameter <parameter>use client driver</parameter> applies only to Windows NT/200x clients. It has no 
1530                 effect on Windows 95/98/ME clients. When serving a printer to Windows NT/200x clients without first installing a valid 
1531                 printer driver on the Samba host, the client is required to install a local printer driver. From this point on, 
1532                 the client treats the printer as a local printer and not a network printer connection. This is much the same behavior 
1533                 that occurs when <parameter>disable spoolss = yes</parameter>.
1534                 </para>
1535
1536                 <para>
1537                 Under normal circumstances, the NT/200x client attempts to open the network printer using MS-RPC. Because the client 
1538                 considers the printer to be local, it attempts to issue the OpenPrinterEx() call requesting access rights associated 
1539                 with the logged on user. If the user possesses local administrator rights but not root privilege on the Samba host (often 
1540                 the case), the OpenPrinterEx() call fails. The result is that the client now displays an "Access Denied; Unable 
1541                 to connect" message in the printer queue window (even though jobs may be printed successfully). This parameter MUST
1542                 not be enabled on a print share that has valid print driver installed on the Samba server.
1543                 </para>
1544
1545         </answer>
1546         </qandaentry>
1547
1548         <qandaentry>
1549         <question>
1550
1551                 <para>
1552                 Why would you disable password caching on Windows 9x/Me clients?
1553                 </para>
1554
1555         </question>
1556         <answer>
1557
1558                 <para>
1559                 Windows 9x/Me workstations that are set at default (password caching enabled) store the username and
1560                 password in files located in the Windows master directory. Such files can be scavenged (read off a client
1561                 machine) and decrypted, thus revealing the user's access credentials for all systems the user may have accessed.
1562                 It is most insecure to allow any Windows 9x/Me client to operate with password caching enabled.
1563                 </para>
1564
1565         </answer>
1566         </qandaentry>
1567
1568         <qandaentry>
1569         <question>
1570
1571                 <para>
1572                 The example of Abmas Accounting Inc. uses User Mode security. How does this provide anonymous access?
1573                 </para>
1574
1575         </question>
1576         <answer>
1577
1578                 <para>
1579                 The example used does not provide anonymous access. Since the clients are all Windows 2000 Professional,
1580                 and given that users are logging onto their machines, by default the client attempts to connect to
1581                 a remote server using currently logged in user credentials. By ensuring that the user's login ID and
1582                 password is the same as those set on the Samba server, access is transparent and does not require
1583                 separate user authentication.
1584                 </para>
1585
1586         </answer>
1587         </qandaentry>
1588
1589         </qandaset>
1590
1591 </sect1>
1592
1593 </chapter>
1594