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">
4 <title>Secure Office Networking</title>
7 Congratulations, your Samba networking skills are developing nicely. You started out
8 with three simple networks in <link linkend="simple"/>, and then in <link linkend="small"/>
9 you designed and built a network that provides a high degree of flexibility, integrity,
10 and dependability. It was enough for the basic needs each was designed to fulfill. In
11 this chapter you address a more complex set of needs. The solution you explore
12 introduces you to basic features that are specific to Samba-3.
16 You should note that a working and secure solution could be implemented using Samba-2.2.x.
17 In the exercises presented here, you are gradually using more Samba-3-specific features,
18 so caution is advised for anyone who tries to use Samba-2.2.x with the guidance here given.
19 To avoid confusion, this book is all about Samba-3. Let's get the exercises in this
24 <title>Introduction</title>
27 You have made Mr. Meany a very happy man. Recently he paid you a fat bonus for work
28 well done. It is one year since the last network upgrade. You have been quite busy.
29 Two months ago Mr. Meany gave approval to hire Christine Roberson, who has taken over
30 general network management. Soon she will provide primary user support. You have
31 demonstrated that you can delegate responsibility and can plan and execute according
32 to that plan. Above all, you have shown Mr. Meany that you are a responsible person.
33 Today is a big day. Mr. Meany called you to his office at 9 a.m. for news you never
34 expected: You are going to take charge of business operations. Mr. Meany
35 is retiring and has entrusted the business to your capable hands.
39 Mr. Meany may be retiring from this company, but not from work. He is taking the
40 opportunity to develop Abmas Accounting into a larger and more substantial company.
41 He says that it took him many years to learn that there is no future in just running
42 a business. He now realizes there is great personal satisfaction in the creation of
43 career opportunities for people in the local community. He wants to do more for others,
44 as he is doing for you. Today he spent a lot of time talking about his grand plan
45 for growth, which you will deal with in the chapters ahead.
49 Over the past year, the growth projections were exceeded. The network has grown to
50 meet the needs of 130 users. Along with growth, the demand for improved services
51 and better functionality has also developed. You are about to make an interim
52 improvement and then hand over all Help desk and network maintenance to Christine.
53 Christine has professional certifications in Microsoft Windows as well as in Linux;
54 she is a hard worker and quite likable. Christine does not want to manage the department
55 (although she manages well). She gains job satisfaction when left to sort things out.
56 Occasionally she wants to work with you on a challenging problem. When you told her
57 about your move, she almost resigned, although she was reassured that a new manager would
58 be hired to run Information Technology, and she would be responsible only for operations.
62 <title>Assignment Tasks</title>
65 You promised the staff Internet services including Web browsing, electronic mail, virus
66 protection, and a company Web site. Christine is eager to help turn the vision into
67 reality. Let's see how close you can get to the promises made.
71 The network you are about to deliver will service 130 users today. Within a year,
72 Abmas will aquire another company. Mr. Meany claims that within 2 years there will be
73 well over 500 users on the network. You have bought into the big picture, so prepare
74 for growth. You have purchased a new server and will implement a new network infrastructure.
78 You have decided to not recycle old network components. The only items that will be
79 carried forward are notebook computers. You offered staff new notebooks, but not
80 one person wanted the disruption for what was perceived as a marginal update.
81 You decided to give everyone, even the notebook user, a new desktop computer.
85 You procured a DSL Internet connection that provides 1.5 Mb/sec (bidirectional)
86 and a 10 Mb/sec ethernet port. You registered the domain
87 <constant>abmas.us</constant>, and the Internet Service Provider (ISP) is supplying
88 secondary DNS. Information furnished by your ISP is shown in <link linkend="chap4netid"/>.
92 It is of paramount priority that under no circumstances will Samba offer
93 service access from an Internet connection. You are paying an ISP to
94 give, as part of its value-added services, full firewall protection for your
95 connection to the outside world. The only services allowed in from
96 the Internet side are the following destination ports: <constant>http/https (ports
97 80 and 443), email (port 25), DNS (port 53)</constant>. All Internet traffic
98 will be allowed out after network address translation (NAT). No internal IP addresses
99 are permitted through the NAT filter because complete privacy of internal network
100 operations must be assured.
103 <table id="chap4netid">
104 <title>Abmas.US ISP Information</title>
106 <colspec align="left"/>
107 <colspec align="center"/>
110 <entry>Parameter</entry>
116 <entry>Server IP Address</entry>
117 <entry>123.45.67.66</entry>
120 <entry>DSL Device IP Address</entry>
121 <entry>123.45.67.65</entry>
124 <entry>Network Address</entry>
125 <entry>123.45.67.64/30</entry>
128 <entry>Gateway Address</entry>
129 <entry>123.45.54.65</entry>
132 <entry>Primary DNS Server</entry>
133 <entry>123.45.54.65</entry>
136 <entry>Secondary DNS Server</entry>
137 <entry>123.45.54.32</entry>
140 <entry>Forwarding DNS Server</entry>
141 <entry>123.45.12.23</entry>
147 <figure id="ch04net">
148 <title>Abmas Network Topology &smbmdash; 130 Users</title>
149 <imagefile scale="65">chap4-net</imagefile>
153 Christine recommended that desktop systems should be installed from a single cloned
154 master system that has a minimum of locally installed software and loads all software
155 off a central application server. The benefit of having the central application server
156 is that it allows single-point maintenance of all business applications, a more
157 efficient way to manage software. She further recommended installation of antivirus
158 software on workstations as well as on the Samba server. Christine knows the dangers
159 of potential virus infection and insists on a comprehensive approach to detective
160 as well as corrective action to protect network operations.
164 A significant concern is the problem of managing company growth. Recently, a number
165 of users had to share a PC while waiting for new machines to arrive. This presented
166 some problems with desktop computers and software installation into the new users'
174 <title>Dissection and Discussion</title>
177 Many of the conclusions you draw here are obvious. Some requirements are not very clear
178 or may simply be your means of drawing the most out of Samba-3. Much can be done more simply
179 than you will demonstrate here, but keep in mind that the network must scale to at least 500
180 users. This means that some functionality will be overdesigned for the current 130-user
185 <title>Technical Issues</title>
188 In this exercise we use a 24-bit subnet mask for the two local networks. This,
189 of course, limits our network to a maximum of 253 usable IP addresses. The network
190 address range chosen is one assigned by RFC1918 for private networks.
191 When the number of users on the network begins to approach the limit of usable
192 addresses, it is a good idea to switch to a network address specified in RFC1918
193 in the 172.16.0.0/16 range. This is done in subsequent chapters.
197 <indexterm><primary>tdbsam</primary></indexterm>
198 <indexterm><primary>smbpasswd</primary></indexterm>
199 The high growth rates projected are a good reason to use the <constant>tdbsam</constant>
200 passdb backend. The use of <constant>smbpasswd</constant> for the backend may result in
201 performance problems. The <constant>tdbsam</constant> passdb backend offers features that
202 are not available with the older, flat ASCII-based <constant>smbpasswd</constant> database.
206 <indexterm><primary>risk</primary></indexterm>
207 The proposed network design uses a single server to act as an Internet services host for
208 electronic mail, Web serving, remote administrative access via SSH,
209 Samba-based file and print services. This design is often chosen by sites that feel
210 they cannot afford or justify the cost or overhead of having separate servers. It must
211 be realized that if security of this type of server should ever be violated (compromised),
212 the whole network and all data is at risk. Many sites continue to choose this type
213 of solution; therefore, this chapter provides detailed coverage of key implementation
218 Samba will be configured to specifically not operate on the Ethernet interface that is
219 directly connected to the Internet.
223 <indexterm><primary>iptables</primary></indexterm>
224 <indexterm><primary>NAT</primary></indexterm>
225 <indexterm><primary>Network Address Translation</primary><see>NAT</see></indexterm>
226 <indexterm><primary>firewall</primary></indexterm>
227 You know that your ISP is providing full firewall services, but you cannot rely on that.
228 Always assume that human error will occur, so be prepared by using Linux firewall facilities
229 based on <command>iptables</command> to effect NAT. Block all
230 incoming traffic except to permitted well-known ports. You must also allow incoming packets
231 to establish outgoing connections. You will permit all internal outgoing requests.
235 The configuration of Web serving, Web proxy services, electronic mail, and the details of
236 generic antivirus handling are beyond the scope of this book and therefore are not
237 covered except insofar as this affects Samba-3.
241 <indexterm><primary>login</primary></indexterm>
242 Notebook computers are configured to use a network login when in the office and a
243 local account to log in while away from the office. Users store all work done in
244 transit (away from the office) by using a local share for work files. Standard procedures
245 dictate that on completion of the work that necessitates mobile file access, all
246 work files are moved back to secure storage on the office server. Staff is instructed
247 to not carry on any company notebook computer any files that are not absolutely required.
248 This is a preventative measure to protect client information as well as private business
253 <indexterm><primary>application server</primary></indexterm>
254 All applications are served from the central server from a share called <constant>apps</constant>.
255 Microsoft Office XP Professional and OpenOffice 1.1.0 will be installed using a network
256 (or administrative) installation. Accounting and financial management software can also
257 be run only from the central application server. Notebook users are provided with
258 locally installed applications on a need-to-have basis only.
262 <indexterm><primary>roaming profiles</primary></indexterm>
263 The introduction of roaming profiles support means that users can move between
264 desktop computer systems without constraint while retaining full access to their data.
265 The desktop travels with them as they move.
269 <indexterm><primary>DNS</primary></indexterm>
270 The DNS server implementation must now address both internal and external
271 needs. You forward DNS lookups to your ISP-provided server as well as the
272 <constant>abmas.us</constant> external secondary DNS server.
276 <indexterm><primary>dynamic DNS</primary></indexterm>
277 <indexterm><primary>DDNS</primary><see>dynamic DNS</see></indexterm>
278 <indexterm><primary>DHCP server</primary></indexterm>
279 Compared with the DHCP server configuration in <link linkend="small"/>, <link linkend="dhcp01"/>, the
280 configuration used in this example has to deal with the presence of an Internet connection.
281 The scope set for it ensures that no DHCP services will be offered on the external
282 connection. All printers are configured as DHCP clients so that the DHCP server assigns
283 the printer a fixed IP address by way of the Ethernet interface (MAC) address. One additional
284 feature of this DHCP server configuration file is the inclusion of parameters to allow dynamic
285 DNS (DDNS) operation.
289 This is the first implementation that depends on a correctly functioning DNS server.
290 Comprehensive steps are included to provide for a fully functioning DNS server that also
291 is enabled for DDNS operation. This means that DHCP clients can be autoregistered
296 You are taking the opportunity to manually set the netbios name of the Samba server to
297 a name other than what will be automatically resolved. You are doing this to ensure that
298 the machine has the same NetBIOS name on both network segments.
302 As in the previous network configuration, printing in this network configuration uses
303 direct raw printing (i.e., no smart printing and no print driver autodownload to Windows
304 clients). Printer drivers are installed on the Windows client manually. This is not
305 a problem because Christine is to install and configure one single workstation and
306 then clone that configuration, using Norton Ghost, to all workstations. Each machine is
307 identical, so this should pose no problem.
311 <title>Hardware Requirements</title>
314 <indexterm><primary>memory requirements</primary></indexterm>
315 This server runs a considerable number of services. From similarly configured Linux
316 installations, the approximate calculated memory requirements are as shown in
317 <link linkend="ch4memoryest"/>.
319 <example id="ch4memoryest">
320 <title>Estimation of Memory Requirements</title>
322 Application Memory per User 130 Users 500 Users
323 Name (MBytes) Total MBytes Total MBytes
324 ----------- --------------- ------------ ------------
327 Samba (nmbd) 16.0 16 16
328 Samba (winbind) 16.0 16 16
329 Samba (smbd) 4.0 520 2000
330 Apache 10.0 (20 User) 200 200
332 Basic OS 256.0 256 256
333 -------------- --------------
334 Total: 1043 MBytes 2539 MBytes
335 -------------- --------------
338 You should add a safety margin of at least 50% to these estimates. The minimum
339 system memory recommended for initial startup 1 GB, but to permit the system
340 to scale to 500 users, it makes sense to provision the machine with 4 GB memory.
341 An initial configuration with only 1 GB memory would lead to early performance complaints
342 as the system load builds up. Given the low cost of memory, it does not make sense to
343 compromise in this area.
347 <indexterm><primary>bandwidth calculations</primary></indexterm>
348 Aggregate input/output loads should be considered for sizing network configuration as
349 well as disk subsystems. For network bandwidth calculations, one would typically use an
350 estimate of 0.1 MB/sec per user. This suggests that 100-Base-T (approx. 10 MB/sec)
351 would deliver below acceptable capacity for the initial user load. It is therefore a good
352 idea to begin with 1 Gb Ethernet cards for the two internal networks, each attached
353 to a 1 Gb Ethernet switch that provides connectivity to an expandable array of 100-Base-T
358 <indexterm><primary>network segments</primary></indexterm>
359 <indexterm><primary>RAID</primary></indexterm>
360 Considering the choice of 1 Gb Ethernet interfaces for the two local network segments,
361 the aggregate network I/O capacity will be 2100 Mb/sec (about 230 MB/sec), an I/O
362 demand that would require a fast disk storage I/O capability. Peak disk throughput is
363 limited by the disk subsystem chosen. It is desirable to provide the maximum
364 I/O bandwidth affordable. If a low-cost solution must be chosen,
365 3Ware IDE RAID Controllers are a good choice. These controllers can be fitted into a
366 64-bit, 66 MHz PCI-X slot. They appear to the operating system as a high-speed SCSI
367 controller that can operate at the peak of the PCI-X bandwidth (approximately 450 MB/sec).
368 Alternative SCSI-based hardware RAID controllers should also be considered. Alternately,
369 it makes sense to purchase well-known, branded hardware that has appropriate performance
370 specifications. As a minimum, one should attempt to provide a disk subsystem that can
371 deliver I/O rates of at least 100 MB/sec.
375 Disk storage requirements may be calculated as shown in <link linkend="ch4diskest"/>.
377 <example id="ch4diskest">
378 <title>Estimation of Disk Storage Requirements</title>
380 Corporate Data: 100 MBytes/user per year
381 Email Storage: 500 MBytes/user per year
382 Applications: 5000 MBytes
383 Safety Buffer: At least 50%
385 Given 500 Users and 2 years:
386 -----------------------------
387 Corporate Data: 2 x 100 x 500 = 100000 MBytes = 100 GBytes
388 Email Storage: 2 x 500 x 500 = 500000 MBytes = 500 GBytes
389 Applications: 5000 MBytes = 5 GBytes
390 ----------------------------
392 Add 50% buffer 303 GBytes
393 Recommended Storage: 908 GBytes
396 <indexterm><primary>storage capacity</primary></indexterm>
397 The preferred storage capacity should be approximately 1 Terabyte. Use of RAID level 5
398 with two hot spare drives would require an 8-drive by 200 GB capacity per drive array.
407 <title>Political Issues</title>
410 Your industry is coming under increasing accountability pressures. Increased paranoia
411 is necessary so you can demonstrate that you have acted with due diligence. You must
412 not trust your Internet connection.
416 Apart from permitting more efficient management of business applications through use of
417 an application server, your primary reason for the decision to implement this is that it
418 gives you greater control over software licensing.
422 <indexterm><primary>Outlook Express</primary></indexterm>
423 You are well aware that the current configuration results in some performance issues
424 as the size of the desktop profile grows. Given that users use Microsoft Outlook
425 Express, you know that the storage implications of the <constant>.PST</constant> file
426 is something that needs to be addressed later.
434 <title>Implementation</title>
437 <link linkend="ch04net"/> demonstrates the overall design of the network that you will implement.
441 The information presented here assumes that you are already familiar with many basic steps.
442 As this stands, the details provided already extend well beyond just the necessities of
443 Samba configuration. This decision is deliberate to ensure that key determinants
444 of a successful installation are not overlooked. This is the last case that documents
445 the finite minutiae of DHCP and DNS server configuration. Beyond the information provided
446 here, there are many other good reference books on these subjects.
450 The &smb.conf; file has the following noteworthy features:
455 The NetBIOS name of the Samba server is set to <constant>DIAMOND</constant>.
459 The Domain name is set to <constant>PROMISES</constant>.
463 <indexterm><primary>broadcast messages</primary></indexterm>
464 <indexterm><primary>interfaces</primary></indexterm>
465 <indexterm><primary>bind interfaces only</primary></indexterm>
466 Ethernet interface <constant>eth0</constant> is attached to the Internet connection
467 and is externally exposed. This interface is explicitly not available for Samba to use.
468 Samba listens on this interface for broadcast messages but does not broadcast any
469 information on <constant>eth0</constant>, nor does it accept any connections from it.
470 This is achieved by way of the <parameter>interfaces</parameter> parameter and the
471 <parameter>bind interfaces only</parameter> entry.
475 <indexterm><primary>passdb backend</primary></indexterm>
476 <indexterm><primary>tdbsam</primary></indexterm>
477 <indexterm><primary>binary database</primary></indexterm>
478 The <parameter>passdb backend</parameter> parameter specifies the creation and use
479 of the <constant>tdbsam</constant> password backend. This is a binary database that
480 has excellent scalability for a large number of user account entries.
484 <indexterm><primary>WINS serving</primary></indexterm>
485 <indexterm><primary>wins support</primary></indexterm>
486 <indexterm><primary>name resolve order</primary></indexterm>
487 WINS serving is enabled by the <smbconfoption name="wins support">Yes</smbconfoption>,
488 and name resolution is set to use it by means of the
489 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption> entry.
493 <indexterm><primary>time server</primary></indexterm>
494 The Samba server is configured for use by Windows clients as a time server.
498 <indexterm><primary>CUPS</primary></indexterm>
499 <indexterm><primary>printing</primary></indexterm>
500 <indexterm><primary>printcap name</primary></indexterm>
501 Samba is configured to directly interface with CUPS via the direct internal interface
502 that is provided by CUPS libraries. This is achieved with the
503 <smbconfoption name="printing">CUPS</smbconfoption> as well as the
504 <smbconfoption name="printcap name">CUPS</smbconfoption> entries.
508 <indexterm><primary>user management</primary></indexterm>
509 <indexterm><primary>group management</primary></indexterm>
510 <indexterm><primary>SRVTOOLS.EXE</primary></indexterm>
511 External interface scripts are provided to enable Samba to interface smoothly to
512 essential operating system functions for user and group management. This is important
513 to enable workstations to join the Domain and is also important so that you can use
514 the Windows NT4 Domain User Manager as well as the Domain Server Manager. These tools
515 are provided as part of the <filename>SRVTOOLS.EXE</filename> toolkit that can be
516 downloaded from the Microsoft FTP
517 <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">site</ulink>.
521 <indexterm><primary>User Mode</primary></indexterm>
522 The &smb.conf; file specifies that the Samba server will operate in (default) <parameter>
523 security = user</parameter> mode<footnote><para>See <emphasis>TOSHARG</emphasis>, Chapter 3.
524 This is necessary so that Samba can act as a Domain Controller (PDC); see
525 <emphasis>TOSHARG</emphasis>, Chapter 4, for additional information.</para></footnote>
530 <indexterm><primary>logon services</primary></indexterm>
531 <indexterm><primary>logon script</primary></indexterm>
532 Domain logon services as well as a Domain logon script are specified. The logon script
533 will be used to add robustness to the overall network configuration.
537 <indexterm><primary>roaming profiles</primary></indexterm>
538 <indexterm><primary>logon path</primary></indexterm>
539 <indexterm><primary>profile share</primary></indexterm>
540 Roaming profiles are enabled through the specification of the parameter,
541 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>. The value of this parameter translates the
542 <constant>%L</constant> to the name by which the Samba server is called by the client (for this
543 configuration, it translates to the name <constant>DIAMOND</constant>), and the <constant>%U</constant>
544 will translate to the name of the user within the context of the connection made to the profile share.
545 It is the administrator's responsibility to ensure there is a directory in the root of the
546 profile share for each user. This directory must be owned by the user also. An exception to this
547 requirement is when a profile is created for group use.
551 <indexterm><primary>virus</primary></indexterm>
552 <indexterm><primary>opportunistic locking</primary></indexterm>
553 Precautionary veto is effected for particular Windows file names that have been targeted by
554 virus-related activity. Additionally, Microsoft Office files are vetoed from opportunistic locking
555 controls. This should help to prevent lock contention-related file access problems.
559 Every user has a private home directory on the UNIX/Linux host. This is mapped to
560 a network drive that is the same for all users.
566 The configuration of the server is the most complex so far. The following steps are used:
569 <orderedlist numeration="arabic">
571 Basic System Configuration
579 DHCP and DNS Server Configuration
583 Printer Configuration
587 Process Start-up Configuration
595 Application Share Configuration
599 Windows Client Configuration
604 The following sections cover each step in logical and defined detail.
608 <title>Basic System Configuration</title>
611 <indexterm><primary>SUSE Enterprise Linux Server</primary></indexterm>
612 The preparation in this section assumes that your SUSE Enterprise Linux Server 8.0 system has been
613 freshly installed. It prepares basic files so that the system is ready for comprehensive
614 operation in line with the network diagram shown in <link linkend="ch04net"/>.
618 <title>Server Configuration Steps</title>
621 <indexterm><primary>hostname</primary></indexterm>
622 Using the UNIX/Linux system tools, name the server <constant>server.abmas.us</constant>.
623 Verify that your hostname is correctly set by running:
625 &rootprompt; uname -n
628 An alternate method to verify the hostname is:
630 &rootprompt; hostname -f
636 <indexterm><primary>/etc/hosts</primary></indexterm>
637 <indexterm><primary>localhost</primary></indexterm>
638 Edit your <filename>/etc/hosts</filename> file to include the primary names and addresses
639 of all network interfaces that are on the host server. This is necessary so that during
640 startup the system can resolve all its own names to the IP address prior to
641 startup of the DNS server. An example of entries that should be in the
642 <filename>/etc/hosts</filename> file is:
645 192.168.1.1 sleeth1.abmas.biz sleeth1 diamond
646 192.168.2.1 sleeth2.abmas.biz sleeth2
647 123.45.67.66 server.abmas.us server
649 You should check the startup order of your system. If the CUPS print server is started before
650 the DNS server (<command>named</command>), you should also include an entry for the printers
651 in the <filename>/etc/hosts</filename> file, as follows:
653 192.168.1.20 qmsa.abmas.biz qmsa
654 192.168.1.30 hplj6a.abmas.biz hplj6a
655 192.168.2.20 qmsf.abmas.biz qmsf
656 192.168.2.30 hplj6f.abmas.biz hplj6f
658 <indexterm><primary>named</primary></indexterm>
659 <indexterm><primary>cupsd</primary></indexterm>
660 <indexterm><primary>daemon</primary></indexterm>
661 The printer entries are not necessary if <command>named</command> is started prior to
662 startup of <command>cupsd</command>, the CUPS daemon.
666 <indexterm><primary>/etc/rc.d/boot.local</primary></indexterm>
667 <indexterm><primary>IP forwarding</primary></indexterm>
668 <indexterm><primary>/proc/sys/net/ipv4/ip_forward</primary></indexterm>
669 The host server is acting as a router between the two internal network segments as well
670 as for all Internet access. This necessitates that IP forwarding be enabled. This can be
671 achieved by adding to the <filename>/etc/rc.d/boot.local</filename> an entry as follows:
673 echo 1 > /proc/sys/net/ipv4/ip_forward
675 To ensure that your kernel is capable of IP forwarding during configuration, you may
676 wish to execute that command manually also. This setting permits the Linux system to
677 act as a router.<footnote><para>You may want to do the echo command last and include
678 "0" in the init scripts, since it opens up your network for a short time.</para></footnote>
682 <indexterm><primary>firewall</primary></indexterm>
683 <indexterm><primary>abmas-netfw.sh</primary></indexterm>
684 Installation of a basic firewall and NAT facility is necessary.
685 The following script can be installed in the <filename>/usr/local/sbin</filename>
686 directory. It is executed from the <filename>/etc/rc.d/boot.local</filename> startup
687 script. In your case, this script is called <filename>abmas-netfw.sh</filename>. The
688 script contents are shown in <link linkend="ch4natfw"/>.
690 <example id="ch4natfw">
691 <title>NAT Firewall Configuration Script</title>
694 echo -e "\n\nLoading NAT firewall.\n"
695 IPTABLES=/usr/sbin/iptables
701 /sbin/modprobe -i ip_tables
702 /sbin/modprobe -i ip_conntrack
703 /sbin/modprobe -i ip_conntrack_ftp
704 /sbin/modprobe -i iptable_nat
705 /sbin/modprobe -i ip_nat_ftp
706 $IPTABLES -P INPUT DROP
708 $IPTABLES -P OUTPUT ACCEPT
710 $IPTABLES -P FORWARD DROP
713 $IPTABLES -A INPUT -i lo -j ACCEPT
714 $IPTABLES -A INPUT -i $INTIFA -j ACCEPT
715 $IPTABLES -A INPUT -i $INTIFB -j ACCEPT
716 $IPTABLES -A INPUT -i $EXTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
717 # Enable incoming traffic for: SSH, SMTP, DNS(tcp), HTTP, HTTPS
718 for i in 22 25 53 80 443
720 $IPTABLES -A INPUT -i $EXTIF -p tcp --dport $i -j ACCEPT
723 $IPTABLES -A INPUT -i $EXTIF -p udp -dport 53 -j ACCEPT
724 echo "Allow all connections OUT and only existing and specified ones IN"
725 $IPTABLES -A FORWARD -i $EXTIF -o $INTIFA -m state \
726 --state ESTABLISHED,RELATED -j ACCEPT
727 $IPTABLES -A FORWARD -i $EXTIF -o $INTIFB -m state \
728 --state ESTABLISHED,RELATED -j ACCEPT
729 $IPTABLES -A FORWARD -i $INTIFA -o $EXTIF -j ACCEPT
730 $IPTABLES -A FORWARD -i $INTIFB -o $EXTIF -j ACCEPT
731 $IPTABLES -A FORWARD -j LOG
732 echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF"
733 $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
734 echo "1" > /proc/sys/net/ipv4/ip_forward
735 echo -e "\nNAT firewall done.\n"
741 Execute the following to make the script executable:
743 &rootprompt; chmod 755 /usr/local/sbin/abmas-natfw.sh
745 You must now edit <filename>/etc/rc.d/boot.local</filename> to add an entry
746 that runs your <command>abmas-natfw.sh</command> script. The following
751 # Copyright (c) 2002 SUSE Linux AG Nuernberg, Germany.
752 # All rights reserved.
754 # Author: Werner Fink, 1996
755 # Burchard Steinbild, 1996
757 # /etc/init.d/boot.local
759 # script with local commands to be executed from init on system startup
761 # Here you should add things that should happen directly after booting
762 # before we're going to the first run level.
764 /usr/local/sbin/abmas-natfw.sh
770 <indexterm><primary>/etc/hosts</primary></indexterm>
771 The server is now ready for Samba configuration. During the validation step, you remove
772 the entry for the Samba server <constant>diamond</constant> from the <filename>/etc/hosts</filename>
773 file. This is done after you are satisfied that DNS-based name resolution is functioning correctly.
779 <title>Samba Configuration</title>
782 When you have completed this section, the Samba server is ready for testing and validation;
783 however, testing and validation have to wait until DHCP, DNS, and printing (CUPS) services have
788 <title>Samba Configuration Steps</title>
791 Install the Samba-3 binary RPM from the Samba-Team FTP site. Assuming that the binary
792 RPM file is called <filename>samba-3.0.20-1.i386.rpm</filename>, one way to install this
795 &rootprompt; rpm -Uvh samba-3.0.20-1.i386.rpm
797 This operation must be performed while logged in as the <command>root</command> user.
798 Successful operation is clearly indicated. If this installation should fail for any reason,
799 refer to the operating system manufacturer's documentation for guidance.
803 Install the &smb.conf; file shown in <link linkend="promisnet"/>, <link linkend="promisnetsvca"/>,
804 and <link linkend="promisnetsvcb"/>. Concatenate (join) all three files to make a single &smb.conf;
805 file. The final, fully qualified path for this file should be <filename>/etc/samba/smb.conf</filename>.
807 <example id="promisnet">
808 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; [globals] Section</title>
810 <smbconfcomment>Global parameters</smbconfcomment>
811 <smbconfsection name="[global]"/>
812 <smbconfoption name="workgroup">PROMISES</smbconfoption>
813 <smbconfoption name="netbios name">DIAMOND</smbconfoption>
814 <smbconfoption name="interfaces">eth1, eth2, lo</smbconfoption>
815 <smbconfoption name="bind interfaces only">Yes</smbconfoption>
816 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
817 <smbconfoption name="pam password change">Yes</smbconfoption>
818 <smbconfoption name="passwd program">/usr/bin/passwd %u</smbconfoption>
819 <smbconfoption name="passwd chat">*New*Password* %n\n *Re-enter*new*password*%n\n *Password*changed*</smbconfoption>
820 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
821 <smbconfoption name="unix password sync">Yes</smbconfoption>
822 <smbconfoption name="log level">1</smbconfoption>
823 <smbconfoption name="syslog">0</smbconfoption>
824 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
825 <smbconfoption name="max log size">50</smbconfoption>
826 <smbconfoption name="smb ports">139 445</smbconfoption>
827 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
828 <smbconfoption name="time server">Yes</smbconfoption>
829 <smbconfoption name="printcap name">CUPS</smbconfoption>
830 <smbconfoption name="show add printer wizard">No</smbconfoption>
831 <smbconfoption name="add user script">/usr/sbin/useradd -m '%u'</smbconfoption>
832 <smbconfoption name="delete user script">/usr/sbin/userdel -r '%u'</smbconfoption>
833 <smbconfoption name="add group script">/usr/sbin/groupadd '%g'</smbconfoption>
834 <smbconfoption name="delete group script">/usr/sbin/groupdel '%g'</smbconfoption>
835 <smbconfoption name="add user to group script">/usr/sbin/usermod -G '%g' '%u'</smbconfoption>
836 <smbconfoption name="add machine script">/usr/sbin/useradd -s /bin/false -d /tmp '%u'</smbconfoption>
837 <smbconfoption name="shutdown script">/var/lib/samba/scripts/shutdown.sh</smbconfoption>
838 <smbconfoption name="abort shutdown script">/sbin/shutdown -c</smbconfoption>
839 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
840 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
841 <smbconfoption name="logon drive">X:</smbconfoption>
842 <smbconfoption name="logon home">\\%L\%U</smbconfoption>
843 <smbconfoption name="domain logons">Yes</smbconfoption>
844 <smbconfoption name="preferred master">Yes</smbconfoption>
845 <smbconfoption name="wins support">Yes</smbconfoption>
846 <smbconfoption name="utmp">Yes</smbconfoption>
847 <smbconfoption name="map acl inherit">Yes</smbconfoption>
848 <smbconfoption name="printing">cups</smbconfoption>
849 <smbconfoption name="cups options">Raw</smbconfoption>
850 <smbconfoption name="veto files">/*.eml/*.nws/*.{*}/</smbconfoption>
851 <smbconfoption name="veto oplock files">/*.doc/*.xls/*.mdb/</smbconfoption>
855 <example id="promisnetsvca">
856 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part A</title>
858 <smbconfsection name="[homes]"/>
859 <smbconfoption name="comment">Home Directories</smbconfoption>
860 <smbconfoption name="valid users">%S</smbconfoption>
861 <smbconfoption name="read only">No</smbconfoption>
862 <smbconfoption name="browseable">No</smbconfoption>
864 <smbconfsection name="[printers]"/>
865 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
866 <smbconfoption name="path">/var/spool/samba</smbconfoption>
867 <smbconfoption name="guest ok">Yes</smbconfoption>
868 <smbconfoption name="printable">Yes</smbconfoption>
869 <smbconfoption name="use client driver">Yes</smbconfoption>
870 <smbconfoption name="default devmode">Yes</smbconfoption>
871 <smbconfoption name="browseable">No</smbconfoption>
873 <smbconfsection name="[netlogon]"/>
874 <smbconfoption name="comment">Network Logon Service</smbconfoption>
875 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
876 <smbconfoption name="guest ok">Yes</smbconfoption>
877 <smbconfoption name="locking">No</smbconfoption>
879 <smbconfsection name="[profiles]"/>
880 <smbconfoption name="comment">Profile Share</smbconfoption>
881 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
882 <smbconfoption name="read only">No</smbconfoption>
883 <smbconfoption name="profile acls">Yes</smbconfoption>
885 <smbconfsection name="[accounts]"/>
886 <smbconfoption name="comment">Accounting Files</smbconfoption>
887 <smbconfoption name="path">/data/accounts</smbconfoption>
888 <smbconfoption name="read only">No</smbconfoption>
892 <example id="promisnetsvcb">
893 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part B</title>
895 <smbconfsection name="[service]"/>
896 <smbconfoption name="comment">Financial Services Files</smbconfoption>
897 <smbconfoption name="path">/data/service</smbconfoption>
898 <smbconfoption name="read only">No</smbconfoption>
900 <smbconfsection name="[pidata]"/>
901 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
902 <smbconfoption name="path">/data/pidata</smbconfoption>
903 <smbconfoption name="read only">No</smbconfoption>
905 <smbconfsection name="[apps]"/>
906 <smbconfoption name="comment">Application Files</smbconfoption>
907 <smbconfoption name="path">/apps</smbconfoption>
908 <smbconfoption name="read only">Yes</smbconfoption>
909 <smbconfoption name="admin users">bjordan</smbconfoption>
915 <indexterm><primary>administrator</primary></indexterm><indexterm>
916 <primary>smbpasswd</primary>
918 Add the <constant>root</constant> user to the password backend as follows:
920 &rootprompt; smbpasswd -a root
921 New SMB password: XXXXXXXX
922 Retype new SMB password: XXXXXXXX
925 The <constant>root</constant> account is the UNIX equivalent of the Windows Domain Administrator.
926 This account is essential in the regular maintenance of your Samba server. It must never be
927 deleted. If for any reason the account is deleted, you may not be able to recreate this account
928 without considerable trouble.
932 <indexterm><primary>username map</primary></indexterm>
933 Create the username map file to permit the <constant>root</constant> account to be called
934 <constant>Administrator</constant> from the Windows network environment. To do this, create
935 the file <filename>/etc/samba/smbusers</filename> with the following contents:
942 # Unix_ID = Windows_ID
945 # root = Administrator
946 # janes = "Jane Smith"
949 # Note: If the name contains a space it must be double quoted.
950 # In the example above the name 'jimbo' will be mapped to Windows
951 # user names 'Jim' and 'Bones' because the space was not quoted.
952 #######################################################################
961 <indexterm><primary>initGrps.sh</primary></indexterm>
962 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>add</tertiary></indexterm>
963 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>modify</tertiary></indexterm>
964 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>list</tertiary></indexterm>
965 Create and map Windows Domain Groups to UNIX groups. A sample script is provided in <link linkend="small"/>,
966 <link linkend="initGrps"/>. Create a file containing this script. We called ours
967 <filename>/etc/samba/initGrps.sh</filename>. Set this file so it can be executed,
968 and then execute the script. Sample output should be as follows:
970 <example id="ch4initGrps">
971 <title>Script to Map Windows NT Groups to UNIX Groups</title>
972 <indexterm><primary>initGrps.sh</primary></indexterm>
983 # Map Windows Domain Groups to UNIX groups
984 net groupmap modify ntgroup="Domain Admins" unixgroup=root
985 net groupmap modify ntgroup="Domain Users" unixgroup=users
986 net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
988 # Add Functional Domain Groups
989 net groupmap add ntgroup="Accounts Dept" unixgroup=acctsdep type=d
990 net groupmap add ntgroup="Financial Services" unixgroup=finsrvcs type=d
991 net groupmap add ntgroup="Insurance Group" unixgroup=piops type=d
993 # Map Windows NT machine local groups to local UNIX groups
994 # Mapping of local groups is not necessary and not functional
995 # for this installation.
1000 &rootprompt; chmod 755 initGrps.sh
1001 &rootprompt; /etc/samba # ./initGrps.sh
1002 Updated mapping entry for Domain Admins
1003 Updated mapping entry for Domain Users
1004 Updated mapping entry for Domain Guests
1005 No rid or sid specified, choosing algorithmic mapping
1006 Successfully added group Accounts Dept to the mapping db
1007 No rid or sid specified, choosing algorithmic mapping
1008 Successfully added group Domain Guests to the mapping db
1010 &rootprompt; /etc/samba # net groupmap list | sort
1011 Account Operators (S-1-5-32-548) -> -1
1012 Accounts Dept (S-1-5-21-179504-2437109-488451-2003) -> acctsdep
1013 Administrators (S-1-5-32-544) -> -1
1014 Backup Operators (S-1-5-32-551) -> -1
1015 Domain Admins (S-1-5-21-179504-2437109-488451-512) -> root
1016 Domain Guests (S-1-5-21-179504-2437109-488451-514) -> nobody
1017 Domain Users (S-1-5-21-179504-2437109-488451-513) -> users
1018 Financial Services (S-1-5-21-179504-2437109-488451-2005) -> finsrvcs
1019 Guests (S-1-5-32-546) -> -1
1020 Power Users (S-1-5-32-547) -> -1
1021 Print Operators (S-1-5-32-550) -> -1
1022 Replicators (S-1-5-32-552) -> -1
1023 System Operators (S-1-5-32-549) -> -1
1024 Users (S-1-5-32-545) -> -1
1029 <indexterm><primary>useradd</primary></indexterm>
1030 <indexterm><primary>adduser</primary></indexterm>
1031 <indexterm><primary>passwd</primary></indexterm>
1032 <indexterm><primary>smbpasswd</primary></indexterm>
1033 <indexterm><primary>/etc/passwd</primary></indexterm>
1034 <indexterm><primary>password</primary><secondary>backend</secondary></indexterm>
1035 <indexterm><primary>user</primary><secondary>management</secondary></indexterm>
1036 There is one preparatory step without which you will not have a working Samba
1037 network environment. You must add an account for each network user.
1038 For each user who needs to be given a Windows Domain account, make an entry in the
1039 <filename>/etc/passwd</filename> file as well as in the Samba password backend.
1040 Use the system tool of your choice to create the UNIX system account, and use the Samba
1041 <command>smbpasswd</command> to create a Domain user account.
1042 There are a number of tools for user management under UNIX, such as
1043 <command>useradd</command>, and <command>adduser</command>, as well as a plethora of custom
1044 tools. You also want to create a home directory for each user.
1045 You can do this by executing the following steps for each user:
1047 &rootprompt; useradd -m <parameter>username</parameter>
1048 &rootprompt; passwd <parameter>username</parameter>
1049 Changing password for <parameter>username</parameter>.
1050 New password: XXXXXXXX
1051 Re-enter new password: XXXXXXXX
1053 &rootprompt; smbpasswd -a <parameter>username</parameter>
1054 New SMB password: XXXXXXXX
1055 Retype new SMB password: XXXXXXXX
1056 Added user <parameter>username</parameter>.
1058 You do of course use a valid user login ID in place of <parameter>username</parameter>.
1062 <indexterm><primary>file system</primary><secondary>access control</secondary></indexterm>
1063 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1064 <indexterm><primary>group membership</primary></indexterm>
1065 Using the preferred tool for your UNIX system, add each user to the UNIX groups created
1066 previously as necessary. File system access control will be based on UNIX group membership.
1070 Create the directory mount point for the disk subsystem that can be mounted to provide
1071 data storage for company files. In this case the mount point is indicated in the &smb.conf;
1072 file is <filename>/data</filename>. Format the file system as required, and mount the formatted
1073 file system partition using appropriate system tools.
1077 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1078 Create the top-level file storage directories for data and applications as follows:
1080 &rootprompt; mkdir -p /data/{accounts,finsvcs}
1081 &rootprompt; mkdir -p /apps
1082 &rootprompt; chown -R root:root /data
1083 &rootprompt; chown -R root:root /apps
1084 &rootprompt; chown -R bjordan:accounts /data/accounts
1085 &rootprompt; chown -R bjordan:finsvcs /data/finsvcs
1086 &rootprompt; chmod -R ug+rwxs,o-rwx /data
1087 &rootprompt; chmod -R ug+rwx,o+rx-w /apps
1089 Each department is responsible for creating its own directory structure within the departmental
1090 share. The directory root of the <command>accounts</command> share is <filename>/data/accounts</filename>.
1091 The directory root of the <command>finsvcs</command> share is <filename>/data/finsvcs</filename>.
1092 The <filename>/apps</filename> directory is the root of the <constant>apps</constant> share
1093 that provides the application server infrastructure.
1097 The &smb.conf; file specifies an infrastructure to support roaming profiles and network
1098 logon services. You can now create the file system infrastructure to provide the
1099 locations on disk that these services require. Adequate planning is essential,
1100 since desktop profiles can grow to be quite large. For planning purposes, a minimum of
1101 200 MB of storage should be allowed per user for profile storage. The following
1102 commands create the directory infrastructure needed:
1104 &rootprompt; mkdir -p /var/spool/samba
1105 &rootprompt; mkdir -p /var/lib/samba/{netlogon/scripts,profiles}
1106 &rootprompt; chown -R root:root /var/spool/samba
1107 &rootprompt; chown -R root:root /var/lib/samba
1108 &rootprompt; chmod a+rwxt /var/spool/samba
1110 For each user account that is created on the system, the following commands should be
1113 &rootprompt; mkdir /var/lib/samba/profiles/'username'
1114 &rootprompt; chown 'username':users /var/lib/samba/profiles/'username'
1115 &rootprompt; chmod ug+wrx,o+rx,-w /var/lib/samba/profiles/'username'
1120 <indexterm><primary>logon scrip</primary></indexterm>
1121 <indexterm><primary>unix2dos</primary></indexterm>
1122 <indexterm><primary>dos2unix</primary></indexterm>
1123 Create a logon script. It is important that each line is correctly terminated with
1124 a carriage return and line-feed combination (i.e., DOS encoding). The following procedure
1125 works if the right tools (<constant>unix2dos</constant> and <constant>dos2unix</constant>) are installed.
1126 First, create a file called <filename>/var/lib/samba/netlogon/scripts/logon.bat.unix</filename>
1127 with the following contents:
1129 net time \\diamond /set /yes
1131 net use p: \\diamond\apps
1133 Convert the UNIX file to a DOS file using the <command>unix2dos</command> as shown here:
1135 &rootprompt; unix2dos < /var/lib/samba/netlogon/scripts/logon.bat.unix \
1136 > /var/lib/samba/netlogon/scripts/logon.bat
1143 <sect2 id="ch4dhcpdns">
1144 <title>Configuration of DHCP and DNS Servers</title>
1147 DHCP services are a basic component of the entire network client installation. DNS operation is
1148 foundational to Internet access as well as to trouble-free operation of local networking. When
1149 you have completed this section, the server should be ready for solid duty operation.
1153 <title>DHCP and DNS Server Configuration Steps</title>
1156 <indexterm><primary>/etc/dhcpd.conf</primary></indexterm>
1157 Create a file called <filename>/etc/dhcpd.conf</filename> with the contents as
1158 shown in <link linkend="prom-dhcp"/>.
1160 <example id="prom-dhcp">
1161 <title>DHCP Server Configuration File &smbmdash; <filename>/etc/dhcpd.conf</filename></title>
1163 # Abmas Accounting Inc.
1164 default-lease-time 86400;
1165 max-lease-time 172800;
1166 default-lease-time 86400;
1167 option ntp-servers 192.168.1.1;
1168 option domain-name "abmas.biz";
1169 option domain-name-servers 192.168.1.1, 192.168.2.1;
1170 option netbios-name-servers 192.168.1.1, 192.168.2.1;
1171 option netbios-node-type 8; ### Node type = Hybrid ###
1172 ddns-updates on; ### Dynamic DNS enabled ###
1173 ddns-update-style interim;
1175 subnet 192.168.1.0 netmask 255.255.255.0 {
1176 range dynamic-bootp 192.168.1.128 192.168.1.254;
1177 option subnet-mask 255.255.255.0;
1178 option routers 192.168.1.1;
1179 allow unknown-clients;
1181 hardware ethernet 08:00:46:7a:35:e4;
1182 fixed-address 192.168.1.20;
1185 hardware ethernet 00:03:47:cb:81:e0;
1186 fixed-address 192.168.1.30;
1189 subnet 192.168.2.0 netmask 255.255.255.0 {
1190 range dynamic-bootp 192.168.2.128 192.168.2.254;
1191 option subnet-mask 255.255.255.0;
1192 option routers 192.168.2.1;
1193 allow unknown-clients;
1195 hardware ethernet 01:04:31:db:e1:c0;
1196 fixed-address 192.168.1.20;
1199 hardware ethernet 00:03:47:cf:83:e2;
1200 fixed-address 192.168.2.30;
1203 subnet 127.0.0.0 netmask 255.0.0.0 {
1205 subnet 123.45.67.64 netmask 255.255.255.252 {
1212 <indexterm><primary>/etc/named.conf</primary></indexterm>
1213 Create a file called <filename>/etc/named.conf</filename> that has the combined contents
1214 of the <link linkend="ch4namedcfg"/>, <link linkend="ch4namedvarfwd"/>, and
1215 <link linkend="ch4namedvarrev"/> files that are concatenated (merged) in this
1220 Create the files shown in their directories as follows: (John, on this page, the numbered entry comes after the table it's referencing!!!!!)
1222 <table id="namedrscfiles">
1223 <title>DNS (named) Resource Files</title>
1225 <colspec align="left"/>
1226 <colspec align="left"/>
1229 <entry>Reference</entry>
1230 <entry>File Location</entry>
1235 <entry><link linkend="loopback"/></entry>
1236 <entry>/var/lib/named/localhost.zone</entry>
1239 <entry><link linkend="dnsloopy"/></entry>
1240 <entry>/var/lib/named/127.0.0.zone</entry>
1243 <entry><link linkend="roothint"/></entry>
1244 <entry>/var/lib/named/root.hint</entry>
1247 <entry><link linkend="abmasbiz"/></entry>
1248 <entry>/var/lib/named/master/abmas.biz.hosts</entry>
1251 <entry><link linkend="abmasus"/></entry>
1252 <entry>/var/lib/named/abmas.us.hosts</entry>
1255 <entry><link linkend="eth1zone"/></entry>
1256 <entry>/var/lib/named/192.168.1.0.rev</entry>
1259 <entry><link linkend="eth2zone"/></entry>
1260 <entry>/var/lib/named/192.168.2.0.rev</entry>
1266 <example id="ch4namedcfg">
1267 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Master Section</title>
1268 <indexterm><primary>/etc/named.conf</primary></indexterm>
1271 # Abmas Biz DNS Control File
1273 # Date: November 15, 2003
1276 directory "/var/lib/named";
1285 multiple-cnames yes;
1294 zone "localhost" in {
1296 file "localhost.zone";
1299 zone "0.0.127.in-addr.arpa" in {
1301 file "127.0.0.zone";
1317 <example id="ch4namedvarfwd">
1318 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Forward Lookup Definition Section</title>
1322 file "/var/lib/named/master/abmas.biz.hosts";
1336 file "/var/lib/named/master/abmas.us.hosts";
1347 <example id="ch4namedvarrev">
1348 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Reverse Lookup Definition Section</title>
1350 zone "1.168.192.in-addr.arpa" {
1352 file "/var/lib/named/master/192.168.1.0.rev";
1364 zone "2.168.192.in-addr.arpa" {
1366 file "/var/lib/named/master/192.168.2.0.rev";
1380 <example id="eth1zone">
1381 <title>DNS 192.168.1 Reverse Zone File</title>
1384 $TTL 38400 ; 10 hours 40 minutes
1385 1.168.192.in-addr.arpa IN SOA sleeth.abmas.biz. root.abmas.biz. (
1387 10800 ; refresh (3 hours)
1388 3600 ; retry (1 hour)
1389 604800 ; expire (1 week)
1390 38400 ; minimum (10 hours 40 minutes)
1392 NS sleeth1.abmas.biz.
1393 $ORIGIN 1.168.192.in-addr.arpa.
1394 1 PTR sleeth1.abmas.biz.
1395 20 PTR qmsa.abmas.biz.
1396 30 PTR hplj6a.abmas.biz.
1400 <example id="eth2zone">
1401 <title>DNS 192.168.2 Reverse Zone File</title>
1404 $TTL 38400 ; 10 hours 40 minutes
1405 2.168.192.in-addr.arpa IN SOA sleeth.abmas.biz. root.abmas.biz. (
1407 10800 ; refresh (3 hours)
1408 3600 ; retry (1 hour)
1409 604800 ; expire (1 week)
1410 38400 ; minimum (10 hours 40 minutes)
1412 NS sleeth2.abmas.biz.
1413 $ORIGIN 2.168.192.in-addr.arpa.
1414 1 PTR sleeth2.abmas.biz.
1415 20 PTR qmsf.abmas.biz.
1416 30 PTR hplj6f.abmas.biz.
1420 <example id="abmasbiz">
1421 <title>DNS Abmas.biz Forward Zone File</title>
1424 $TTL 38400 ; 10 hours 40 minutes
1425 abmas.biz IN SOA sleeth1.abmas.biz. root.abmas.biz. (
1427 10800 ; refresh (3 hours)
1428 3600 ; retry (1 hour)
1429 604800 ; expire (1 week)
1430 38400 ; minimum (10 hours 40 minutes)
1433 MX 10 mail.abmas.biz.
1435 sleeth1 A 192.168.1.1
1436 sleeth2 A 192.168.2.1
1438 hplj6a A 192.168.1.30
1440 hplj6f A 192.168.2.30
1442 diamond CNAME sleeth1
1447 <example id="abmasus">
1448 <title>DNS Abmas.us Forward Zone File</title>
1451 $TTL 38400 ; 10 hours 40 minutes
1452 abmas.us IN SOA server.abmas.us. root.abmas.us. (
1454 10800 ; refresh (3 hours)
1455 3600 ; retry (1 hour)
1456 604800 ; expire (1 week)
1457 38400 ; minimum (10 hours 40 minutes)
1461 MX 10 mail.abmas.us.
1463 server A 123.45.67.66
1475 <indexterm><primary>/etc/resolv.conf</primary></indexterm><indexterm>
1476 <primary>name resolution</primary>
1478 All DNS name resolution should be handled locally. To ensure that the server is configured
1479 correctly to handle this, edit <filename>/etc/resolv.conf</filename> to have the following
1482 search abmas.us abmas.biz
1483 nameserver 127.0.0.1
1484 nameserver 123.45.54.23
1487 <primary>DNS server</primary>
1489 This instructs the name resolver function (when configured correctly) to ask the DNS server
1490 that is running locally to resolve names to addresses. In the event that the local name server
1491 is not available, ask the name server provided by the ISP. The latter, of course, does not resolve
1492 purely local names to IP addresses.
1496 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1497 The final step is to edit the <filename>/etc/nsswitch.conf</filename> file.
1498 This file controls the operation of the various resolver libraries that are part of the Linux
1499 Glibc libraries. Edit this file so that it contains the following entries:
1501 hosts: files dns wins
1507 The basic DHCP and DNS services are now ready for validation testing. Before you can proceed,
1508 there are a few more steps along the road. First, configure the print spooling and print
1509 processing system. Then you can configure the server so that all services
1510 start automatically on reboot. You must also manually start all services prior to validation testing.
1515 <sect2 id="ch4ptrcfg">
1516 <title>Printer Configuration</title>
1519 Network administrators who are new to CUPS based printing typically experience some difficulty mastering
1520 its powerful features. The steps outlined in this section are designed to navigate around the distractions
1521 of learning CUPS. Instead of implementing smart features and capabilties our approach is to use it as a
1522 transparent print queue that performs no filtering, and only minimal handling of each print job that is
1523 submitted to it. In other words, our configuration turns CUPS into a raw-mode print queue. This means that
1524 the correct printer driver must be installed on all clients.
1528 <title>Printer Configuration Steps</title>
1531 Configure each printer to be a DHCP client, carefully following the manufacturer's guidelines.
1535 Follow the instructions in the printer manufacturer's manuals to permit printing to port 9100.
1536 Use any other port the manufacturer specifies for direct-mode raw printing, and adjust the
1537 port as necessary in the following example commands.
1538 This allows the CUPS spooler to print using raw mode protocols.
1539 <indexterm><primary>CUPS</primary></indexterm>
1540 <indexterm><primary>raw printing</primary></indexterm>
1544 <indexterm><primary>CUPS</primary><secondary>queue</secondary></indexterm><indexterm>
1545 <primary>lpadmin</primary>
1547 Configure the CUPS Print Queues as follows:
1549 &rootprompt; lpadmin -p qmsa -v socket://qmsa.abmas.biz:9100 -E
1550 &rootprompt; lpadmin -p hplj6a -v socket://hplj6a.abmas.biz:9100 -E
1551 &rootprompt; lpadmin -p qmsf -v socket://qmsf.abmas.biz:9100 -E
1552 &rootprompt; lpadmin -p hplj6f -v socket://hplj6f.abmas.biz:9100 -E
1554 <indexterm><primary>print filter</primary></indexterm>
1555 This creates the necessary print queues with no assigned print filter.
1558 <step><para><indexterm>
1559 <primary>enable</primary>
1561 Print queues may not be enabled at creation. Use <command>lpc stat</command> to check
1562 the status of the print queues and, if necessary, make certain that the queues you have
1563 just created are enabled by executing the following:
1565 &rootprompt; /usr/bin/enable qmsa
1566 &rootprompt; /usr/bin/enable hplj6a
1567 &rootprompt; /usr/bin/enable qmsf
1568 &rootprompt; /usr/bin/enable hplj6f
1572 <step><para><indexterm>
1573 <primary>accept</primary>
1575 Even though your print queues may be enabled, it is still possible that they
1576 are not accepting print jobs. A print queue services incoming printing
1577 requests only when configured to do so. Ensure that your print queues are
1578 set to accept incoming jobs by executing the following commands:
1580 &rootprompt; /usr/bin/accept qmsa
1581 &rootprompt; /usr/bin/accept hplj6a
1582 &rootprompt; /usr/bin/accept qmsf
1583 &rootprompt; /usr/bin/accept hplj6f
1588 <indexterm><primary>mime type</primary></indexterm>
1589 <indexterm><primary>/etc/mime.convs</primary></indexterm>
1590 <indexterm><primary>application/octet-stream</primary></indexterm>
1591 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
1593 application/octet-stream application/vnd.cups-raw 0 -
1598 <indexterm><primary>/etc/mime.types</primary></indexterm>
1599 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
1601 application/octet-stream
1606 Printing drivers are installed on each network client workstation.
1611 Note: If the parameter <parameter>cups options = Raw</parameter> is specified in the &smb.conf; file,
1612 the last two steps can be omitted where CUPS version 1.1.18, or later.
1616 The UNIX system print queues have been configured and are ready for validation testing.
1621 <sect2 id="procstart">
1622 <title>Process Startup Configuration</title>
1625 <indexterm><primary>chkconfig</primary></indexterm>
1626 There are two essential steps to process startup configuration. First, the process
1627 must be configured so that it automatically restarts each time the server
1628 is rebooted. This step involves use of the <command>chkconfig</command> tool that
1629 creates the appropriate symbolic links from the master daemon control file that is
1630 located in the <filename>/etc/rc.d</filename> directory, to the <filename>/etc/rc'x'.d</filename>
1631 directories. Links are created so that when the system run level is changed, the
1632 necessary start or kill script is run.
1636 <indexterm><primary>/etc/xinetd.d</primary></indexterm>
1637 <indexterm><primary>inetd</primary></indexterm>
1638 <indexterm><primary>xinetd</primary></indexterm>
1639 <indexterm><primary>chkconfig</primary></indexterm>
1640 <indexterm><primary>super daemon</primary></indexterm>
1641 In the event that a service is not run as a daemon, but via the internetworking
1642 super daemon (<command>inetd</command> or <command>xinetd</command>), then the <command>chkconfig</command>
1643 tool makes the necessary entries in the <filename>/etc/xinetd.d</filename> directory
1644 and sends a hang-up (HUP) signal to the the super daemon, thus forcing it to
1645 re-read its control files.
1649 Last, each service must be started to permit system validation to proceed.
1654 Use the standard system tool to configure each service to restart
1655 automatically at every system reboot. For example,
1656 <indexterm><primary>chkconfig</primary></indexterm>
1658 &rootprompt; chkconfig dhpc on
1659 &rootprompt; chkconfig named on
1660 &rootprompt; chkconfig cups on
1661 &rootprompt; chkconfig smb on
1666 <indexterm><primary>starting dhcpd</primary></indexterm>
1667 <indexterm><primary>starting samba</primary></indexterm>
1668 <indexterm><primary>starting CUPS</primary></indexterm>
1669 Now start each service to permit the system to be validated.
1670 Execute each of the following in the sequence shown:
1673 &rootprompt; /etc/rc.d/init.d/dhcp restart
1674 &rootprompt; /etc/rc.d/init.d/named restart
1675 &rootprompt; /etc/rc.d/init.d/cups restart
1676 &rootprompt; /etc/rc.d/init.d/smb restart
1683 <sect2 id="ch4valid">
1684 <title>Validation</title>
1687 <indexterm><primary>validation</primary></indexterm>
1688 Complex networking problems are most often caused by simple things that are poorly or incorrectly
1689 configured. The validation process adopted here should be followed carefully; it is the result of the
1690 experience gained from years of making and correcting the most common mistakes. Shortcuts often lead to basic errors. You should
1691 refrain from taking shortcuts, from making basic assumptions, and from not exercising due process
1692 and diligence in network validation. By thoroughly testing and validating every step in the process
1693 of network installation and configuration, you can save yourself from sleepless nights and restless
1694 days. A well debugged network is a foundation for happy network users and network administrators.
1695 Later in this book you learn how to make users happier. For now, it is enough to learn to
1696 validate. Let's get on with it.
1700 <title>Server Validation Steps</title>
1703 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1704 One of the most important facets of Samba configuration is to ensure that
1705 name resolution functions correctly. You can check name resolution
1706 with a few simple tests. The most basic name resolution is provided from the
1707 <filename>/etc/hosts</filename> file. To test its operation, make a
1708 temporary edit to the <filename>/etc/nsswitch.conf</filename> file. Using
1709 your favorite editor, change the entry for <constant>hosts</constant> to read:
1713 When you have saved this file, execute the following command:
1715 &rootprompt; ping diamond
1716 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1717 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.131 ms
1718 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.179 ms
1719 64 bytes from sleeth1 (192.168.1.1): icmp_seq=3 ttl=64 time=0.192 ms
1720 64 bytes from sleeth1 (192.168.1.1): icmp_seq=4 ttl=64 time=0.191 ms
1722 --- sleeth1.abmas.biz ping statistics ---
1723 4 packets transmitted, 4 received, 0% packet loss, time 3016ms
1724 rtt min/avg/max/mdev = 0.131/0.173/0.192/0.026 ms
1726 This proves that name resolution via the <filename>/etc/hosts</filename> file
1731 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1732 So far, your installation is going particularly well. In this step we validate
1733 DNS server and name resolution operation. Using your favorite UNIX system editor,
1734 change the <filename>/etc/nsswitch.conf</filename> file so that the
1735 <constant>hosts</constant> entry reads:
1742 <indexterm><primary>named</primary></indexterm>
1743 Before you test DNS operation, it is a good idea to verify that the DNS server
1744 is running by executing the following:
1746 &rootprompt; ps ax | grep named
1747 437 ? S 0:00 /sbin/syslogd -a /var/lib/named/dev/log
1748 524 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1749 525 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1750 526 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1751 529 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1752 540 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1753 2552 pts/2 S 0:00 grep named
1755 This means that we are ready to check DNS operation. Do so by executing:
1756 <indexterm><primary>ping</primary></indexterm>
1758 &rootprompt; ping diamond
1759 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1760 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.156 ms
1761 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.183 ms
1763 --- sleeth1.abmas.biz ping statistics ---
1764 2 packets transmitted, 2 received, 0% packet loss, time 999ms
1765 rtt min/avg/max/mdev = 0.156/0.169/0.183/0.018 ms
1767 You should take a few more steps to validate DNS server operation, as follows:
1769 &rootprompt; host -f diamond.abmas.biz
1770 sleeth1.abmas.biz has address 192.168.1.1
1772 <indexterm><primary>/etc/hosts</primary></indexterm>
1773 You may now remove the entry called <constant>diamond</constant> from the
1774 <filename>/etc/hosts</filename> file. It does not hurt to leave it there,
1775 but its removal reduces the number of administrative steps for this name.
1779 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1780 WINS is a great way to resolve NetBIOS names to their IP address. You can test
1781 the operation of WINS by starting <command>nmbd</command> (manually or by way
1782 of the Samba startup method shown in <link linkend="procstart"/>). You must edit
1783 the <filename>/etc/nsswitch.conf</filename> file so that the <constant>hosts</constant>
1784 entry is as follows:
1788 The next step is to make certain that Samba is running using <command>ps ax|grep mbd</command>, and then execute the following:
1790 &rootprompt; ping diamond
1791 PING diamond (192.168.1.1) 56(84) bytes of data.
1792 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.094 ms
1793 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.479 ms
1795 <indexterm><primary>ping</primary></indexterm>
1796 Now that you can relax with the knowledge that all three major forms of name
1797 resolution to IP address resolution are working, edit the <filename>/etc/nsswitch.conf</filename>
1798 again. This time you add all three forms of name resolution to this file.
1799 Your edited entry for <constant>hosts</constant> should now look like this:
1801 hosts: files dns wins
1803 The system is looking good. Let's move on.
1807 It would give you peace of mind to know that the DHCP server is running
1808 and available for service. You can validate DHCP services by running:
1811 &rootprompt; ps ax | grep dhcp
1812 2618 ? S 0:00 /usr/sbin/dhcpd ...
1813 8180 pts/2 S 0:00 grep dhcp
1815 This shows that the server is running. The proof of whether or not it is working
1816 comes when you try to add the first DHCP client to the network.
1820 <indexterm><primary>testparm</primary></indexterm>
1821 This is a good point at which to start validating Samba operation. You are
1822 content that name resolution is working for basic TCP/IP needs. Let's move on.
1823 If your &smb.conf; file has bogus options or parameters, this may cause Samba
1824 to refuse to start. The first step should always be to validate the contents
1825 of this file by running:
1827 &rootprompt; testparm -s
1828 Load smb config files from smb.conf
1829 rocessing section "[homes]"
1830 Processing section "[printers]"
1831 Processing section "[netlogon]"
1832 Processing section "[profiles]"
1833 Processing section "[accounts]"
1834 Processing section "[service]"
1835 Processing section "[apps]"
1836 Loaded services file OK.
1839 workgroup = PROMISES
1840 netbios name = DIAMOND
1841 interfaces = eth1, eth2, lo
1842 bind interfaces only = Yes
1843 passdb backend = tdbsam
1844 pam password change = Yes
1845 passwd program = /usr/bin/passwd '%u'
1846 passwd chat = *New*Password* %n\n \
1847 *Re-enter*new*password* %n\n *Password*changed*
1848 username map = /etc/samba/smbusers
1849 unix password sync = Yes
1852 log file = /var/log/samba/%m
1855 name resolve order = wins bcast hosts
1857 printcap name = CUPS
1858 show add printer wizard = No
1859 add user script = /usr/sbin/useradd -m '%u'
1860 delete user script = /usr/sbin/userdel -r '%u'
1861 add group script = /usr/sbin/groupadd '%g'
1862 delete group script = /usr/sbin/groupdel '%g'
1863 add user to group script = /usr/sbin/usermod -G '%g' '%u'
1864 add machine script = /usr/sbin/useradd \
1865 -s /bin/false -d /dev/null '%u'
1866 shutdown script = /var/lib/samba/scripts/shutdown.sh
1867 abort shutdown script = /sbin/shutdown -c
1868 logon script = scripts\logon.bat
1869 logon path = \\%L\profiles\%U
1871 logon home = \\%L\%U
1873 preferred master = Yes
1876 winbind use default domain = Yes
1877 map acl inherit = Yes
1879 veto files = /*.eml/*.nws/*.{*}/
1880 veto oplock files = /*.doc/*.xls/*.mdb/
1883 comment = Home Directories
1888 ### Remainder cut to save space ###
1890 Clear away all errors before proceeding.
1894 <indexterm><primary>check samba daemons</primary></indexterm>
1895 <indexterm><primary>smbd</primary></indexterm>
1896 <indexterm><primary>nmbd</primary></indexterm>
1897 <indexterm><primary>winbindd</primary></indexterm>
1898 Check that the Samba server is running:
1900 &rootprompt; ps ax | grep mbd
1901 14244 ? S 0:00 /usr/sbin/nmbd -D
1902 14245 ? S 0:00 /usr/sbin/nmbd -D
1903 14290 ? S 0:00 /usr/sbin/smbd -D
1905 $rootprompt; ps ax | grep winbind
1906 14293 ? S 0:00 /usr/sbin/winbindd -B
1907 14295 ? S 0:00 /usr/sbin/winbindd -B
1909 The <command>winbindd</command> daemon is running in split mode (normal), so there are also
1910 two instances<footnote><para>For more information regarding winbindd, see <emphasis>TOSHARG</emphasis>,
1911 Chapter 23, Section 23.3. The single instance of <command>smbd</command> is normal. One additional
1912 <command>smbd</command> slave process is spawned for each SMB/CIFS client
1913 connection.</para></footnote> of it.
1917 <indexterm><primary>anonymous
1918 connection</primary></indexterm>
1920 <primary>smbclient</primary>
1922 Check that an anonymous connection can be made to the Samba server:
1924 &rootprompt; smbclient -L localhost -U%
1926 Sharename Type Comment
1927 --------- ---- -------
1928 IPC$ IPC IPC Service (Samba 3.0.20)
1929 netlogon Disk Network Logon Service
1930 profiles Disk Profile Share
1931 accounts Disk Accounting Files
1932 service Disk Financial Services Files
1933 apps Disk Application Files
1934 ADMIN$ IPC IPC Service (Samba 3.0.20)
1935 hplj6a Printer hplj6a
1936 hplj6f Printer hplj6f
1942 DIAMOND Samba 3.0.20
1948 This demonstrates that an anonymous listing of shares can be obtained. This is the equivalent
1949 of browsing the server from a Windows client to obtain a list of shares on the server.
1950 The <constant>-U%</constant> argument means to send a <constant>NULL</constant> username and
1951 a <constant>NULL</constant> password.
1955 <indexterm><primary>dhcp client validation</primary></indexterm>
1956 <indexterm><primary>printer validation</primary></indexterm>
1957 <indexterm><primary>arp</primary></indexterm>
1958 Verify that each printer has the IP address assigned in the DHCP server configuration file.
1959 The easiest way to do this is to ping the printer name. Immediately after the ping response
1960 has been received, execute <command>arp -a</command> to find the MAC address of the printer
1961 that has responded. Now you can compare the IP address and the MAC address of the printer
1962 with the configuration information in the <filename>/etc/dhcpd.conf</filename> file. They
1963 should, of course, match. For example,
1965 &rootprompt; ping hplj6
1966 PING hplj6a (192.168.1.30) 56(84) bytes of data.
1967 64 bytes from hplj6a (192.168.1.30): icmp_seq=1 ttl=64 time=0.113 ms
1970 hplj6a (192.168.1.30) at 00:03:47:CB:81:E0 [ether] on eth0
1973 <primary>/etc/dhcpd.conf</primary>
1975 The MAC address <constant>00:03:47:CB:81:E0</constant> matches that specified for the
1976 IP address from which the printer has responded and with the entry for it in the
1977 <filename>/etc/dhcpd.conf</filename> file. Repeat this for each printer configured.
1981 <indexterm><primary>authenticated connection</primary></indexterm>
1982 Make an authenticated connection to the server using the <command>smbclient</command> tool:
1984 &rootprompt; smbclient //diamond/accounts -U gholmes
1987 . D 0 Thu Nov 27 15:07:09 2003
1988 .. D 0 Sat Nov 15 17:40:50 2003
1989 zakadmin.exe 161424 Thu Nov 27 15:06:52 2003
1990 zak.exe 6066384 Thu Nov 27 15:06:52 2003
1991 dhcpd.conf 1256 Thu Nov 27 15:06:52 2003
1992 smb.conf 2131 Thu Nov 27 15:06:52 2003
1993 initGrps.sh A 1089 Thu Nov 27 15:06:52 2003
1994 POLICY.EXE 86542 Thu Nov 27 15:06:52 2003
1996 55974 blocks of size 65536. 33968 blocks available
2002 <indexterm><primary>nmap</primary></indexterm>
2003 Your new server is connected to an Internet-accessible connection. Before you start
2004 your firewall, you should run a port scanner against your system. You should repeat that
2005 after the firewall has been started. This helps you understand to what extent the
2006 server may be vulnerable to external attack. One way you can do this is by using an
2007 external service, such as the <ulink url="http://www.dslreports.com/scan">DSL Reports</ulink>
2008 tools. Alternately, if you can gain root-level access to a remote
2009 UNIX/Linux system that has the <command>nmap</command> tool, you can run the following:
2011 &rootprompt; nmap -v -sT server.abmas.us
2013 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2014 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2015 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2016 Adding open port 6000/tcp
2017 Adding open port 873/tcp
2018 Adding open port 445/tcp
2019 Adding open port 10000/tcp
2020 Adding open port 901/tcp
2021 Adding open port 631/tcp
2022 Adding open port 25/tcp
2023 Adding open port 111/tcp
2024 Adding open port 32770/tcp
2025 Adding open port 3128/tcp
2026 Adding open port 53/tcp
2027 Adding open port 80/tcp
2028 Adding open port 443/tcp
2029 Adding open port 139/tcp
2030 Adding open port 22/tcp
2031 The Connect() Scan took 0 seconds to scan 1601 ports.
2032 Interesting ports on server.abmas.us (123.45.67.66):
2033 (The 1587 ports scanned but not shown below are in state: closed)
2040 139/tcp open netbios-ssn
2042 445/tcp open microsoft-ds
2045 901/tcp open samba-swat
2046 3128/tcp open squid-http
2048 10000/tcp open snet-sensor-mgmt
2049 32770/tcp open sometimes-rpc3
2051 Nmap run completed -- 1 IP address (1 host up) scanned in 1 second
2053 The above scan was run before the external interface was locked down with the NAT-firewall
2054 script you created above. The following results are obtained after the firewall rules
2055 have been put into place:
2057 &rootprompt; nmap -v -sT server.abmas.us
2059 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2060 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2061 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2062 Adding open port 53/tcp
2063 Adding open port 22/tcp
2064 The Connect() Scan took 168 seconds to scan 1601 ports.
2065 Interesting ports on server.abmas.us (123.45.67.66):
2066 (The 1593 ports scanned but not shown below are in state: filtered)
2072 443/tcp closed https
2074 Nmap run completed -- 1 IP address (1 host up) scanned in 168 seconds
2082 <sect2 id="ch4appscfg">
2083 <title>Application Share Configuration</title>
2086 <indexterm><primary>application server</primary></indexterm>
2087 <indexterm><primary>administrative installation</primary></indexterm>
2088 The use of an application server is a key mechanism by which desktop administration overheads
2089 can be reduced. Check the application manual for your software to identify how best to
2090 create an administrative installation.
2094 Some Windows software will only run locally on the desktop computer. Such software
2095 is typically not suited for administrative installation. Administratively installed software
2096 permits one or more of the following installation choices:
2101 Install software fully onto a workstation, storing data files on the same workstation.
2105 Install software fully onto a workstation with central network data file storage.
2109 Install software to run off a central application server with data files stored
2110 on the local workstation. This is often called a minimum installation, or a
2111 network client installation.
2115 Install software to run off a central application server with data files stored
2116 on a central network share. This type of installation often prevents storage
2117 of work files on the local workstation.
2122 <indexterm><primary></primary></indexterm>
2123 A common application deployed in this environment is an office suite.
2124 Enterprise editions of Microsoft Office XP Professional can be administratively installed
2125 by launching the installation from a command shell. The command that achieves this is
2126 <command>setup /a</command>. It results in a set of prompts through which various
2127 installation choices can be made. Refer to the Microsoft Office Resource SDK and Resource
2128 Kit for more information regarding this mode of installation of MS Office XP Professional.
2129 The full administrative installation of MS Office XP Professional requires approximately
2130 650 MB of disk space.
2134 When the MS Office XP Professional product has been installed to the administrative network
2135 share, the product can be installed onto a workstation by executing the normal setup program.
2136 The installation process now provides a choice to either perform a minimum installation
2137 or a full local installation. A full local installation takes over 100 MB of disk space.
2138 A network workstation (minimum) installation requires typically 10 MB to 15 MB of
2139 local disk space. In the latter case, when the applications are used, they load over the network.
2143 <indexterm><primary>Service Packs</primary></indexterm>
2144 <indexterm><primary>Microsoft Office</primary></indexterm>
2145 Microsoft Office Service Packs can be unpacked to update an administrative share. This makes
2146 it possible to update MS Office XP Professional for all users from a single installation
2147 of the service pack and generally circumvents the need to run updates on each network
2152 The default location for MS Office XP Professional data files can be set through registry
2153 editing or by way of configuration options inside each Office XP Professional application.
2157 <indexterm><primary>OpenOffice</primary></indexterm>
2158 OpenOffice.Org OpenOffice Version 1.1.0 can be installed locally. It can also
2159 be installed to run off a network share. The latter is a most desirable solution for office-bound
2160 network users and for administrative staff alike. It permits quick and easy updates
2161 to be rolled out to all users with a minimum of disruption and with maximum flexibility.
2165 The process for installation of administrative shared OpenOffice involves download of the
2166 distribution ZIP file, followed by extraction of the ZIP file into a temporary disk area.
2167 When fully extracted using the unzipping tool of your choosing, change into the Windows
2168 installation files directory then execute <command>setup -net</command>. You are
2169 prompted on screen for the target installation location. This is the administrative
2170 share point. The full administrative OpenOffice share takes approximately 150 MB of disk
2175 <title>Comments Regarding Software Terms of Use</title>
2177 Many single-user products can be installed into an administrative share, but
2178 personal versions of products such as Microsoft Office XP Professional do not permit this.
2179 Many people do not like terms of use typical with commercial products, so a few comments
2180 regarding software licensing seem important.
2184 Please do not use an administrative installation of proprietary and commercially licensed
2185 software products to violate the copyright holders' property. All software is licensed,
2186 particularly software that is licensed for use free of charge. All software is the property
2187 of the copyright holder unless the author and/or copyright holder has explicitly disavowed
2188 ownership and has placed the software into the public domain.
2192 Software that is under the GNU General Public License, like proprietary software, is
2193 licensed in a way that restricts use. For example, if you modify GPL software and then
2194 distribute the binary version of your modifications, you must offer to provide the source
2195 code as well. This restriction is designed to maintain the momentum
2196 of the diffusion of technology and to protect against the withholding of innovations.
2200 Commercial and proprietary software generally restrict use to those who have paid the
2201 license fees and who comply with the licensee's terms of use. Software that is released
2202 under the GNU General Public License is restricted to particular terms and conditions
2203 also. Whatever the licensing terms may be, if you do not approve of the terms of use,
2204 please do not use the software.
2208 <indexterm><primary>GPL</primary></indexterm>
2209 Samba is provided under the terms of the GNU GPL Version 2, a copy of which is provided
2210 with the source code.
2216 <sect2 id="ch4wincfg">
2217 <title>Windows Client Configuration</title>
2220 Christine needs to roll out 130 new desktop systems. There is no doubt that she also needs
2221 to reinstall many of the notebook computers that will be recycled for use with the new network
2222 configuration. The smartest way to handle the challenge of the roll-out program is to build
2223 a staged system for each type of target machine, and then use an image replication tool such as Norton
2224 Ghost (enterprise edition) to replicate the staged machine to its target desktops. The same can
2225 be done with notebook computers as long as they are identical or sufficiently similar.
2228 <procedure id="sbewinclntprep">
2229 <title>Windows Client Configuration Procedure</title>
2232 <indexterm><primary>WINS</primary></indexterm>
2233 <indexterm><primary>DHCP</primary></indexterm>
2234 Install MS Windows XP Professional. During installation, configure the client to use DHCP for
2235 TCP/IP protocol configuration. DHCP configures all Windows clients to use the WINS Server
2236 address that has been defined for the local subnet.
2240 Join the Windows Domain <constant>PROMISES</constant>. Use the Domain Administrator
2241 username <constant>root</constant> and the SMB password you assigned to this account.
2242 A detailed step-by-step procedure for joining a Windows 200x/XP Professional client to
2243 a Windows Domain is given in Appendix A, <link linkend="domjoin"/>.
2244 Reboot the machine as prompted and then log on using the Domain Administrator account
2245 (<constant>root</constant>).
2249 Verify <constant>DIAMOND</constant> is visible in <guimenu>My Network Places</guimenu>,
2250 that it is possible to connect to it and see the shares <guimenuitem>accounts</guimenuitem>,
2251 <guimenuitem>apps</guimenuitem>, and <guimenuitem>finsvcs</guimenuitem>, and that it is
2252 possible to open each share to reveal its contents.
2256 Create a drive mapping to the <constant>apps</constant> share on the server <constant>DIAMOND</constant>.
2260 Perform an administrative installation of each application to be used. Select the options
2261 that you wish to use. Of course, you can choose to run applications over the network, correct?
2265 Now install all applications to be installed locally. Typical tools include Adobe Acrobat,
2266 NTP-based time synchronization software, drivers for specific local devices such as fingerprint
2267 scanners, and the like. Probably the most significant application for local installation
2268 is antivirus software.
2272 Now install all four printers onto the staging system. The printers you install
2273 include the accounting department HP LaserJet 6 and Minolta QMS Magicolor printers. You will
2274 also configure identical printers that are located in the financial services department.
2275 Install printers on each machine following the steps shown in the Windows client printer
2276 preparation procedure below.
2280 <indexterm><primary>defragmentation</primary></indexterm>
2281 When you are satisfied that the staging systems are complete, use the appropriate procedure to
2282 remove the client from the domain. Reboot the system and then log on as the local administrator
2283 and clean out all temporary files stored on the system. Before shutting down, use the disk
2284 defragmentation tool so that the file system is in optimal condition before replication.
2288 Boot the workstation using the Norton (Symantec) Ghosting diskette (or CD-ROM) and image the
2289 machine to a network share on the server.
2293 <indexterm><primary>Windows security identifier</primary><see>SID</see></indexterm>
2294 <indexterm><primary>SID</primary></indexterm>
2295 You may now replicate the image to the target machines using the appropriate Norton Ghost
2296 procedure. Make sure to use the procedure that ensures each machine has a unique
2297 Windows security identifier (SID). When the installation of the disk image has completed, boot the PC.
2301 Log onto the machine as the local Administrator (the only option), and join the machine to
2302 the Domain, following the procedure set out in Appendix A, <link linkend="domjoin"/>. The system is now
2303 ready for the user to log on, provided you have created a network logon account for that
2308 Instruct all users to log onto the workstation using their assigned username and password.
2312 <procedure id="sbewinclntptrprep">
2313 <title>Windows Client Printer Preparation Procedure</title>
2317 <guimenu>Start</guimenu>
2318 <guimenuitem>Settings</guimenuitem>
2319 <guimenuitem>Printers</guimenuitem>
2320 <guiicon>Add Printer</guiicon>
2321 <guibutton>Next</guibutton>
2322 </menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
2323 Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
2327 Click <guibutton>Next</guibutton>. In the
2328 <guimenuitem>Manufacturer:</guimenuitem> panel, select <constant>HP</constant>.
2329 In the <guimenuitem>Printers:</guimenuitem> panel, select the printer called
2330 <constant>HP LaserJet 6</constant>. Click <guibutton>Next</guibutton>.
2334 In the <guimenuitem>Available ports:</guimenuitem> panel, select
2335 <constant>FILE:</constant>. Accept the default printer name by clicking
2336 <guibutton>Next</guibutton>. When asked, <quote>Would you like to print a
2337 test page?,</quote> click <guimenuitem>No</guimenuitem>. Click
2338 <guibutton>Finish</guibutton>.
2342 You may be prompted for the name of a file to print to. If so, close the
2343 dialog panel. Right-click <menuchoice>
2344 <guiicon>HP LaserJet 6</guiicon>
2345 <guimenuitem>Properties</guimenuitem>
2346 <guisubmenu>Details (Tab)</guisubmenu>
2347 <guimenuitem>Add Port</guimenuitem>
2352 In the <guimenuitem>Network</guimenuitem> panel, enter the name of
2353 the print queue on the Samba server as follows: <constant>\\DIAMOND\hplj6a</constant>.
2355 <guibutton>OK</guibutton>
2356 <guibutton>OK</guibutton>
2357 </menuchoice> to complete the installation.
2361 Repeat the printer installation steps above for both HP LaserJet 6 printers
2362 as well as for both QMS Magicolor laser printers.
2369 <title>Key Points Learned</title>
2372 How do you feel? You have built a capable network, a truly ambitious project.
2373 Future network updates can be handled by
2374 your staff. You must be a satisfied manager. Let's review the achievements.
2379 A simple firewall has been configured to protect the server in the event that
2380 the ISP firewall service should fail.
2384 The Samba configuration uses measures to ensure that only local network users
2385 can connect to SMB/CIFS services.
2389 Samba uses the new <constant>tdbsam</constant> passdb backend facility.
2390 Considerable complexity was added to Samba functionality.
2394 A DHCP server was configured to implement dynamic DNS (DDNS) updates to the DNS
2399 The DNS server was configured to permit DDNS only for local network clients. This
2400 server also provides primary DNS services for the company Internet presence.
2404 You introduced an application server as well as the concept of cloning a Windows
2405 client in order to effect improved standardization of desktops and to reduce
2406 the costs of network management.
2415 <title>Questions and Answers</title>
2425 What is the maximum number of account entries that the <parameter>tdbsam</parameter>
2426 passdb backend can handle?
2433 The tdb data structure and support system can handle more entries than the number of
2434 accounts that are possible on most UNIX systems. A practical limit would come into
2435 play long before a performance boundary would be anticipated. That practical limit
2436 is controlled by the nature of Windows networking. There are few Windows file and
2437 print servers that can handle more than a few hundred concurrent client connections.
2438 The key limiting factors that predicate offloading of services to additional servers
2439 are memory capacity, the number of CPUs, network bandwidth, and disk I/O limitations.
2440 All of these are readily exhausted by just a few hundred concurrent active users.
2441 Such bottlenecks can best be removed by segmentation of the network (distributing
2442 network load across multiple networks).
2446 As the network grows, it becomes necessary to provide additional authentication
2447 servers (domain controllers). The tdbsam is limited to a single machine and cannot
2448 be reliably replicated. This means that practical limits on network design dictate
2449 the point at which a distributed passdb backend is required; at this time, there is
2450 no real alternative other than ldapsam (LDAP).
2454 The guideline provided in <emphasis>TOSHARG</emphasis>, Chapter 10, Section 10.1.2,
2455 is to limit the number of accounts in the tdbsam backend to 250. This is the point
2456 at which most networks tend to want backup domain controllers (BDCs). Samba-3 does
2457 not provide a mechanism for replicating tdbsam data so it can be used by a BDC. The
2458 limitation of 250 users per tdbsam is predicated only on the need for replication,
2459 not on the limits<footnote><para>Bench tests have shown that tdbsam is a very
2460 effective database technology. There is surprisingly little performance loss even
2461 with over 4000 users.</para></footnote> of the tdbsam backend itself.
2471 Would Samba operate any better if the OS level is set to a value higher than 35?
2478 No. MS Windows workstations and servers do not use a value higher than 33. Setting this to a value
2479 of 35 already assures Samba of precedence over MS Windows products in browser elections. There is
2480 no gain to be had from setting this higher.
2490 Why in this example have you provided UNIX group to Windows Group mappings for only Domain Groups?
2497 At this time, Samba has the capacity to use only Domain Groups mappings. It is possible that at
2498 a later date Samba may make use of Windows Local Groups, as well as of the Active Directory special
2499 Groups. Proper operation requires Domain Groups to be mapped to valid UNIX groups.
2509 Why has a path been specified in the <parameter>IPC$</parameter> share?
2516 This is done so that in the event that a software bug may permit a client connection to the IPC$ share to
2517 obtain access to the file system, it does so at a location that presents least risk. Under normal operation
2518 this type of paranoid step should not be necessary. The use of this parameter should not be necessary.
2528 Why does the &smb.conf; file in this exercise include an entry for <smbconfoption name="smb ports"/>?
2535 The default order by which Samba-3 attempts to communicate with MS Windows clients is via port 445 (the TCP port
2536 used by Windows clients when NetBIOS-less SMB over TCP/IP is in use). TCP port 139 is the primary port used for NetBIOS
2537 over TCP/IP. In this configuration Windows network operations are predicated around NetBIOS over TCP/IP. By
2538 specifying the use of port 139 before port 445, the intent is to reduce unsuccessful service connection attempts.
2539 The result of this is improved network performance. Where Samba-3 is installed as an Active Directory Domain
2540 member, the default behavior is highly beneficial and should not be changed.
2550 What is the difference between a print queue and a printer?
2557 A printer is a physical device that is connected either directly to the network or to a computer
2558 via a serial, parallel, or USB connection so that print jobs can be submitted to it to create a
2559 hard copy printout. Network-attached printers that use TCP/IP-based printing generally accept a
2560 single print data stream and block all secondary attempts to dispatch jobs concurrently to the
2561 same device. If many clients were to concurrently print directly via TCP/IP to the same printer,
2562 it would result in a huge amount of network traffic through continually failing connection attempts.
2566 A print server (like CUPS or LPR/LPD) accepts multiple concurrent input streams or
2567 print requests. When the data stream has been fully received, the input stream is closed,
2568 and the job is then submitted to a sequential print queue where the job is stored until
2569 the printer is ready to receive the job.
2579 Can all MS Windows application software be installed onto an application server share?
2586 Much older Windows software is not compatible with installation to and execution from
2587 an application server. Enterprise versions of Microsoft Office XP Professional can
2588 be installed to an application server. Retail consumer versions of Microsoft Office XP
2589 Professional do not permit installation to an application server share and can be installed
2590 and used only to/from a local workstation hard disk.
2600 Why use dynamic DNS (DDNS)?
2607 When DDNS records are updated directly from the DHCP server, it is possible for
2608 network clients that are not NetBIOS-enabled, and thus cannot use WINS, to locate
2609 Windows clients via DNS.
2619 Why would you use WINS as well as DNS-based name resolution?
2626 WINS is to NetBIOS names as DNS is to fully qualified domain names (FQDN). The FQDN is
2627 a name like <quote>myhost.mydomain.tld</quote> where <parameter>tld</parameter>
2628 means <constant>top-level domain</constant>. A FQDN is a longhand but easy-to-remember
2629 expression that may be up to 1024 characters in length and that represents an IP address.
2630 A NetBIOS name is always 16 characters long. The 16<superscript>th</superscript> character
2631 is a name type indicator. A specific name type is registered<footnote><para>
2632 See <emphasis>TOSHARG</emphasis>, Chapter 9, for more information.</para></footnote> for each
2633 type of service that is provided by the Windows server or client and that may be registered
2634 where a WINS server is in use.
2638 WINS is a mechanism by which a client may locate the IP Address that corresponds to a
2639 NetBIOS name. The WINS server may be queried to obtain the IP Address for a NetBIOS name
2640 that includes a particular registered NetBIOS name type. DNS does not provide a mechanism
2641 that permits handling of the NetBIOS name type information.
2645 DNS provides a mechanism by which TCP/IP clients may locate the IP address of a particular
2646 hostname or service name that has been registered in the DNS database for a particular domain.
2647 A DNS server has limited scope of control and is said to be authoritative for the zone over
2648 which it has control.
2652 Windows 200x Active Directory requires the registration in the DNS zone for the domain it
2653 controls of service locator<footnote><para>See TOSHARG, Chapter 9, Section 9.3.3.</para></footnote> records
2654 that Windows clients and servers will use to locate Kerberos and LDAP services. ADS also
2655 requires the registration of special records that are called global catalog (GC) entries
2656 and site entries by which domain controllers and other essential ADS servers may be located.
2666 What are the major benefits of using an application server?
2673 The use of an application server can significantly reduce application update maintenance.
2674 By providing a centralized application share, software updates need be applied to only
2675 one location for all major applications used. This results in faster update roll-outs and
2676 significantly better application usage control.