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