1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�2.�No Frills Samba Servers</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="Samba-3 by Example"><link rel="up" href="index.html" title="Samba-3 by Example"><link rel="prev" href="primer.html" title="Chapter�1.�Networking Primer"><link rel="next" href="small.html" title="Chapter�3.�Small Office Networking"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�2.�No Frills Samba Servers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="primer.html">Prev</a>�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="small.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="simple"></a>Chapter�2.�No Frills Samba Servers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="simple.html#id2530241">Introduction</a></span></dt><dt><span class="sect1"><a href="simple.html#id2530281">Assignment Tasks</a></span></dt><dd><dl><dt><span class="sect2"><a href="simple.html#id2530325">Drafting Office</a></span></dt><dt><span class="sect2"><a href="simple.html#id2531126">Charity Administration Office</a></span></dt><dt><span class="sect2"><a href="simple.html#AccountingOffice">Accounting Office</a></span></dt></dl></dd><dt><span class="sect1"><a href="simple.html#id2534642">Questions and Answers</a></span></dt></dl></div><p> 2 Congratulations, you managed to get past the opening chapter. To some, this is where the interesting 3 exercises begin. This is the start of the real journey toward the Samba deployment of a lifetime. 4 </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2530241"></a>Introduction</h2></div></div></div><p> 5 This chapter lays the groundwork for understanding the basics of Samba operation. 6 Instead of a bland technical discussion, each principle is demonstrated by way of a 7 real-world scenario for which a working solution<sup>[<a name="id2530253" href="#ftn.id2530253">2</a>]</sup> is fully described. 8 </p><p> 9 The practical exercises take you on a journey through a drafting office, a charity administration 10 office, and an accounting office. You may choose to apply any or all of these to your own environment. 11 </p><p> 12 Every assignment case can be implemented far more creatively, but remember that the solutions you 13 create are designed to demonstrate a particular solution possibility. With experience, you should 14 find much improved solutions compared with those presented here. By the time you complete this book, 15 you should aim to be a Samba expert, so do attempt to find better solutions and try them as you work your 16 way through the examples. 17 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2530281"></a>Assignment Tasks</h2></div></div></div><p> 18 Each case presented highlights different aspects of Windows networking for which a simple 19 Samba-based solution can be provided. Each has subtly different requirements taken from real-world cases. 20 Each is briefly reviewed to cover points of highlight. In each example, instructions are based 21 on the assumption that the official Samba Team RPM package has been installed. 22 </p><p> 23 This chapter has three assignments built around ficticious companies: 24 </p><p> 25 </p><div class="itemizedlist"><ul type="disc"><li><p>A drafting office</p></li><li><p>A charity administration office</p></li><li><p>An accounting office</p></li></ul></div><p> 26 </p><p> 27 Let's get started. 28 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2530325"></a>Drafting Office</h3></div></div></div><p> 29 Our fictitious company is called <span class="emphasis"><em>Abmas Design Inc.</em></span> This is a three-person 30 computer-aided design (CAD) business that often has more work than can be handled. The 31 business owner hires contract draftspeople from wherever he can. They bring their own 32 notebook computers into the office. There are four permanent drafting machines. Abmas has a 33 collection of over 10 years of plans that must be available for all draftsmen to reference. 34 Abmas hires the services of an experienced network engineer to update the 35 plans that are stored on a central server one day per month. She knows how to upload 36 plans from each machine. The files available from the server must remain read-only. 37 Anyone should be able to access the plans at any time and without barriers or difficulty. 38 </p><p><a class="indexterm" name="id2530352"></a> 39 <a class="indexterm" name="id2530358"></a> 40 Mr. Bob Jordan has asked you to install the new server as economically as possible. The central 41 server has a Pentium-IV 1.6GHz CPU, 768MB RAM, a 20GB IDE boot drive, a 160GB IDE second disk 42 to store plans, and a 100-base-T Ethernet card. You have already installed Red Hat Fedora Core2 and 43 have upgraded Samba to version 3.0.12 using the RPM package that is provided from the Samba 44 <a href="http://www.samba.org" target="_top">FTP</a> sites. 45 </p><p><a class="indexterm" name="id2530380"></a> 46 The four permanent drafting machines (Microsoft Windows workstations) have attached printers 47 and plotters that are shared on a peer-to-peer basis by any/all network users. The intent 48 is to continue to share printers in this manner. The three permanent staff work together with 49 all contractors to store all new work on one PC. A daily copy is made of the work storage 50 area to another PC for safekeeping. When the network consultant arrives, the weekly work 51 area is copied to the central server and the files are removed from the main weekly storage 52 machine. The office works best with this arrangement and does not want to change anything. 53 Old habits are too ingrained. 54 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2530402"></a>Dissection and Discussion</h4></div></div></div><p><a class="indexterm" name="id2530409"></a> 55 The requirements for this server installation demand simplicity. An anonymous read-only 56 file server adequately meets all needs. The network consultant determines how 57 to upload all files from the weekly storage area to the server. This installation should 58 focus only on critical aspects of the installation. 59 </p><p> 60 It is not necessary to have specific users on the server. The site has a method for storing 61 all design files (plans). Each plan is stored in a directory that is named YYYYWW<sup>[<a name="id2530433" href="#ftn.id2530433">3</a>]</sup>, where 62 YYYY is the year, and WW is the week of the year. This arrangement allows work to be stored 63 by week of year to preserve the filing technique the site is familiar with. 64 There is another customer directory that is alphabetically listed. At the top level are 26 65 directories (A-Z), in each is a second level of directory for the first plus second letter of the name 66 (A-Z); inside each is a directory by the customers' name. Inside each directory is a symbolic 67 link to each design drawing/plan. This way of storing customer data files permits all 68 plans to be located both by customer name, as well as by the date the work was performed, without 69 demanding the disk space that would be needed if a duplicate file copy were to be stored. 70 The share containing the plans is called <span class="emphasis"><em>Plans</em></span>. 71 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2530462"></a>Implementation</h4></div></div></div><p> 72 It is assumed that the server is fully installed and ready for installation and 73 configuration of Samba 3.0.12 and any support files needed. All TCP/IP addresses 74 have been hard coded. In our case the IP address of the Samba server is 75 <tt class="constant">192.168.1.1</tt> and the netmask is <tt class="constant">255.255.255.0</tt>. 76 The host name of the server used was <tt class="constant">server</tt>. 77 </p><div class="procedure"><a name="id2530488"></a><p class="title"><b>Procedure�2.1.�Samba Server Configuration</b></p><ol type="1"><li><p> 78 Download the Samba-3 RPM packages for Red Hat Fedora Core2 from the Samba 79 <a href="http://www.samba.org" target="_top">FTP servers.</a> 80 </p></li><li><p><a class="indexterm" name="id2530512"></a><a class="indexterm" name="id2530523"></a> 81 Install the RPM package as using either the Red Hat Linux preferred GUI 82 tool or using the <span><b class="command">rpm</b></span>, as follows: 83</p><pre class="screen"> 84<tt class="prompt">root# </tt> rpm -Uvh samba-3.0.12-1.i386.rpm 85</pre><p> 86 </p></li><li><p> 87 Create a mount point for the file system that will be used to store all data files. 88 You can create a directory called <tt class="filename">/plans</tt> as follows: 89</p><pre class="screen"> 90<tt class="prompt">root# </tt> mkdir /plans 91<tt class="prompt">root# </tt> chmod 755 /plans 92</pre><p> 93 The 755 permissions on this directory (mount point) permit the owner to read, write 94 and execute, and the group and everyone else to read and execute only. 95 </p><p><a class="indexterm" name="id2530590"></a> 96 Use Red Hat Linux system tools (refer to Red Hat instructions for instructions) 97 to format the 160GB hard drive with a suitable file system. An Ext3 file system 98 is suitable. Configure this drive to automatically mount using the <tt class="filename">/plans</tt> 99 directory as the mount point. 100 </p></li><li><p> 101 Install the <tt class="filename">smb.conf</tt> file shown in <a href="simple.html#draft-smbconf" title="Example�2.1.�Drafting Office smb.conf File">???</a> in the 102 <tt class="filename">/etc/samba</tt> directory. 103 104</p><div class="example"><a name="draft-smbconf"></a><p class="title"><b>Example�2.1.�Drafting Office smb.conf File</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global Parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2530667"></a><i class="parameter"><tt> 105 106 workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2530682"></a><i class="parameter"><tt> 107 108 security = SHARE</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[Plans]</tt></i></td></tr><tr><td><a class="indexterm" name="id2530707"></a><i class="parameter"><tt> 109 110 path = /plans</tt></i></td></tr><tr><td><a class="indexterm" name="id2530722"></a><i class="parameter"><tt> 111 112 read only = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2530738"></a><i class="parameter"><tt> 113 114 guest ok = Yes</tt></i></td></tr></table></div><p> 115 </p></li><li><p><a class="indexterm" name="id2530758"></a> 116 Verify that the <tt class="filename">/etc/hosts</tt> file contains the following entry: 117</p><pre class="screen"> 118192.168.1.1 server 119</pre><p> 120 </p></li><li><p><a class="indexterm" name="id2530786"></a><a class="indexterm" name="id2530797"></a> 121 <a class="indexterm" name="id2530806"></a> 122 Use the standard system tool to start Samba and to configure it to restart 123 automatically at every system reboot. For example: 124</p><pre class="screen"> 125<tt class="prompt">root# </tt> chkconfig smb on 126<tt class="prompt">root# </tt> /etc/rc.d/init.d/smb restart 127</pre><p> 128 </p></li></ol></div><div class="procedure"><a name="id2530836"></a><p class="title"><b>Procedure�2.2.�Windows Client Configuration</b></p><ol type="1"><li><p> 129 Make certain that all clients are set to the same network address range as 130 has been used for the Samba server. For example, one client might have an IP 131 address 192.168.1.10. 132 </p></li><li><p><a class="indexterm" name="id2530856"></a> 133 Ensure that the netmask used on the Windows clients matches that used 134 for the Samba server. All clients must have the same netmask. For example, 135 255.255.255.0. 136 </p></li><li><p><a class="indexterm" name="id2530873"></a> 137 Set the workgroup name on all clients to <tt class="constant">MIDEARTH</tt>. 138 </p></li><li><p> 139 Verify on each client that the machine called <tt class="constant">SERVER</tt> 140 is visible in the <span class="guimenu">Network Neighborhood</span>, that it is 141 possible to connect to it and see the share <span class="guimenuitem">Plans</span>, 142 and that it is possible to open that share to reveal its contents. 143 </p></li></ol></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="validate1"></a>Validation</h4></div></div></div><p><a class="indexterm" name="id2530926"></a> 144 The first priority in validating the new Samba configuration should be to check 145 that Samba answers on the loop-back interface. Then it is time to check that Samba 146 answers its own name correctly. Last, check that a client can connect to the Samba 147 server. 148 </p><div class="procedure"><ol type="1"><li><p><a class="indexterm" name="id2530947"></a><a class="indexterm" name="id2530955"></a><a class="indexterm" name="id2530963"></a> 149 To check the ability to access the <span><b class="command">smbd</b></span> daemon 150 services, execute the following: 151</p><pre class="screen"> 152<tt class="prompt">root# </tt> smbclient -L localhost -U% 153 Sharename Type Comment 154 --------- ---- ------- 155 Plans Disk 156 IPC$ IPC IPC Service (Samba 3.0.12) 157 ADMIN$ IPC IPC Service (Samba 3.0.12) 158 159 Server Comment 160 --------- ------- 161 SERVER Samba 3.0.12 162 163 Workgroup Master 164 --------- -------- 165 MIDEARTH SERVER 166</pre><p> 167 <a class="indexterm" name="id2530998"></a><a class="indexterm" name="id2531006"></a> 168 This indicates that Samba is able to respond on the loopback interface to 169 a NULL connection. The <i class="parameter"><tt>-U%</tt></i> means send an empty 170 username and an empty password. This command should be repeated after 171 Samba has been running for 15 minutes. 172 </p></li><li><p> 173 Now verify that Samba correctly handles being passed a username 174 and password, and that it answers its own name. Execute the following: 175</p><pre class="screen"> 176<tt class="prompt">root# </tt> smbclient -L server -Uroot%password 177</pre><p> 178 The output should be identical to the previous response. Samba has been 179 configured to ignore all usernames given; instead it uses the 180 <i class="parameter"><tt>guest account</tt></i> for all connections. 181 </p></li><li><p><a class="indexterm" name="id2531061"></a><a class="indexterm" name="id2531069"></a> 182 From the Windows 9x/Me client, launch Windows Explorer, 183 <span class="guiicon">[Desktop: right-click] Network Neighborhood</span>+<span class="guimenu">Explore</span>-><span class="guimenuitem">[Left Panel] [+] Entire Network</span>-><span class="guimenuitem">[Left Panel] [+] Server</span>-><span class="guimenuitem">[Left Panel] [+] Plans</span>. In the right panel you should see the files and directories 184 (folders) that are in the <span class="guiicon">Plans</span> share. 185 </p></li></ol></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2531126"></a>Charity Administration Office</h3></div></div></div><p> 186 The fictitious charity organization is called <span class="emphasis"><em>Abmas Vision NL</em></span>. This is an 187 office that has five networked computers. Staff are all volunteers with frequent staff changes. 188 Ms. Amy May, the director of operations, wants a no-hassle network. Anyone should be able to 189 use any PC. Only two Windows applications are used: a custom funds tracking and management package 190 that stores all files on the central server and Microsoft Word. The office prepares mail-out 191 letters, letters of invitation, and thank-you notes. All files must be stored in perpetuity. 192 The custom funds tracking and management (FTM) software has been configured to use a server named 193 <tt class="constant">SERVER</tt>, a share named <tt class="constant">FTMFILES</tt>, and a printer queue 194 named <tt class="constant">PRINTQ</tt> that uses preprinted stationery, thus demanding a 195 dedicated printer. This printer does not need to be mapped to a local printer on the workstations. 196 </p><p> 197 The FTM software has been in use since the days of Windows 3.11. The software was configured 198 by the vendor who has since gone out of business. The name of the identities of the file 199 server and the printer are hard coded in a configuration file that was created using a 200 setup tool that the vendor did not provide to Abmas Vision NL or to its predecessors. The 201 company that produced the software is no longer in business. In order to avoid risk of 202 any incompatibilities the share name and the name of the target print queue is being set 203 precisely as the application expects. In actual fact, share names and print queue names 204 should be treated as case insensitive (i.e.: Case does not matter) but Abmas Vision claim 205 that if the share name is not in lower case the application claims it can not find the 206 file share. 207 </p><p><a class="indexterm" name="id2531196"></a><a class="indexterm" name="id2531204"></a> 208 Printer handling in Samba results in a significant level of confusion. Samba presents to the 209 MS Windows client only a print queue. The Samba <span><b class="command">smbd</b></span> process passes a 210 print job sent to it from the Windows client to the native UNIX printing system. The native 211 UNIX printing system (spooler) places the job in a print queue from which it is 212 delivered to the printer. In this book, network diagrams refer to a printer by the name 213 of the print queue that services that printer. It does not matter what the fully qualified 214 name (or the host name) of a network attached printer is. The UNIX print spooler is configured 215 to correctly deliver all jobs to the printer. 216 </p><p> 217 This organization has a policy forbidding use of privately owned computers on site as a measure 218 to prevent leakage of confidential information. Only the five PCs owned by Abmas Vision NL are 219 used on this network. 220 </p><p><a class="indexterm" name="id2531239"></a> 221 The central server was donated by a local computer store. It is a dual processor Pentium-III 222 server, has 1GB RAM, a 3-Ware IDE RAID Controller that has 4 x 200GB IDE hard drives, and a 223 100-base-T network card. The office has 100-base-T permanent network connections that go to 224 a central hub and all equipment is new. The five network computers all are equipped with Microsoft 225 Windows Me. Funding is limited, so the server has no operating system on it. You have approval 226 to install Samba on Linux, but just make sure it works without problems. There are two HP LaserJet 227 5 PS printers that are network connected. The second printer is to be used for general 228 office and letter printing. Your recommendation to allow only the Linux server to print directly 229 to the printers was accepted. You have supplied SUSE Enterprise Linux Server 9 and 230 have upgraded Samba to version 3.0.12. 231 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2531265"></a>Dissection and Discussion</h4></div></div></div><p> 232 <a class="indexterm" name="id2531273"></a><a class="indexterm" name="id2531278"></a><a class="indexterm" name="id2531286"></a><a class="indexterm" name="id2531294"></a> 233 This installation demands simplicity. Frequent turn-over of volunteer staff would indicate that 234 a network environment that requires users to logon might be problematic. It is suggested that the 235 best solution for this office would be one where the user can log onto any PC with any username 236 and password. Samba can accommodate an office like this by using the <i class="parameter"><tt>force user</tt></i> 237 parameter in share and printer definitions. The use of the <i class="parameter"><tt>force user</tt></i> 238 ensures that all files are owned by same user identifier (UID) and thus ensures that there 239 will never be a problem with file access due to file access permissions. Additionally, you elect 240 to use the <i class="parameter"><tt>nt acl support = No</tt></i> option to ensure that no attempts can be 241 made to write access control lists (Posix type) to any file or directory. This prevents 242 an inadvertent ACL from overriding actual file permissions. 243 </p><p> 244 <a class="indexterm" name="id2531338"></a> 245 <a class="indexterm" name="id2531345"></a> 246 <a class="indexterm" name="id2531352"></a> 247 This organization is a prime candidate for Share Mode security. The <i class="parameter"><tt>force user</tt></i> 248 allows all files to be owned by the same user and group. In addition to this, it would not hurt to 249 set SUID and set SGID shared directories. This means that all new files that are created, no matter 250 who creates it, are owned by the owner or group of the directory in which they are created. 251 For further information regarding the significance of the SUID/SGID settings, see 252 <a href="appendix.html#ch12-SUIDSGID" title="Effect of Setting File and Directory SUID/SGID Permissions Explained">???</a>. 253 </p><p> 254 <a class="indexterm" name="id2531385"></a> 255 <a class="indexterm" name="id2531392"></a><a class="indexterm" name="id2531399"></a><a class="indexterm" name="id2531407"></a> 256 All client workstations print to a print queue on the server. This ensures that print jobs 257 continue to print in the event that a user may shut down the workstation immediately after 258 sending a job to the printer. Today, both Red Hat Linux and SUSE Linux use CUPS-based printing. 259 Older Linux systems offered a choice to use either the LPRng printing system, or CUPS. It appears, however, 260 that CUPS has now become the leading UNIX printing technology. 261 </p><p> 262 <a class="indexterm" name="id2531427"></a> 263 The print queues are set up as <tt class="constant">Raw</tt> devices, which means that CUPS will 264 not do intelligent print processing, and vendor supplied drivers be installed locally on the 265 Windows clients. 266 </p><p> 267 The hypothetical software (Funds Tracking and Management) referred to is representative of 268 custom-built software that directly uses a NetBIOS interface. Most such software originated in 269 the days of MS/PC DOS. NetBIOS names are upper-case (and functionally are case insensitive), 270 thus some old software applications would permit only upper-case names to be entered. 271 Some such applications were later ported to MS Windows but retain the upper-case network 272 resource naming conventions because customers are familiar with that. We made the decision 273 to name shares and print queues for this application in upper-case also for the same reason. 274 Nothing would break if you were to use lower-case names, but that decision might create a need 275 to re-educate staff something well avoided at this time. 276 </p><p> 277 NetBIOS networking does not print directly to a printer. Instead, all printing is done to a 278 print queue. The print spooling system is responsible for communicating with the physical 279 printer. In this example, therefore, the resource that is referred to as <tt class="constant">PRINTQ</tt> 280 really is just a print queue. The name of the print queue is held to be representative of 281 the device to which the print spooler delivers print jobs. 282 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2531477"></a>Implementation</h4></div></div></div><p> 283 It is assumed that the server is fully installed and ready for configuration of 284 Samba 3.0.12 and for necessary support files. All TCP/IP addresses should be hard coded. 285 In our case, the IP address of the Samba server is 192.168.1.1 and the netmask is 286 255.255.255.0. The host name of the server used was <tt class="constant">server</tt>. 287 The office network is built as shown in <a href="simple.html#charitynet" title="Figure�2.1.�Charity Administration Office Network">???</a>. 288 </p><div class="figure"><a name="charitynet"></a><p class="title"><b>Figure�2.1.�Charity Administration Office Network</b></p><div class="mediaobject"><img src="images/Charity-Network.png" width="356.4" alt="Charity Administration Office Network"></div></div><div class="procedure"><a name="id2531544"></a><p class="title"><b>Procedure�2.4.�Samba Server Configuration</b></p><ol type="1"><li><p><a class="indexterm" name="id2531554"></a> 289 Create a group account for office file storage as follows: 290</p><pre class="screen"> 291<tt class="prompt">root# </tt> groupadd office 292</pre><p> 293 </p></li><li><p><a class="indexterm" name="id2531581"></a><a class="indexterm" name="id2531589"></a> 294 Create a user account for office file storage as follows: 295</p><pre class="screen"> 296<tt class="prompt">root# </tt> useradd -m abmas 297<tt class="prompt">root# </tt> passwd abmas 298Changing password for abmas. 299New password: XXXXXXXX 300Re-enter new password: XXXXXXXX 301Password changed 302</pre><p> 303 where XXXXXXXX is a secret password. 304 </p></li><li><p> 305 Use the 3-Ware IDE RAID Controller firmware utilities to configure the four 200GB 306 drives as a single RAID level 5 drive, with one drive set aside as the hot spare. 307 (Refer to the 3-Ware RAID Controller Manual for the manufacturers' preferred procedure.) 308 The resulting drive has a capacity of approximately 500GB of usable space. 309 </p></li><li><p><a class="indexterm" name="id2531638"></a> 310 Create a mount point for the file system that can be used to store all data files. 311 Create a directory called <tt class="filename">/data</tt> as follows: 312</p><pre class="screen"> 313<tt class="prompt">root# </tt> mkdir /data 314<tt class="prompt">root# </tt> chmod 755 /data 315</pre><p> 316 The 755 permissions on this directory (mount point) permit the owner to read, write and execute, 317 and the group and everyone else to read and execute only. 318 </p></li><li><p> 319 Use SUSE Linux system tools (refer to the SUSE Administrators Guide for correct 320 procedures) to format the partition with a suitable file system. The reiserfs file system 321 is suitable. Configure this drive to automount using the <tt class="filename">/data</tt> 322 directory as the mount point. It must be mounted before proceeding. 323 </p></li><li><p> 324 Under the directory called <tt class="filename">/data</tt> create two directories 325 named <tt class="filename">ftmfiles</tt> and <tt class="filename">officefiles</tt>, and set 326 ownership and permissions as follows: 327</p><pre class="screen"> 328<tt class="prompt">root# </tt> mkdir -p /data/{ftmfiles,officefiles/{letters,invitations,misc}} 329<tt class="prompt">root# </tt> chown -R abmas.office /data 330<tt class="prompt">root# </tt> chmod -R ug+rwxs,o-w,o+rx /data 331</pre><p> 332 These demonstrate compound operations. The <span><b class="command">mkdir</b></span> command 333 creates in one step these directories: 334</p><pre class="programlisting"> 335/data/fmtfiles 336/data/officefiles 337/data/officefiles/letters 338/data/officefiles/invitations 339/data/officefiles/misc 340</pre><p> 341 The <span><b class="command">chown</b></span> operation sets the owner to the user <tt class="constant">abmas</tt> 342 and the group to <tt class="constant">office</tt> on all directories just created. And 343 the <span><b class="command">chmod</b></span> operation recursively sets the permissions so that 344 the owner and group have SUID/SGID with read/write/execute permission, and everyone else has 345 read and execute permission. This means that all files and directories are created 346 with the same owner and group as the directory in which they are created. Any new 347 directories created still have the same owner, group, and permissions as the 348 directory they are in. This should eliminate all permissions-based file access problems. 349 For more information on this subject, refer to <span class="emphasis"><em>TOSHARG</em></span>, Chapter 13, <span class="emphasis"><em>File, Directory 350 and Share Access Controls</em></span>, or refer to the UNIX man page for the 351 <span><b class="command">chmod</b></span> and the <span><b class="command">chown</b></span> commands. 352 353 </p></li><li><p> 354 Install the <tt class="filename">smb.conf</tt> file shown in <a href="simple.html#charity-smbconf" title="Example�2.2.�Charity Administration Office smb.conf File">???</a> in the 355 <tt class="filename">/etc/samba</tt> directory. 356 </p></li><li><p> 357 <a class="indexterm" name="id2531845"></a> 358 We must ensure that the <span><b class="command">smbd</b></span> can resolve the name of the Samba 359 server to its IP address. Verify that the <tt class="filename">/etc/hosts</tt> file 360 contains the following entry: 361</p><pre class="screen"> 362192.168.1.1 server 363</pre><p> 364 </p></li><li><p> 365 Configure the printers with the IP address as shown in <a href="simple.html#charitynet" title="Figure�2.1.�Charity Administration Office Network">???</a>. 366 Follow the instructions in the manufacturers' manual to permit printing to port 9100, 367 so that the CUPS spooler can print using raw mode protocols. 368 </p></li><li><p><a class="indexterm" name="id2531894"></a> 369 Configure the CUPS Print Queues as follows: 370</p><pre class="screen"> 371<tt class="prompt">root# </tt> lpadmin -p PRINTQ -v socket://192.168.1.20:9100 -E 372<tt class="prompt">root# </tt> lpadmin -p hplj5 -v socket://192.168.1.30:9100 -E 373</pre><p> 374 This creates the necessary print queues with no assigned print filter. 375 </p></li><li><p> 376 <a class="indexterm" name="id2531931"></a><a class="indexterm" name="id2531936"></a><a class="indexterm" name="id2531944"></a> 377 Edit the file <tt class="filename">/etc/cups/mime.convs</tt> to uncomment the line: 378</p><pre class="screen"> 379application/octet-stream application/vnd.cups-raw 0 - 380</pre><p> 381 </p></li><li><p><a class="indexterm" name="id2531973"></a> 382 Edit the file <tt class="filename">/etc/cups/mime.types</tt> to uncomment the line: 383</p><pre class="screen"> 384application/octet-stream 385</pre><p> 386 </p></li><li><p> 387 <a class="indexterm" name="id2532002"></a> 388 Use the standard system tool to start Samba and CUPS to configure them to restart 389 automatically at every system reboot. For example: 390 </p><p> 391 <a class="indexterm" name="id2532014"></a> 392 <a class="indexterm" name="id2532021"></a><a class="indexterm" name="id2532027"></a> 393</p><pre class="screen"> 394<tt class="prompt">root# </tt> chkconfig smb on 395<tt class="prompt">root# </tt> chkconfig cups on 396<tt class="prompt">root# </tt> /etc/rc.d/init.d/smb restart 397<tt class="prompt">root# </tt> /etc/rc.d/init.d/cups restart 398</pre><p> 399 </p></li></ol></div><div class="example"><a name="charity-smbconf"></a><p class="title"><b>Example�2.2.�Charity Administration Office smb.conf File</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global Parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2532097"></a><i class="parameter"><tt> 400 401 workgroup = MIDEARTH</tt></i></td></tr><tr><td><a class="indexterm" name="id2532113"></a><i class="parameter"><tt> 402 403 security = SHARE</tt></i></td></tr><tr><td><a class="indexterm" name="id2532128"></a><i class="parameter"><tt> 404 405 printing = CUPS</tt></i></td></tr><tr><td><a class="indexterm" name="id2532144"></a><i class="parameter"><tt> 406 407 printcap name = CUPS</tt></i></td></tr><tr><td><a class="indexterm" name="id2532159"></a><i class="parameter"><tt> 408 409 disable spoolss = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2532175"></a><i class="parameter"><tt> 410 411 show add printer wizard = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2532191"></a><i class="parameter"><tt> 412 413 wins support = yes</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[FTMFILES]</tt></i></td></tr><tr><td><a class="indexterm" name="id2532215"></a><i class="parameter"><tt> 414 415 comment = Funds Tracking & Management Files</tt></i></td></tr><tr><td><a class="indexterm" name="id2532232"></a><i class="parameter"><tt> 416 417 path = /data/ftmfiles</tt></i></td></tr><tr><td><a class="indexterm" name="id2532247"></a><i class="parameter"><tt> 418 419 read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2532263"></a><i class="parameter"><tt> 420 421 force user = abmas</tt></i></td></tr><tr><td><a class="indexterm" name="id2532278"></a><i class="parameter"><tt> 422 423 force group = office</tt></i></td></tr><tr><td><a class="indexterm" name="id2532293"></a><i class="parameter"><tt> 424 425 guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2532309"></a><i class="parameter"><tt> 426 427 nt acl support = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[office]</tt></i></td></tr><tr><td><a class="indexterm" name="id2532333"></a><i class="parameter"><tt> 428 429 comment = General Office Files</tt></i></td></tr><tr><td><a class="indexterm" name="id2532349"></a><i class="parameter"><tt> 430 431 path = /data/officefiles</tt></i></td></tr><tr><td><a class="indexterm" name="id2532364"></a><i class="parameter"><tt> 432 433 read only = No</tt></i></td></tr><tr><td><a class="indexterm" name="id2532379"></a><i class="parameter"><tt> 434 435 force user = abmas</tt></i></td></tr><tr><td><a class="indexterm" name="id2532394"></a><i class="parameter"><tt> 436 437 force group = office</tt></i></td></tr><tr><td><a class="indexterm" name="id2532410"></a><i class="parameter"><tt> 438 439 guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2532425"></a><i class="parameter"><tt> 440 441 nt acl support = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><a class="indexterm" name="id2532449"></a><i class="parameter"><tt> 442 443 comment = Print Temporary Spool Configuration</tt></i></td></tr><tr><td><a class="indexterm" name="id2532466"></a><i class="parameter"><tt> 444 445 path = /var/spool/samba</tt></i></td></tr><tr><td><a class="indexterm" name="id2532481"></a><i class="parameter"><tt> 446 447 printable = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2532496"></a><i class="parameter"><tt> 448 449 guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2532512"></a><i class="parameter"><tt> 450 451 use client driver = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2532527"></a><i class="parameter"><tt> 452 453 browseable = No</tt></i></td></tr></table></div><div class="procedure"><a name="id2532542"></a><p class="title"><b>Procedure�2.5.�Windows Client Configuration</b></p><ol type="1"><li><p> 454 Configure clients to the network settings shown in <a href="simple.html#charitynet" title="Figure�2.1.�Charity Administration Office Network">???</a>. 455 </p></li><li><p> 456 Ensure that the netmask used on the Windows clients matches that used 457 for the Samba server. All clients must have the same netmask. For example, 458 <tt class="constant">255.255.255.0</tt>. 459 </p></li><li><p> 460 <a class="indexterm" name="id2532580"></a> 461 On all Windows clients, set the WINS Server address to <tt class="constant">192.168.1.1</tt>, 462 the IP address of the server. 463 </p></li><li><p> 464 Set the workgroup name on all clients to <tt class="constant">MIDEARTH</tt>. 465 </p></li><li><p><a class="indexterm" name="id2532609"></a> 466 Install the “<span class="quote"><span class="emphasis"><em>Client for Microsoft Networks.</em></span></span>” Ensure that the only option 467 enabled in its properties is the option “<span class="quote"><span class="emphasis"><em>Logon and restore network connections.</em></span></span>” 468 </p></li><li><p> 469 Click <span class="guibutton">OK</span> when you are prompted to reboot the system. Reboot the 470 system, then logon using any user name and password you choose. 471 </p></li><li><p><a class="indexterm" name="id2532650"></a> 472 Verify on each client that the machine called <tt class="constant">SERVER</tt> 473 is visible in <span class="guimenu">My Network Places</span>, that it is 474 possible to connect to it and see the share <span class="guimenuitem">office</span>, 475 and that it is possible to open that share to reveal its contents. 476 </p></li><li><p><a class="indexterm" name="id2532684"></a><a class="indexterm" name="id2532692"></a> 477 Disable password caching on all Windows 9x/Me machines using the registry change file 478 shown in <a href="simple.html#MEreg" title="Example�2.3.�Windows Me Registry Edit File: Disable Password Caching">???</a>. Be sure to remove all files that have the 479 <tt class="filename">PWL</tt> extension that are in the <tt class="filename">C:\WINDOWS</tt> 480 directory. 481</p><div class="example"><a name="MEreg"></a><p class="title"><b>Example�2.3.�Windows Me Registry Edit File: Disable Password Caching</b></p><pre class="screen"> 482REGEDIT4 483 484[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ 485 Windows\CurrrentVersion\Policies\Network] 486 "DisablePwdCaching"=dword:00000001 487</pre></div><p> 488 The best way to apply this is to save the patch in a file called 489 <tt class="filename">ME-dpwc.reg</tt> and then execute: 490</p><pre class="screen"> 491C:\WINDOWS: regedit ME-dpwc.reg 492</pre><p> 493 </p></li><li><p> 494 Instruct all users to log onto the workstation using a name of their own 495 choosing, with a password of their own choosing. The Samba server has been 496 configured to ignore the username and password given. 497 </p></li><li><p> 498 On each Windows Me workstation, configure a network drive mapping to drive <tt class="filename">G:</tt> 499 that redirects to the uniform naming convention (UNC) resource 500 <tt class="filename">\\server\office</tt>. Make this a permanent drive connection as follows: 501 </p><div class="procedure"><ol type="1"><li><p> 502 <span class="guimenu">(Right-click) My Network</span>-><span class="guimenuitem">Map Network Drive...</span> 503 </p></li><li><p> 504 In the box labeled “<span class="quote"><span class="emphasis"><em>Drive:</em></span></span>”, type G. 505 </p></li><li><p> 506 In the box labeled “<span class="quote"><span class="emphasis"><em>Path:</em></span></span>”, enter 507 <tt class="filename">\\server\officefiles</tt>. 508 </p></li><li><p> 509 Click <span class="guimenuitem">Reconnect at logon</span>. 510 Click <span class="guibutton">OK</span>. 511 </p></li></ol></div></li><li><p> 512 On each workstation, install the Funds Tracking and Management software following the 513 manufacturer's instructions. 514 </p><div class="procedure"><ol type="1"><li><p> 515 During installation, you are prompted for the name of the Windows 98 516 server. Enter the name <tt class="constant">SERVER</tt>. 517 </p></li><li><p> 518 You are prompted for the name of the data share. 519 The prompt defaults to <tt class="constant">FTMFILES</tt>. Press enter to accept the default value. 520 </p></li><li><p> 521 You are now prompted for the print queue name. The default prompt is the name of 522 the server you entered (<tt class="constant">SERVER</tt> as follows: 523 <tt class="constant">\\SERVER\PRINTQ</tt>). Simply accept the default and press enter to 524 continue. The software now completes the installation. 525 </p></li></ol></div></li><li><p> 526 Install an office automation software package of the customer's choice. Either Microsoft 527 Office 2003 Standard or OpenOffice 1.1.0 suffices for any functions the office may 528 need to perform. Repeat this on each workstation. 529 </p></li><li><p> 530 Install a printer on each using the following steps: 531 </p><div class="procedure"><ol type="1"><li><p> 532 Click <span class="guimenu">Start</span>-><span class="guimenuitem">Settings</span>-><span class="guimenuitem">Printers</span>+<span class="guiicon">Add Printer</span>+<span class="guibutton">Next</span>. Do not click <span class="guimenuitem">Network printer</span>. 533 Ensure that <span class="guimenuitem">Local printer</span> is selected. 534 </p></li><li><p> 535 Click <span class="guibutton">Next</span>. In the panel labeled 536 <span class="guimenuitem">Manufacturer:</span>, select <tt class="constant">HP</tt>. 537 In the <span class="guimenuitem">Printers:</span> panel, select the printer called 538 <tt class="constant">HP LaserJet 5/5M Postscript</tt>. Click <span class="guibutton">Next</span>. 539 </p></li><li><p> 540 In the panel labeled <span class="guimenuitem">Available ports:</span>, select 541 <tt class="constant">FILE:</tt>. Accept the default printer name by clicking 542 <span class="guibutton">Next</span>. When asked, “<span class="quote"><span class="emphasis"><em>Would you like to print a 543 test page?</em></span></span>”, click <span class="guimenuitem">No</span>. Click 544 <span class="guibutton">Finish</span>. 545 </p></li><li><p> 546 You may be prompted for the name of a file to print to. If so, close the 547 dialog panel. Right-click <span class="guiicon">HP LaserJet 5/5M Postscript</span>-><span class="guimenuitem">Properties</span>-><span class="guisubmenu">Details (Tab)</span>-><span class="guimenuitem">Add Port</span>. 548 </p></li><li><p> 549 In the panel labeled <span class="guimenuitem">Network</span>, enter the name of 550 the print queue on the Samba server as follows: <tt class="constant">\\SERVER\hplj5</tt>. 551 Click <span class="guibutton">OK</span>+<span class="guibutton">OK</span> to complete the installation. 552 </p></li><li><p> 553 It is a good idea to test the functionality of the complete installation before 554 handing the newly configured network over to the Charity Administration Office 555 for production use. 556 </p></li></ol></div></li></ol></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2533166"></a>Validation</h4></div></div></div><p> 557 Use the same validation process as was followed in <a href="simple.html#validate1" title="Validation">???</a>. 558 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="AccountingOffice"></a>Accounting Office</h3></div></div></div><p> 559 The office of Abmas Accounting Inc. is a 40-year-old family-run business. There are nine permanent 560 computer users. The network clients were upgraded two years ago. All computers run Windows 2000 561 Professional. This year the server will be upgraded from an old Windows NT4 server (actually 562 running Windows NT4 Workstation, which worked fine as there were fewer than 10 users) that has 563 run in workgroup (Stand-Alone) mode, to a new Linux server running Samba. 564 </p><p> 565 The office does not want a Domain Server. Mr. Alan Meany wants to keep the Windows 2000 Professional 566 clients running as workgroup machines so that any staff member can take a machine home and keep 567 working. It has worked well so far and your task is to replace the old server. All users have 568 their own workstation logon (you configured it that way when the machines were installed). 569 Mr. Meany wants the new system to operate the same way as the old Windows NT4 server users 570 cannot access each others' files, but he can access everyone's files. Each person's work files are 571 in a separate share on the server. Users logon to their Windows workstation with their username 572 and enter an assigned password; they do not need to enter a password when accessing their files 573 on the server. 574 </p><p><a class="indexterm" name="id2533227"></a> 575 The new server will run Red Hat Fedora Core2. You should install Samba-3.0.12 and 576 copy all files off the old system to the new one. The existing Windows NT4 server has a parallel 577 port HP LaserJet 4 printer that is shared by all. The printer driver is installed on each 578 workstation. You must not change anything on the workstations. Mr. Meany gave instructions to 579 replace the server “<span class="quote"><span class="emphasis"><em>but leave everything else alone to avoid staff unrest.</em></span></span>” 580 </p><p> 581 You have tried to educate Mr. Meany and found that he has no interest to understand networking. 582 He believes that Windows for Workgroups 3.11 was “<span class="quote"><span class="emphasis"><em>the best server Microsoft ever sold 583 </em></span></span>” and that Windows NT and 2000 are “<span class="quote"><span class="emphasis"><em>too fang-dangled complex!</em></span></span>” 584 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2533265"></a>Dissection and Discussion</h4></div></div></div><p> 585 <a class="indexterm" name="id2533273"></a> 586 The requirements of this network installation are not unusual. The staff are not interested in the 587 details of networking. Passwords are never changed. In this example solution, we demonstrate the use 588 of User Mode security in a simple context. Directories should be set SGID to ensure that members 589 of a common group can access the contents. Each user has his or her own share to which only they 590 can connect. Mr. Meany's share will be a top level directory above the share point for each employee. 591 Mr. Meany is a member of the same group as his staff and is able to access their work files. 592 The well used HP LaserJet 4 is available as a service called <tt class="constant">hplj</tt>. 593 </p><p> 594 You have finished configuring the new hardware and have just completed installation of Red Hat 595 Fedora Core2. Roll up your sleeves and let's get to work. 596 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="AcctgNet"></a>Implementation</h4></div></div></div><p> 597 The workstations have fixed IP addresses. The old server runs Windows NT4 Workstation, so it 598 cannot be running as a WINS server. It is best that the new configuration preserves the same 599 configuration. The office does not use Internet access, so security really is not an issue. 600 </p><p> 601 The core information regarding the users, their passwords, the directory share point, and the 602 share name is given in <a href="simple.html#acctingnet" title="Table�2.1.�Accounting Office Network Information">???</a>. The overall network topology is shown in 603 <a href="simple.html#acctingnet2" title="Figure�2.2.�Accounting Office Network Topology">???</a>. All machines have been configured as indicated prior to the 604 start of Samba configuration. The following prescriptive steps may now commence. 605 </p><div class="figure"><a name="acctingnet2"></a><p class="title"><b>Figure�2.2.�Accounting Office Network Topology</b></p><div class="mediaobject"><img src="images/AccountingNetwork.png" width="356.4" alt="Accounting Office Network Topology"></div></div><div class="table"><a name="acctingnet"></a><p class="title"><b>Table�2.1.�Accounting Office Network Information</b></p><table summary="Accounting Office Network Information" border="1"><colgroup><col align="left"><col align="left"><col align="left"><col align="left"><col align="left"><col align="left"></colgroup><thead><tr><th align="left">User</th><th align="left">Login-ID</th><th align="left">Password</th><th align="left">Share Name</th><th align="left">Directory</th><th align="left">Wkst</th></tr></thead><tbody><tr><td align="left">Alan Meany</td><td align="left">alan</td><td align="left">alm1961</td><td align="left">alan</td><td align="left">/data</td><td align="left">PC1</td></tr><tr><td align="left">James Meany</td><td align="left">james</td><td align="left">jimm1962</td><td align="left">james</td><td align="left">/data/james</td><td align="left">PC2</td></tr><tr><td align="left">Jeannie Meany</td><td align="left">jeannie</td><td align="left">jema1965</td><td align="left">jeannie</td><td align="left">/data/jeannie</td><td align="left">PC3</td></tr><tr><td align="left">Suzy Millicent</td><td align="left">suzy</td><td align="left">suzy1967</td><td align="left">suzy</td><td align="left">/data/suzy</td><td align="left">PC4</td></tr><tr><td align="left">Ursula Jenning</td><td align="left">ujen</td><td align="left">ujen1974</td><td align="left">ursula</td><td align="left">/data/ursula</td><td align="left">PC5</td></tr><tr><td align="left">Peter Pan</td><td align="left">peter</td><td align="left">pete1984</td><td align="left">peter</td><td align="left">/data/peter</td><td align="left">PC6</td></tr><tr><td align="left">Dale Roland</td><td align="left">dale</td><td align="left">dale1986</td><td align="left">dale</td><td align="left">/data/dale</td><td align="left">PC7</td></tr><tr><td align="left">Bertrand E Paoletti</td><td align="left">eric</td><td align="left">eric1993</td><td align="left">eric</td><td align="left">/data/eric</td><td align="left">PC8</td></tr><tr><td align="left">Russell Lewis</td><td align="left">russ</td><td align="left">russ2001</td><td align="left">russell</td><td align="left">/data/russell</td><td align="left">PC9</td></tr></tbody></table></div><div class="procedure"><a name="id2533678"></a><p class="title"><b>Procedure�2.9.�Migration from Windows NT4 Workstation System to Samba-3</b></p><ol type="1"><li><p><a class="indexterm" name="id2533689"></a> 606 Rename the old server from <tt class="constant">CASHPOOL</tt> to <tt class="constant">STABLE</tt> 607 by logging onto the console as the <tt class="constant">Administrator</tt>. Restart the machine 608 following system prompts. 609 </p></li><li><p> 610 Name the new server <tt class="constant">CASHPOOL</tt> using the standard configuration method. 611 Restart the machine following system prompts. 612 </p></li><li><p> 613 Install the latest Samba-3 binary Red Hat Linux RPM that is available from the 614 Samba FTP site. 615 </p></li><li><p><a class="indexterm" name="id2533737"></a><a class="indexterm" name="id2533745"></a> 616 Add a group account for the office to use. Execute the following: 617</p><pre class="screen"> 618<tt class="prompt">root# </tt> groupadd accts 619</pre><p> 620 </p></li><li><p> 621 Install the <tt class="filename">smb.conf</tt> file shown<sup>[<a name="id2533780" href="#ftn.id2533780">4</a>]</sup> 622 in <a href="simple.html#acctconf" title="Example�2.4.�Accounting Office Network smb.conf File">???</a>. 623 </p></li><li><p><a class="indexterm" name="id2533818"></a><a class="indexterm" name="id2533826"></a><a class="indexterm" name="id2533834"></a> 624 For each user who uses this system (see <a href="simple.html#acctingnet" title="Table�2.1.�Accounting Office Network Information">???</a>), 625 execute the following: 626</p><pre class="screen"> 627<tt class="prompt">root# </tt> useradd -m -G accts -c "Name of User" "LoginID" 628<tt class="prompt">root# </tt> passwd "LoginID" 629Changing password for user "LoginID" 630New Password: XXXXXXXXX <-- the password from the table 631Retype new password: XXXXXXXXX 632<tt class="prompt">root# </tt> smbpasswd -a "LoginID" 633New SMB password: XXXXXXXXX <-- the password from the table 634Retype new SMB password: XXXXXXXXX 635Added user "LoginID" 636</pre><p> 637 </p></li><li><p><a class="indexterm" name="id2533888"></a> 638 Create the directory structure for the file shares by executing the following: 639</p><pre class="screen"> 640<tt class="prompt">root# </tt> mkdir -p /data 641<tt class="prompt">root# </tt> chown alan /data 642<tt class="prompt">root# </tt> for i in james suzy ursula peter dale eric jeannie russell 643> do 644> mkdir -p /data/$i 645> chown $i /data/$i 646> done 647<tt class="prompt">root# </tt> chgrp -R accts /data 648<tt class="prompt">root# </tt> chmod -R ug+rwxs,o-r+x /data 649</pre><p> 650 The data storage structure is now prepared for use. 651 </p></li><li><p><a class="indexterm" name="id2533944"></a> 652 Configure the CUPS Print Queues as follows: 653</p><pre class="screen"> 654<tt class="prompt">root# </tt> lpadmin -p hplj -v parallel:/dev/lp0 -E 655</pre><p> 656 This creates the necessary print queues with no assigned print filter. 657 </p></li><li><p> 658 <a class="indexterm" name="id2533974"></a><a class="indexterm" name="id2533979"></a> 659 Edit the file <tt class="filename">/etc/cups/mime.convs</tt> to uncomment the line: 660</p><pre class="screen"> 661application/octet-stream application/vnd.cups-raw 0 - 662</pre><p> 663 </p></li><li><p><a class="indexterm" name="id2534008"></a><a class="indexterm" name="id2534016"></a> 664 Edit the file <tt class="filename">/etc/cups/mime.types</tt> to uncomment the line: 665</p><pre class="screen"> 666application/octet-stream 667</pre><p> 668 </p></li><li><p> 669 <a class="indexterm" name="id2534045"></a> 670 Use the standard system tool to start Samba and CUPS to configure them to restart 671 automatically at every system reboot. For example: 672 </p><p> 673 <a class="indexterm" name="id2534058"></a> 674 <a class="indexterm" name="id2534064"></a><a class="indexterm" name="id2534070"></a> 675</p><pre class="screen"> 676<tt class="prompt">root# </tt> chkconfig smb on 677<tt class="prompt">root# </tt> chkconfig cups on 678<tt class="prompt">root# </tt> /etc/rc.d/init.d/smb restart 679<tt class="prompt">root# </tt> /etc/rc.d/init.d/cups restart 680</pre><p> 681 </p></li><li><p> 682 On Alan's workstation, use Windows explorer to migrate the files from the old server 683 to the new server. The new server should appear in the <span class="guimenu">Network Neighborhood</span> 684 with the name of the old server (<tt class="constant">CASHPOOL</tt>). 685 </p><div class="procedure"><ol type="1"><li><p> 686 Logon to Alan's workstation as the user <tt class="constant">alan</tt>. 687 </p></li><li><p> 688 Launch a second instance of Windows explorer and navigate to the share called 689 <span class="guiicon">files</span> on the server called <span class="guimenu">STABLE</span>. 690 </p></li><li><p> 691 Click in the right panel, and press <span class="guimenu">Ctrl-A</span> to select all files and 692 directories. Press <span class="guimenu">Ctrl-C</span> to instruct Windows that you wish to 693 copy all selected items. 694 </p></li><li><p> 695 Launch the Windows explorer, and navigate to the share called <span class="guiicon">files</span> 696 on the server called <span class="guimenu">CASHPOOL</span>. Click in the right panel, and then press 697 <span class="guimenu">Ctrl-V</span> to commence the copying process. 698 </p></li></ol></div></li><li><p> 699 Verify that the files are being copied correctly from the Windows NT4 machine to the Samba-3 server. 700 This is best done on the Samba-3 server. Check the contents of the directory tree under 701 <tt class="filename">/data</tt>. This can be done by executing the following command: 702</p><pre class="screen"> 703<tt class="prompt">root# </tt> ls -aR /data 704</pre><p> 705 Make certain to check the ownership and permissions on all files. If in doubt, execute the following: 706</p><pre class="screen"> 707<tt class="prompt">root# </tt> chown alan /data 708<tt class="prompt">root# </tt> for i in james suzy ursula peter dale eric jeannie russell 709> do 710> chown $i /data/$i 711> done 712<tt class="prompt">root# </tt> chgrp -R accts /data 713<tt class="prompt">root# </tt> chmod -R ug+rwxs,o-r+x /data 714</pre><p> 715 </p></li><li><p> 716 The migration of all data should now be complete. It is time to validate the installation. 717 For this, you should make sure all applications, including printing, work before asking the 718 customer to test drive the new network. 719 </p></li></ol></div><div class="example"><a name="acctconf"></a><p class="title"><b>Example�2.4.�Accounting Office Network smb.conf File</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td># Global parameters</td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><a class="indexterm" name="id2534318"></a><i class="parameter"><tt> 720 721 workgroup = BILLMORE</tt></i></td></tr><tr><td><a class="indexterm" name="id2534333"></a><i class="parameter"><tt> 722 723 printing = CUPS</tt></i></td></tr><tr><td><a class="indexterm" name="id2534349"></a><i class="parameter"><tt> 724 725 printcap name = CUPS</tt></i></td></tr><tr><td><a class="indexterm" name="id2534364"></a><i class="parameter"><tt> 726 727 disable spoolss = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2534380"></a><i class="parameter"><tt> 728 729 show add printer wizard = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[files]</tt></i></td></tr><tr><td><a class="indexterm" name="id2534404"></a><i class="parameter"><tt> 730 731 comment = Work area files</tt></i></td></tr><tr><td><a class="indexterm" name="id2534420"></a><i class="parameter"><tt> 732 733 path = /data/%U</tt></i></td></tr><tr><td><a class="indexterm" name="id2534435"></a><i class="parameter"><tt> 734 735 valid users = %S</tt></i></td></tr><tr><td><a class="indexterm" name="id2534451"></a><i class="parameter"><tt> 736 737 read only = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[master]</tt></i></td></tr><tr><td><a class="indexterm" name="id2534475"></a><i class="parameter"><tt> 738 739 comment = Master work area files</tt></i></td></tr><tr><td><a class="indexterm" name="id2534491"></a><i class="parameter"><tt> 740 741 path = /data</tt></i></td></tr><tr><td><a class="indexterm" name="id2534506"></a><i class="parameter"><tt> 742 743 valid users = alan</tt></i></td></tr><tr><td><a class="indexterm" name="id2534521"></a><i class="parameter"><tt> 744 745 read only = No</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><a class="indexterm" name="id2534546"></a><i class="parameter"><tt> 746 747 comment = Print Temporary Spool Configuration</tt></i></td></tr><tr><td><a class="indexterm" name="id2534562"></a><i class="parameter"><tt> 748 749 path = /var/spool/samba</tt></i></td></tr><tr><td><a class="indexterm" name="id2534577"></a><i class="parameter"><tt> 750 751 printable = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2534592"></a><i class="parameter"><tt> 752 753 guest ok = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2534608"></a><i class="parameter"><tt> 754 755 use client driver = Yes</tt></i></td></tr><tr><td><a class="indexterm" name="id2534623"></a><i class="parameter"><tt> 756 757 browseable = No</tt></i></td></tr></table></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2534642"></a>Questions and Answers</h2></div></div></div><p> 758 The following questions and answers draw from the examples in this chapter. 759 Many design decisions are impacted by the configurations chosen. The intent 760 is to expose some of the hidden implications. 761 </p><div class="qandaset"><dl><dt> <a href="simple.html#id2534659"> 762 What makes an anonymous Samba server more simple than an non-anonymous Samba server? 763 </a></dt><dt> <a href="simple.html#id2534684"> 764 How is the operation of the parameter force user different from 765 setting the root directory of the share SUID? 766 </a></dt><dt> <a href="simple.html#id2534738"> 767 When would you use both the per share parameter force user as well 768 as setting the share root directory SUID? 769 </a></dt><dt> <a href="simple.html#id2534766"> 770 What is better about CUPS printing than LPRng printing? 771 </a></dt><dt> <a href="simple.html#id2534810"> 772 When should Windows client IP addresses be hard coded? 773 </a></dt><dt> <a href="simple.html#id2534836"> 774 Under what circumstances would it be best to use a DHCP server? 775 </a></dt><dt> <a href="simple.html#id2534875"> 776 What is the purpose of setting the parameter guest ok on a share? 777 </a></dt><dt> <a href="simple.html#id2534901"> 778 When would you set the global parameter disable spoolss? 779 </a></dt><dt> <a href="simple.html#id2534976"> 780 Why would you disable password caching on Windows 9x/Me clients? 781 </a></dt><dt> <a href="simple.html#id2535000"> 782 The example of Abmas Accounting Inc. uses User Mode security. How does this provide anonymous access? 783 </a></dt></dl><table border="0" summary="Q and A Set"><col align="left" width="1%"><tbody><tr class="question"><td align="left" valign="top"><a name="id2534659"></a><a name="id2534661"></a><b></b></td><td align="left" valign="top"><p> 784 What makes an anonymous Samba server more simple than an non-anonymous Samba server? 785 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 786 In the anonymous server, the only account used is the <tt class="constant">guest</tt> account. 787 In a non-anonymous configuration, it is necessary to add real user accounts to both the 788 UNIX system and to the Samba configuration. Non-anonymous servers require additional 789 administration. 790 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534684"></a><a name="id2534687"></a><b></b></td><td align="left" valign="top"><p> 791 How is the operation of the parameter <i class="parameter"><tt>force user</tt></i> different from 792 setting the root directory of the share SUID? 793 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 794 The parameter <i class="parameter"><tt>force user</tt></i> causes all operations on the share to assume the UID 795 of the forced user. The new default GID that applies is the primary GID of the forced user. 796 This gives all users of this resource the actual privilege of the forced user. 797 </p><p> 798 When a directory is set SUID, the operating system forces files that are written within it 799 to be owned by the owner of the directory. While this happens, the user who is using the share 800 has only the level of privilege he or she is assigned within the operating system context. 801 </p><p> 802 The parameter <i class="parameter"><tt>force user</tt></i> has potential security implications that go 803 beyond the actual share root directory. Be careful and wary of using this parameter. 804 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534738"></a><a name="id2534740"></a><b></b></td><td align="left" valign="top"><p> 805 When would you use both the per share parameter <i class="parameter"><tt>force user</tt></i> as well 806 as setting the share root directory SUID? 807 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 808 You would use both parameters when it is necessary to guarantee that all share handling operations 809 are conducted as the forced user, while all file and directory creation are done as the SUID 810 directory owner. 811 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534766"></a><a name="id2534768"></a><b></b></td><td align="left" valign="top"><p> 812 What is better about CUPS printing than LPRng printing? 813 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 814 CUPS is a print spooling system that has integrated remote management facilities, provides completely 815 automated print processing/preprocessing, and has the potential to be configured to automatically 816 apply print preprocessing filters to ensure that a print job submitted is correctly rendered for the 817 target printer. CUPS includes an image file RIP that supports printing of image files to 818 non-PostScript printers. CUPS has lots of bells and whistles and is more like a super-charged MS Windows 819 NT/200x print monitor and processor. Its complexity can be eliminated or turbo-charged to suit 820 any fancy. 821 </p><p> 822 The LPRng software is an enhanced, extended, and portable implementation of the Berkeley LPR print 823 spooler functionality. It provides the same interface and meets RFC1179 requirements. LPRng is capable 824 of being configured to act like CUPS, but it is in principle a replacement for the old Berkeley lpr/lpd 825 spooler. LPRng is generally preferred by those who are familiar with Berkeley lpr/lpd. 826 </p><p> 827 Which is better is a matter of personal taste. It depends on what you want to do and how you want to 828 do it and manage it. Most modern Linux systems ship with CUPS as the default print management system. 829 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534810"></a><a name="id2534812"></a><b></b></td><td align="left" valign="top"><p> 830 When should Windows client IP addresses be hard coded? 831 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 832 When there are few MS Windows clients, little client change, no mobile users, and users are not 833 inclined to tamper with network settings, it is a safe and convenient matter to hard-code Windows 834 client TCP/IP settings. Given that it is possible to lock down the Windows desktop and remove 835 user ability to access network configuration controls, fixed configuration eliminates the need 836 for a DHCP server. This reduces maintenance overheads and eliminates a possible point of network 837 failure. 838 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534836"></a><a name="id2534838"></a><b></b></td><td align="left" valign="top"><p> 839 Under what circumstances would it be best to use a DHCP server? 840 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 841 In network configurations where there are mobile users, or where Windows client PCs move around 842 (particularly between offices or between subnets), it makes complete sense to control all Windows 843 client configurations using a DHCP server. Additionally, when users do tamper with the network 844 settings, the use of DHCP can be used to normalize all client settings. 845 </p><p> 846 One of the least appreciated benefits of using a DHCP server to assign all network client 847 device TCP/IP settings is that it makes it a pain-free process to change network TCP/IP 848 settings, change network addressing, or enhance the ability of client devices to 849 benefit from new network services. 850 </p><p> 851 Another benefit of modern DHCP servers is the ability of the DHCP server to register dynamically 852 assigned IP addresses with the DNS server. The benefits of Dynamic DNS (DDNS) are considerable in 853 a large Windows network environment. 854 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534875"></a><a name="id2534878"></a><b></b></td><td align="left" valign="top"><p> 855 What is the purpose of setting the parameter <i class="parameter"><tt>guest ok</tt></i> on a share? 856 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 857 If this parameter is yes for a service, then no password is required to connect to the service. 858 Privileges are those of the guest account. 859 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534901"></a><a name="id2534903"></a><b></b></td><td align="left" valign="top"><p> 860 When would you set the global parameter <i class="parameter"><tt>disable spoolss</tt></i>? 861 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 862 Setting this parameter to <tt class="constant">Yes</tt> disables Samba's support for the SPOOLSS set of 863 MS-RPC's and yields behavior identical to Samba 2.0.x. Windows NT/2000 clients can downgrade to 864 using LanMan style printing commands. Windows 9x/ME are unaffected by the parameter. However, this 865 disables the ability to upload printer drivers to a Samba server via the Windows NT/200x Add Printer 866 Wizard or by using the NT printer properties dialog window. It also disables the capability of 867 Windows NT/200x clients to download print drivers from the Samba host on demand. Be extremely careful about 868 setting this parameter. 869 </p><p> 870 The alternate parameter <i class="parameter"><tt>use client driver</tt></i> applies only to Windows NT/200x clients. It has no 871 effect on Windows 95/98/ME clients. When serving a printer to Windows NT/200x clients without first installing a valid 872 printer driver on the Samba host, the client is required to install a local printer driver. From this point on, 873 the client treats the printer as a local printer and not a network printer connection. This is much the same behavior 874 that occurs when <i class="parameter"><tt>disable spoolss = yes</tt></i>. 875 </p><p> 876 Under normal circumstances, the NT/200x client attempts to open the network printer using MS-RPC. Because the client 877 considers the printer to be local, it attempts to issue the OpenPrinterEx() call requesting access rights associated 878 with the logged on user. If the user possesses local administrator rights but not root privilege on the Samba host (often 879 the case), the OpenPrinterEx() call fails. The result is that the client now displays an "Access Denied; Unable 880 to connect" message in the printer queue window (even though jobs may be printed successfully). This parameter MUST 881 not be enabled on a print share that has valid print driver installed on the Samba server. 882 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2534976"></a><a name="id2534978"></a><b></b></td><td align="left" valign="top"><p> 883 Why would you disable password caching on Windows 9x/Me clients? 884 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 885 Windows 9x/Me workstations that are set at default (password caching enabled) store the username and 886 password in files located in the Windows master directory. Such files can be scavenged (read off a client 887 machine) and decrypted, thus revealing the user's access credentials for all systems the user may have accessed. 888 It is most insecure to allow any Windows 9x/Me client to operate with password caching enabled. 889 </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2535000"></a><a name="id2535003"></a><b></b></td><td align="left" valign="top"><p> 890 The example of Abmas Accounting Inc. uses User Mode security. How does this provide anonymous access? 891 </p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> 892 The example used does not provide anonymous access. Since the clients are all Windows 2000 Professional, 893 and given that users are logging onto their machines, by default the client attempts to connect to 894 a remote server using currently logged in user credentials. By ensuring that the user's login ID and 895 password is the same as those set on the Samba server, access is transparent and does not require 896 separate user authentication. 897 </p></td></tr></tbody></table></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2530253" href="#id2530253">2</a>] </sup>The examples given mirror those documented 898 in TOSHARG Chapter 2, Section 2.3.1. You may gain additional insight from the Stand-alone server 899 configurations covered in TOSHARG sections 2.3.1.2 through 2.3.1.4. 900 </p></div><div class="footnote"><p><sup>[<a name="ftn.id2530433" href="#id2530433">3</a>] </sup> 901 This information is given purely as an example of how data may be stored in such a way that it 902 will be easy to locate records at a later date. The example is not meant to imply any instructions 903 that may be construed as essential to the design of the solution, this is something you will almost 904 certainly want to determine for yourself.</p></div><div class="footnote"><p><sup>[<a name="ftn.id2533780" href="#id2533780">4</a>] </sup>This example makes use of the 905 <i class="parameter"><tt>smbpasswd</tt></i> file. It does so in an obtuse way since the use of 906 the <i class="parameter"><tt>passdb backend</tt></i> has not been specified in the <tt class="filename">smb.conf</tt> 907 file. This means that you are depending on correct default behavior.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="primer.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="small.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter�1.�Networking Primer�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�3.�Small Office Networking</td></tr></table></div></body></html> 908