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>
148 <imagedescription>Abmas Network Topology &smbmdash; 130 Users</imagedescription>
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 <smbconfexample id="promisnet">
808 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; [globals] Section</title>
809 <smbconfcomment>Global parameters</smbconfcomment>
810 <smbconfsection name="[global]"/>
811 <smbconfoption name="workgroup">PROMISES</smbconfoption>
812 <smbconfoption name="netbios name">DIAMOND</smbconfoption>
813 <smbconfoption name="interfaces">eth1, eth2, lo</smbconfoption>
814 <smbconfoption name="bind interfaces only">Yes</smbconfoption>
815 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
816 <smbconfoption name="pam password change">Yes</smbconfoption>
817 <smbconfoption name="passwd program">/usr/bin/passwd %u</smbconfoption>
818 <smbconfoption name="passwd chat"> </smbconfoption>
819 <member><parameter>*New*Password* %n\n *Re-enter*new*password*%n\n *Password*changed*</parameter></member>
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>
854 <smbconfexample id="promisnetsvca">
855 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part A</title>
856 <smbconfsection name="[homes]"/>
857 <smbconfoption name="comment">Home Directories</smbconfoption>
858 <smbconfoption name="valid users">%S</smbconfoption>
859 <smbconfoption name="read only">No</smbconfoption>
860 <smbconfoption name="browseable">No</smbconfoption>
862 <smbconfsection name="[printers]"/>
863 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
864 <smbconfoption name="path">/var/spool/samba</smbconfoption>
865 <smbconfoption name="guest ok">Yes</smbconfoption>
866 <smbconfoption name="printable">Yes</smbconfoption>
867 <smbconfoption name="use client driver">Yes</smbconfoption>
868 <smbconfoption name="default devmode">Yes</smbconfoption>
869 <smbconfoption name="browseable">No</smbconfoption>
871 <smbconfsection name="[netlogon]"/>
872 <smbconfoption name="comment">Network Logon Service</smbconfoption>
873 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
874 <smbconfoption name="guest ok">Yes</smbconfoption>
875 <smbconfoption name="locking">No</smbconfoption>
877 <smbconfsection name="[profiles]"/>
878 <smbconfoption name="comment">Profile Share</smbconfoption>
879 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
880 <smbconfoption name="read only">No</smbconfoption>
881 <smbconfoption name="profile acls">Yes</smbconfoption>
883 <smbconfsection name="[accounts]"/>
884 <smbconfoption name="comment">Accounting Files</smbconfoption>
885 <smbconfoption name="path">/data/accounts</smbconfoption>
886 <smbconfoption name="read only">No</smbconfoption>
889 <smbconfexample id="promisnetsvcb">
890 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part B</title>
891 <smbconfsection name="[service]"/>
892 <smbconfoption name="comment">Financial Services Files</smbconfoption>
893 <smbconfoption name="path">/data/service</smbconfoption>
894 <smbconfoption name="read only">No</smbconfoption>
896 <smbconfsection name="[pidata]"/>
897 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
898 <smbconfoption name="path">/data/pidata</smbconfoption>
899 <smbconfoption name="read only">No</smbconfoption>
901 <smbconfsection name="[apps]"/>
902 <smbconfoption name="comment">Application Files</smbconfoption>
903 <smbconfoption name="path">/apps</smbconfoption>
904 <smbconfoption name="read only">Yes</smbconfoption>
905 <smbconfoption name="admin users">bjordan</smbconfoption>
910 <indexterm><primary>administrator</primary></indexterm><indexterm>
911 <primary>smbpasswd</primary>
913 Add the <constant>root</constant> user to the password backend as follows:
915 &rootprompt; smbpasswd -a root
916 New SMB password: XXXXXXXX
917 Retype new SMB password: XXXXXXXX
920 The <constant>root</constant> account is the UNIX equivalent of the Windows Domain Administrator.
921 This account is essential in the regular maintenance of your Samba server. It must never be
922 deleted. If for any reason the account is deleted, you may not be able to recreate this account
923 without considerable trouble.
927 <indexterm><primary>username map</primary></indexterm>
928 Create the username map file to permit the <constant>root</constant> account to be called
929 <constant>Administrator</constant> from the Windows network environment. To do this, create
930 the file <filename>/etc/samba/smbusers</filename> with the following contents:
937 # Unix_ID = Windows_ID
940 # root = Administrator
941 # janes = "Jane Smith"
944 # Note: If the name contains a space it must be double quoted.
945 # In the example above the name 'jimbo' will be mapped to Windows
946 # user names 'Jim' and 'Bones' because the space was not quoted.
947 #######################################################################
956 <indexterm><primary>initGrps.sh</primary></indexterm>
957 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>add</tertiary></indexterm>
958 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>modify</tertiary></indexterm>
959 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>list</tertiary></indexterm>
960 Create and map Windows Domain Groups to UNIX groups. A sample script is provided in <link linkend="small"/>,
961 <link linkend="initGrps"/>. Create a file containing this script. We called ours
962 <filename>/etc/samba/initGrps.sh</filename>. Set this file so it can be executed,
963 and then execute the script. Sample output should be as follows:
965 <example id="ch4initGrps">
966 <title>Script to Map Windows NT Groups to UNIX Groups</title>
967 <indexterm><primary>initGrps.sh</primary></indexterm>
978 # Map Windows Domain Groups to UNIX groups
979 net groupmap modify ntgroup="Domain Admins" unixgroup=root
980 net groupmap modify ntgroup="Domain Users" unixgroup=users
981 net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
983 # Add Functional Domain Groups
984 net groupmap add ntgroup="Accounts Dept" unixgroup=acctsdep type=d
985 net groupmap add ntgroup="Financial Services" unixgroup=finsrvcs type=d
986 net groupmap add ntgroup="Insurance Group" unixgroup=piops type=d
988 # Map Windows NT machine local groups to local UNIX groups
989 # Mapping of local groups is not necessary and not functional
990 # for this installation.
995 &rootprompt; chmod 755 initGrps.sh
996 &rootprompt; /etc/samba # ./initGrps.sh
997 Updated mapping entry for Domain Admins
998 Updated mapping entry for Domain Users
999 Updated mapping entry for Domain Guests
1000 No rid or sid specified, choosing algorithmic mapping
1001 Successfully added group Accounts Dept to the mapping db
1002 No rid or sid specified, choosing algorithmic mapping
1003 Successfully added group Domain Guests to the mapping db
1005 &rootprompt; /etc/samba # net groupmap list | sort
1006 Account Operators (S-1-5-32-548) -> -1
1007 Accounts Dept (S-1-5-21-179504-2437109-488451-2003) -> acctsdep
1008 Administrators (S-1-5-32-544) -> -1
1009 Backup Operators (S-1-5-32-551) -> -1
1010 Domain Admins (S-1-5-21-179504-2437109-488451-512) -> root
1011 Domain Guests (S-1-5-21-179504-2437109-488451-514) -> nobody
1012 Domain Users (S-1-5-21-179504-2437109-488451-513) -> users
1013 Financial Services (S-1-5-21-179504-2437109-488451-2005) -> finsrvcs
1014 Guests (S-1-5-32-546) -> -1
1015 Power Users (S-1-5-32-547) -> -1
1016 Print Operators (S-1-5-32-550) -> -1
1017 Replicators (S-1-5-32-552) -> -1
1018 System Operators (S-1-5-32-549) -> -1
1019 Users (S-1-5-32-545) -> -1
1024 <indexterm><primary>useradd</primary></indexterm>
1025 <indexterm><primary>adduser</primary></indexterm>
1026 <indexterm><primary>passwd</primary></indexterm>
1027 <indexterm><primary>smbpasswd</primary></indexterm>
1028 <indexterm><primary>/etc/passwd</primary></indexterm>
1029 <indexterm><primary>password</primary><secondary>backend</secondary></indexterm>
1030 <indexterm><primary>user</primary><secondary>management</secondary></indexterm>
1031 There is one preparatory step without which you will not have a working Samba
1032 network environment. You must add an account for each network user.
1033 For each user who needs to be given a Windows Domain account, make an entry in the
1034 <filename>/etc/passwd</filename> file as well as in the Samba password backend.
1035 Use the system tool of your choice to create the UNIX system account, and use the Samba
1036 <command>smbpasswd</command> to create a Domain user account.
1037 There are a number of tools for user management under UNIX, such as
1038 <command>useradd</command>, and <command>adduser</command>, as well as a plethora of custom
1039 tools. You also want to create a home directory for each user.
1040 You can do this by executing the following steps for each user:
1042 &rootprompt; useradd -m <parameter>username</parameter>
1043 &rootprompt; passwd <parameter>username</parameter>
1044 Changing password for <parameter>username</parameter>.
1045 New password: XXXXXXXX
1046 Re-enter new password: XXXXXXXX
1048 &rootprompt; smbpasswd -a <parameter>username</parameter>
1049 New SMB password: XXXXXXXX
1050 Retype new SMB password: XXXXXXXX
1051 Added user <parameter>username</parameter>.
1053 You do of course use a valid user login ID in place of <parameter>username</parameter>.
1057 <indexterm><primary>file system</primary><secondary>access control</secondary></indexterm>
1058 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1059 <indexterm><primary>group membership</primary></indexterm>
1060 Using the preferred tool for your UNIX system, add each user to the UNIX groups created
1061 previously as necessary. File system access control will be based on UNIX group membership.
1065 Create the directory mount point for the disk subsystem that can be mounted to provide
1066 data storage for company files. In this case the mount point is indicated in the &smb.conf;
1067 file is <filename>/data</filename>. Format the file system as required, and mount the formatted
1068 file system partition using appropriate system tools.
1072 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1073 Create the top-level file storage directories for data and applications as follows:
1075 &rootprompt; mkdir -p /data/{accounts,finsvcs}
1076 &rootprompt; mkdir -p /apps
1077 &rootprompt; chown -R root:root /data
1078 &rootprompt; chown -R root:root /apps
1079 &rootprompt; chown -R bjordan:accounts /data/accounts
1080 &rootprompt; chown -R bjordan:finsvcs /data/finsvcs
1081 &rootprompt; chmod -R ug+rwxs,o-rwx /data
1082 &rootprompt; chmod -R ug+rwx,o+rx-w /apps
1084 Each department is responsible for creating its own directory structure within the departmental
1085 share. The directory root of the <command>accounts</command> share is <filename>/data/accounts</filename>.
1086 The directory root of the <command>finsvcs</command> share is <filename>/data/finsvcs</filename>.
1087 The <filename>/apps</filename> directory is the root of the <constant>apps</constant> share
1088 that provides the application server infrastructure.
1092 The &smb.conf; file specifies an infrastructure to support roaming profiles and network
1093 logon services. You can now create the file system infrastructure to provide the
1094 locations on disk that these services require. Adequate planning is essential,
1095 since desktop profiles can grow to be quite large. For planning purposes, a minimum of
1096 200 MB of storage should be allowed per user for profile storage. The following
1097 commands create the directory infrastructure needed:
1099 &rootprompt; mkdir -p /var/spool/samba
1100 &rootprompt; mkdir -p /var/lib/samba/{netlogon/scripts,profiles}
1101 &rootprompt; chown -R root:root /var/spool/samba
1102 &rootprompt; chown -R root:root /var/lib/samba
1103 &rootprompt; chmod a+rwxt /var/spool/samba
1105 For each user account that is created on the system, the following commands should be
1108 &rootprompt; mkdir /var/lib/samba/profiles/'username'
1109 &rootprompt; chown 'username':users /var/lib/samba/profiles/'username'
1110 &rootprompt; chmod ug+wrx,o+rx,-w /var/lib/samba/profiles/'username'
1115 <indexterm><primary>logon scrip</primary></indexterm>
1116 <indexterm><primary>unix2dos</primary></indexterm>
1117 <indexterm><primary>dos2unix</primary></indexterm>
1118 Create a logon script. It is important that each line is correctly terminated with
1119 a carriage return and line-feed combination (i.e., DOS encoding). The following procedure
1120 works if the right tools (<constant>unix2dos</constant> and <constant>dos2unix</constant>) are installed.
1121 First, create a file called <filename>/var/lib/samba/netlogon/scripts/logon.bat.unix</filename>
1122 with the following contents:
1124 net time \\diamond /set /yes
1126 net use p: \\diamond\apps
1128 Convert the UNIX file to a DOS file using the <command>unix2dos</command> as shown here:
1130 &rootprompt; unix2dos < /var/lib/samba/netlogon/scripts/logon.bat.unix \
1131 > /var/lib/samba/netlogon/scripts/logon.bat
1138 <sect2 id="ch4dhcpdns">
1139 <title>Configuration of DHCP and DNS Servers</title>
1142 DHCP services are a basic component of the entire network client installation. DNS operation is
1143 foundational to Internet access as well as to trouble-free operation of local networking. When
1144 you have completed this section, the server should be ready for solid duty operation.
1148 <title>DHCP and DNS Server Configuration Steps</title>
1151 <indexterm><primary>/etc/dhcpd.conf</primary></indexterm>
1152 Create a file called <filename>/etc/dhcpd.conf</filename> with the contents as
1153 shown in <link linkend="prom-dhcp"/>.
1155 <example id="prom-dhcp">
1156 <title>DHCP Server Configuration File &smbmdash; <filename>/etc/dhcpd.conf</filename></title>
1158 # Abmas Accounting Inc.
1159 default-lease-time 86400;
1160 max-lease-time 172800;
1161 default-lease-time 86400;
1162 option ntp-servers 192.168.1.1;
1163 option domain-name "abmas.biz";
1164 option domain-name-servers 192.168.1.1, 192.168.2.1;
1165 option netbios-name-servers 192.168.1.1, 192.168.2.1;
1166 option netbios-node-type 8; ### Node type = Hybrid ###
1167 ddns-updates on; ### Dynamic DNS enabled ###
1168 ddns-update-style interim;
1170 subnet 192.168.1.0 netmask 255.255.255.0 {
1171 range dynamic-bootp 192.168.1.128 192.168.1.254;
1172 option subnet-mask 255.255.255.0;
1173 option routers 192.168.1.1;
1174 allow unknown-clients;
1176 hardware ethernet 08:00:46:7a:35:e4;
1177 fixed-address 192.168.1.20;
1180 hardware ethernet 00:03:47:cb:81:e0;
1181 fixed-address 192.168.1.30;
1184 subnet 192.168.2.0 netmask 255.255.255.0 {
1185 range dynamic-bootp 192.168.2.128 192.168.2.254;
1186 option subnet-mask 255.255.255.0;
1187 option routers 192.168.2.1;
1188 allow unknown-clients;
1190 hardware ethernet 01:04:31:db:e1:c0;
1191 fixed-address 192.168.1.20;
1194 hardware ethernet 00:03:47:cf:83:e2;
1195 fixed-address 192.168.2.30;
1198 subnet 127.0.0.0 netmask 255.0.0.0 {
1200 subnet 123.45.67.64 netmask 255.255.255.252 {
1207 <indexterm><primary>/etc/named.conf</primary></indexterm>
1208 Create a file called <filename>/etc/named.conf</filename> that has the combined contents
1209 of the <link linkend="ch4namedcfg"/>, <link linkend="ch4namedvarfwd"/>, and
1210 <link linkend="ch4namedvarrev"/> files that are concatenated (merged) in this
1215 Create the files shown in their directories as follows: (John, on this page, the numbered entry comes after the table it's referencing!!!!!)
1217 <table id="namedrscfiles">
1218 <title>DNS (named) Resource Files</title>
1220 <colspec align="left"/>
1221 <colspec align="left"/>
1224 <entry>Reference</entry>
1225 <entry>File Location</entry>
1230 <entry><link linkend="loopback"/></entry>
1231 <entry>/var/lib/named/localhost.zone</entry>
1234 <entry><link linkend="dnsloopy"/></entry>
1235 <entry>/var/lib/named/127.0.0.zone</entry>
1238 <entry><link linkend="roothint"/></entry>
1239 <entry>/var/lib/named/root.hint</entry>
1242 <entry><link linkend="abmasbiz"/></entry>
1243 <entry>/var/lib/named/master/abmas.biz.hosts</entry>
1246 <entry><link linkend="abmasus"/></entry>
1247 <entry>/var/lib/named/abmas.us.hosts</entry>
1250 <entry><link linkend="eth1zone"/></entry>
1251 <entry>/var/lib/named/192.168.1.0.rev</entry>
1254 <entry><link linkend="eth2zone"/></entry>
1255 <entry>/var/lib/named/192.168.2.0.rev</entry>
1261 <example id="ch4namedcfg">
1262 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Master Section</title>
1263 <indexterm><primary>/etc/named.conf</primary></indexterm>
1266 # Abmas Biz DNS Control File
1268 # Date: November 15, 2003
1271 directory "/var/lib/named";
1280 multiple-cnames yes;
1289 zone "localhost" in {
1291 file "localhost.zone";
1294 zone "0.0.127.in-addr.arpa" in {
1296 file "127.0.0.zone";
1312 <example id="ch4namedvarfwd">
1313 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Forward Lookup Definition Section</title>
1317 file "/var/lib/named/master/abmas.biz.hosts";
1331 file "/var/lib/named/master/abmas.us.hosts";
1342 <example id="ch4namedvarrev">
1343 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Reverse Lookup Definition Section</title>
1345 zone "1.168.192.in-addr.arpa" {
1347 file "/var/lib/named/master/192.168.1.0.rev";
1359 zone "2.168.192.in-addr.arpa" {
1361 file "/var/lib/named/master/192.168.2.0.rev";
1375 <example id="eth1zone">
1376 <title>DNS 192.168.1 Reverse Zone File</title>
1379 $TTL 38400 ; 10 hours 40 minutes
1380 1.168.192.in-addr.arpa IN SOA sleeth.abmas.biz. root.abmas.biz. (
1382 10800 ; refresh (3 hours)
1383 3600 ; retry (1 hour)
1384 604800 ; expire (1 week)
1385 38400 ; minimum (10 hours 40 minutes)
1387 NS sleeth1.abmas.biz.
1388 $ORIGIN 1.168.192.in-addr.arpa.
1389 1 PTR sleeth1.abmas.biz.
1390 20 PTR qmsa.abmas.biz.
1391 30 PTR hplj6a.abmas.biz.
1395 <example id="eth2zone">
1396 <title>DNS 192.168.2 Reverse Zone File</title>
1399 $TTL 38400 ; 10 hours 40 minutes
1400 2.168.192.in-addr.arpa IN SOA sleeth.abmas.biz. root.abmas.biz. (
1402 10800 ; refresh (3 hours)
1403 3600 ; retry (1 hour)
1404 604800 ; expire (1 week)
1405 38400 ; minimum (10 hours 40 minutes)
1407 NS sleeth2.abmas.biz.
1408 $ORIGIN 2.168.192.in-addr.arpa.
1409 1 PTR sleeth2.abmas.biz.
1410 20 PTR qmsf.abmas.biz.
1411 30 PTR hplj6f.abmas.biz.
1415 <example id="abmasbiz">
1416 <title>DNS Abmas.biz Forward Zone File</title>
1419 $TTL 38400 ; 10 hours 40 minutes
1420 abmas.biz IN SOA sleeth1.abmas.biz. root.abmas.biz. (
1422 10800 ; refresh (3 hours)
1423 3600 ; retry (1 hour)
1424 604800 ; expire (1 week)
1425 38400 ; minimum (10 hours 40 minutes)
1428 MX 10 mail.abmas.biz.
1430 sleeth1 A 192.168.1.1
1431 sleeth2 A 192.168.2.1
1433 hplj6a A 192.168.1.30
1435 hplj6f A 192.168.2.30
1437 diamond CNAME sleeth1
1442 <example id="abmasus">
1443 <title>DNS Abmas.us Forward Zone File</title>
1446 $TTL 38400 ; 10 hours 40 minutes
1447 abmas.us IN SOA server.abmas.us. root.abmas.us. (
1449 10800 ; refresh (3 hours)
1450 3600 ; retry (1 hour)
1451 604800 ; expire (1 week)
1452 38400 ; minimum (10 hours 40 minutes)
1456 MX 10 mail.abmas.us.
1458 server A 123.45.67.66
1470 <indexterm><primary>/etc/resolv.conf</primary></indexterm><indexterm>
1471 <primary>name resolution</primary>
1473 All DNS name resolution should be handled locally. To ensure that the server is configured
1474 correctly to handle this, edit <filename>/etc/resolv.conf</filename> to have the following
1477 search abmas.us abmas.biz
1478 nameserver 127.0.0.1
1479 nameserver 123.45.54.23
1482 <primary>DNS server</primary>
1484 This instructs the name resolver function (when configured correctly) to ask the DNS server
1485 that is running locally to resolve names to addresses. In the event that the local name server
1486 is not available, ask the name server provided by the ISP. The latter, of course, does not resolve
1487 purely local names to IP addresses.
1491 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1492 The final step is to edit the <filename>/etc/nsswitch.conf</filename> file.
1493 This file controls the operation of the various resolver libraries that are part of the Linux
1494 Glibc libraries. Edit this file so that it contains the following entries:
1496 hosts: files dns wins
1502 The basic DHCP and DNS services are now ready for validation testing. Before you can proceed,
1503 there are a few more steps along the road. First, configure the print spooling and print
1504 processing system. Then you can configure the server so that all services
1505 start automatically on reboot. You must also manually start all services prior to validation testing.
1510 <sect2 id="ch4ptrcfg">
1511 <title>Printer Configuration</title>
1514 Network administrators who are new to CUPS based-printing typically experience some difficulty mastering
1515 its powerful features. The steps outlined in this section are designed to navigate around the distractions
1516 of learning CUPS. Instead of implementing smart features and capabilities, our approach is to use it as a
1517 transparent print queue that performs no filtering, and only minimal handling of each print job that is
1518 submitted to it. In other words, our configuration turns CUPS into a raw-mode print queue. This means that
1519 the correct printer driver must be installed on all clients.
1523 <title>Printer Configuration Steps</title>
1526 Configure each printer to be a DHCP client, carefully following the manufacturer's guidelines.
1530 Follow the instructions in the printer manufacturer's manuals to permit printing to port 9100.
1531 Use any other port the manufacturer specifies for direct-mode raw printing, and adjust the
1532 port as necessary in the following example commands.
1533 This allows the CUPS spooler to print using raw mode protocols.
1534 <indexterm><primary>CUPS</primary></indexterm>
1535 <indexterm><primary>raw printing</primary></indexterm>
1539 <indexterm><primary>CUPS</primary><secondary>queue</secondary></indexterm><indexterm>
1540 <primary>lpadmin</primary>
1542 Configure the CUPS Print Queues as follows:
1544 &rootprompt; lpadmin -p qmsa -v socket://qmsa.abmas.biz:9100 -E
1545 &rootprompt; lpadmin -p hplj6a -v socket://hplj6a.abmas.biz:9100 -E
1546 &rootprompt; lpadmin -p qmsf -v socket://qmsf.abmas.biz:9100 -E
1547 &rootprompt; lpadmin -p hplj6f -v socket://hplj6f.abmas.biz:9100 -E
1549 <indexterm><primary>print filter</primary></indexterm>
1550 This creates the necessary print queues with no assigned print filter.
1553 <step><para><indexterm>
1554 <primary>enable</primary>
1556 Print queues may not be enabled at creation. Use <command>lpc stat</command> to check
1557 the status of the print queues and, if necessary, make certain that the queues you have
1558 just created are enabled by executing the following:
1560 &rootprompt; /usr/bin/enable qmsa
1561 &rootprompt; /usr/bin/enable hplj6a
1562 &rootprompt; /usr/bin/enable qmsf
1563 &rootprompt; /usr/bin/enable hplj6f
1567 <step><para><indexterm>
1568 <primary>accept</primary>
1570 Even though your print queues may be enabled, it is still possible that they
1571 are not accepting print jobs. A print queue services incoming printing
1572 requests only when configured to do so. Ensure that your print queues are
1573 set to accept incoming jobs by executing the following commands:
1575 &rootprompt; /usr/bin/accept qmsa
1576 &rootprompt; /usr/bin/accept hplj6a
1577 &rootprompt; /usr/bin/accept qmsf
1578 &rootprompt; /usr/bin/accept hplj6f
1583 <indexterm><primary>mime type</primary></indexterm>
1584 <indexterm><primary>/etc/mime.convs</primary></indexterm>
1585 <indexterm><primary>application/octet-stream</primary></indexterm>
1586 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
1588 application/octet-stream application/vnd.cups-raw 0 -
1593 <indexterm><primary>/etc/mime.types</primary></indexterm>
1594 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
1596 application/octet-stream
1601 Printing drivers are installed on each network client workstation.
1606 Note: If the parameter <parameter>cups options = Raw</parameter> is specified in the &smb.conf; file,
1607 the last two steps can be omitted with CUPS version 1.1.18, or later.
1611 The UNIX system print queues have been configured and are ready for validation testing.
1616 <sect2 id="procstart">
1617 <title>Process Startup Configuration</title>
1620 <indexterm><primary>chkconfig</primary></indexterm>
1621 There are two essential steps to process startup configuration. First, the process
1622 must be configured so that it automatically restarts each time the server
1623 is rebooted. This step involves use of the <command>chkconfig</command> tool that
1624 creates the appropriate symbolic links from the master daemon control file that is
1625 located in the <filename>/etc/rc.d</filename> directory, to the <filename>/etc/rc'x'.d</filename>
1626 directories. Links are created so that when the system run level is changed, the
1627 necessary start or kill script is run.
1631 <indexterm><primary>/etc/xinetd.d</primary></indexterm>
1632 <indexterm><primary>inetd</primary></indexterm>
1633 <indexterm><primary>xinetd</primary></indexterm>
1634 <indexterm><primary>chkconfig</primary></indexterm>
1635 <indexterm><primary>super daemon</primary></indexterm>
1636 In the event that a service is not run as a daemon, but via the internetworking
1637 super daemon (<command>inetd</command> or <command>xinetd</command>), then the <command>chkconfig</command>
1638 tool makes the necessary entries in the <filename>/etc/xinetd.d</filename> directory
1639 and sends a hang-up (HUP) signal to the the super daemon, thus forcing it to
1640 re-read its control files.
1644 Last, each service must be started to permit system validation to proceed.
1649 Use the standard system tool to configure each service to restart
1650 automatically at every system reboot. For example,
1651 <indexterm><primary>chkconfig</primary></indexterm>
1653 &rootprompt; chkconfig dhpc on
1654 &rootprompt; chkconfig named on
1655 &rootprompt; chkconfig cups on
1656 &rootprompt; chkconfig smb on
1661 <indexterm><primary>starting dhcpd</primary></indexterm>
1662 <indexterm><primary>starting samba</primary></indexterm>
1663 <indexterm><primary>starting CUPS</primary></indexterm>
1664 Now start each service to permit the system to be validated.
1665 Execute each of the following in the sequence shown:
1668 &rootprompt; /etc/rc.d/init.d/dhcp restart
1669 &rootprompt; /etc/rc.d/init.d/named restart
1670 &rootprompt; /etc/rc.d/init.d/cups restart
1671 &rootprompt; /etc/rc.d/init.d/smb restart
1678 <sect2 id="ch4valid">
1679 <title>Validation</title>
1682 <indexterm><primary>validation</primary></indexterm>
1683 Complex networking problems are most often caused by simple things that are poorly or incorrectly
1684 configured. The validation process adopted here should be followed carefully; it is the result of the
1685 experience gained from years of making and correcting the most common mistakes. Shortcuts often lead to basic errors. You should
1686 refrain from taking shortcuts, from making basic assumptions, and from not exercising due process
1687 and diligence in network validation. By thoroughly testing and validating every step in the process
1688 of network installation and configuration, you can save yourself from sleepless nights and restless
1689 days. A well debugged network is a foundation for happy network users and network administrators.
1690 Later in this book you learn how to make users happier. For now, it is enough to learn to
1691 validate. Let's get on with it.
1695 <title>Server Validation Steps</title>
1698 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1699 One of the most important facets of Samba configuration is to ensure that
1700 name resolution functions correctly. You can check name resolution
1701 with a few simple tests. The most basic name resolution is provided from the
1702 <filename>/etc/hosts</filename> file. To test its operation, make a
1703 temporary edit to the <filename>/etc/nsswitch.conf</filename> file. Using
1704 your favorite editor, change the entry for <constant>hosts</constant> to read:
1708 When you have saved this file, execute the following command:
1710 &rootprompt; ping diamond
1711 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1712 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.131 ms
1713 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.179 ms
1714 64 bytes from sleeth1 (192.168.1.1): icmp_seq=3 ttl=64 time=0.192 ms
1715 64 bytes from sleeth1 (192.168.1.1): icmp_seq=4 ttl=64 time=0.191 ms
1717 --- sleeth1.abmas.biz ping statistics ---
1718 4 packets transmitted, 4 received, 0% packet loss, time 3016ms
1719 rtt min/avg/max/mdev = 0.131/0.173/0.192/0.026 ms
1721 This proves that name resolution via the <filename>/etc/hosts</filename> file
1726 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1727 So far, your installation is going particularly well. In this step we validate
1728 DNS server and name resolution operation. Using your favorite UNIX system editor,
1729 change the <filename>/etc/nsswitch.conf</filename> file so that the
1730 <constant>hosts</constant> entry reads:
1737 <indexterm><primary>named</primary></indexterm>
1738 Before you test DNS operation, it is a good idea to verify that the DNS server
1739 is running by executing the following:
1741 &rootprompt; ps ax | grep named
1742 437 ? S 0:00 /sbin/syslogd -a /var/lib/named/dev/log
1743 524 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1744 525 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1745 526 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1746 529 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1747 540 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1748 2552 pts/2 S 0:00 grep named
1750 This means that we are ready to check DNS operation. Do so by executing:
1751 <indexterm><primary>ping</primary></indexterm>
1753 &rootprompt; ping diamond
1754 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1755 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.156 ms
1756 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.183 ms
1758 --- sleeth1.abmas.biz ping statistics ---
1759 2 packets transmitted, 2 received, 0% packet loss, time 999ms
1760 rtt min/avg/max/mdev = 0.156/0.169/0.183/0.018 ms
1762 You should take a few more steps to validate DNS server operation, as follows:
1764 &rootprompt; host -f diamond.abmas.biz
1765 sleeth1.abmas.biz has address 192.168.1.1
1767 <indexterm><primary>/etc/hosts</primary></indexterm>
1768 You may now remove the entry called <constant>diamond</constant> from the
1769 <filename>/etc/hosts</filename> file. It does not hurt to leave it there,
1770 but its removal reduces the number of administrative steps for this name.
1774 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1775 WINS is a great way to resolve NetBIOS names to their IP address. You can test
1776 the operation of WINS by starting <command>nmbd</command> (manually or by way
1777 of the Samba startup method shown in <link linkend="procstart"/>). You must edit
1778 the <filename>/etc/nsswitch.conf</filename> file so that the <constant>hosts</constant>
1779 entry is as follows:
1783 The next step is to make certain that Samba is running using <command>ps ax|grep mbd</command>, and then execute the following:
1785 &rootprompt; ping diamond
1786 PING diamond (192.168.1.1) 56(84) bytes of data.
1787 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.094 ms
1788 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.479 ms
1790 <indexterm><primary>ping</primary></indexterm>
1791 Now that you can relax with the knowledge that all three major forms of name
1792 resolution to IP address resolution are working, edit the <filename>/etc/nsswitch.conf</filename>
1793 again. This time you add all three forms of name resolution to this file.
1794 Your edited entry for <constant>hosts</constant> should now look like this:
1796 hosts: files dns wins
1798 The system is looking good. Let's move on.
1802 It would give you peace of mind to know that the DHCP server is running
1803 and available for service. You can validate DHCP services by running:
1806 &rootprompt; ps ax | grep dhcp
1807 2618 ? S 0:00 /usr/sbin/dhcpd ...
1808 8180 pts/2 S 0:00 grep dhcp
1810 This shows that the server is running. The proof of whether or not it is working
1811 comes when you try to add the first DHCP client to the network.
1815 <indexterm><primary>testparm</primary></indexterm>
1816 This is a good point at which to start validating Samba operation. You are
1817 content that name resolution is working for basic TCP/IP needs. Let's move on.
1818 If your &smb.conf; file has bogus options or parameters, this may cause Samba
1819 to refuse to start. The first step should always be to validate the contents
1820 of this file by running:
1822 &rootprompt; testparm -s
1823 Load smb config files from smb.conf
1824 Processing section "[homes]"
1825 Processing section "[printers]"
1826 Processing section "[netlogon]"
1827 Processing section "[profiles]"
1828 Processing section "[accounts]"
1829 Processing section "[service]"
1830 Processing section "[apps]"
1831 Loaded services file OK.
1834 workgroup = PROMISES
1835 netbios name = DIAMOND
1836 interfaces = eth1, eth2, lo
1837 bind interfaces only = Yes
1838 passdb backend = tdbsam
1839 pam password change = Yes
1840 passwd program = /usr/bin/passwd '%u'
1841 passwd chat = *New*Password* %n\n \
1842 *Re-enter*new*password* %n\n *Password*changed*
1843 username map = /etc/samba/smbusers
1844 unix password sync = Yes
1847 log file = /var/log/samba/%m
1850 name resolve order = wins bcast hosts
1852 printcap name = CUPS
1853 show add printer wizard = No
1854 add user script = /usr/sbin/useradd -m '%u'
1855 delete user script = /usr/sbin/userdel -r '%u'
1856 add group script = /usr/sbin/groupadd '%g'
1857 delete group script = /usr/sbin/groupdel '%g'
1858 add user to group script = /usr/sbin/usermod -G '%g' '%u'
1859 add machine script = /usr/sbin/useradd \
1860 -s /bin/false -d /dev/null '%u'
1861 shutdown script = /var/lib/samba/scripts/shutdown.sh
1862 abort shutdown script = /sbin/shutdown -c
1863 logon script = scripts\logon.bat
1864 logon path = \\%L\profiles\%U
1866 logon home = \\%L\%U
1868 preferred master = Yes
1871 winbind use default domain = Yes
1872 map acl inherit = Yes
1874 veto files = /*.eml/*.nws/*.{*}/
1875 veto oplock files = /*.doc/*.xls/*.mdb/
1878 comment = Home Directories
1883 ### Remainder cut to save space ###
1885 Clear away all errors before proceeding.
1889 <indexterm><primary>check samba daemons</primary></indexterm>
1890 <indexterm><primary>smbd</primary></indexterm>
1891 <indexterm><primary>nmbd</primary></indexterm>
1892 <indexterm><primary>winbindd</primary></indexterm>
1893 Check that the Samba server is running:
1895 &rootprompt; ps ax | grep mbd
1896 14244 ? S 0:00 /usr/sbin/nmbd -D
1897 14245 ? S 0:00 /usr/sbin/nmbd -D
1898 14290 ? S 0:00 /usr/sbin/smbd -D
1900 $rootprompt; ps ax | grep winbind
1901 14293 ? S 0:00 /usr/sbin/winbindd -B
1902 14295 ? S 0:00 /usr/sbin/winbindd -B
1904 The <command>winbindd</command> daemon is running in split mode (normal), so there are also
1905 two instances<footnote><para>For more information regarding winbindd, see <emphasis>TOSHARG</emphasis>,
1906 Chapter 23, Section 23.3. The single instance of <command>smbd</command> is normal. One additional
1907 <command>smbd</command> slave process is spawned for each SMB/CIFS client
1908 connection.</para></footnote> of it.
1912 <indexterm><primary>anonymous
1913 connection</primary></indexterm>
1915 <primary>smbclient</primary>
1917 Check that an anonymous connection can be made to the Samba server:
1919 &rootprompt; smbclient -L localhost -U%
1921 Sharename Type Comment
1922 --------- ---- -------
1923 IPC$ IPC IPC Service (Samba 3.0.20)
1924 netlogon Disk Network Logon Service
1925 profiles Disk Profile Share
1926 accounts Disk Accounting Files
1927 service Disk Financial Services Files
1928 apps Disk Application Files
1929 ADMIN$ IPC IPC Service (Samba 3.0.20)
1930 hplj6a Printer hplj6a
1931 hplj6f Printer hplj6f
1937 DIAMOND Samba 3.0.20
1943 This demonstrates that an anonymous listing of shares can be obtained. This is the equivalent
1944 of browsing the server from a Windows client to obtain a list of shares on the server.
1945 The <constant>-U%</constant> argument means to send a <constant>NULL</constant> username and
1946 a <constant>NULL</constant> password.
1950 <indexterm><primary>dhcp client validation</primary></indexterm>
1951 <indexterm><primary>printer validation</primary></indexterm>
1952 <indexterm><primary>arp</primary></indexterm>
1953 Verify that each printer has the IP address assigned in the DHCP server configuration file.
1954 The easiest way to do this is to ping the printer name. Immediately after the ping response
1955 has been received, execute <command>arp -a</command> to find the MAC address of the printer
1956 that has responded. Now you can compare the IP address and the MAC address of the printer
1957 with the configuration information in the <filename>/etc/dhcpd.conf</filename> file. They
1958 should, of course, match. For example,
1960 &rootprompt; ping hplj6
1961 PING hplj6a (192.168.1.30) 56(84) bytes of data.
1962 64 bytes from hplj6a (192.168.1.30): icmp_seq=1 ttl=64 time=0.113 ms
1965 hplj6a (192.168.1.30) at 00:03:47:CB:81:E0 [ether] on eth0
1968 <primary>/etc/dhcpd.conf</primary>
1970 The MAC address <constant>00:03:47:CB:81:E0</constant> matches that specified for the
1971 IP address from which the printer has responded and with the entry for it in the
1972 <filename>/etc/dhcpd.conf</filename> file. Repeat this for each printer configured.
1976 <indexterm><primary>authenticated connection</primary></indexterm>
1977 Make an authenticated connection to the server using the <command>smbclient</command> tool:
1979 &rootprompt; smbclient //diamond/accounts -U gholmes
1982 . D 0 Thu Nov 27 15:07:09 2003
1983 .. D 0 Sat Nov 15 17:40:50 2003
1984 zakadmin.exe 161424 Thu Nov 27 15:06:52 2003
1985 zak.exe 6066384 Thu Nov 27 15:06:52 2003
1986 dhcpd.conf 1256 Thu Nov 27 15:06:52 2003
1987 smb.conf 2131 Thu Nov 27 15:06:52 2003
1988 initGrps.sh A 1089 Thu Nov 27 15:06:52 2003
1989 POLICY.EXE 86542 Thu Nov 27 15:06:52 2003
1991 55974 blocks of size 65536. 33968 blocks available
1997 <indexterm><primary>nmap</primary></indexterm>
1998 Your new server is connected to an Internet-accessible connection. Before you start
1999 your firewall, you should run a port scanner against your system. You should repeat that
2000 after the firewall has been started. This helps you understand to what extent the
2001 server may be vulnerable to external attack. One way you can do this is by using an
2002 external service, such as the <ulink url="http://www.dslreports.com/scan">DSL Reports</ulink>
2003 tools. Alternately, if you can gain root-level access to a remote
2004 UNIX/Linux system that has the <command>nmap</command> tool, you can run the following:
2006 &rootprompt; nmap -v -sT server.abmas.us
2008 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2009 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2010 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2011 Adding open port 6000/tcp
2012 Adding open port 873/tcp
2013 Adding open port 445/tcp
2014 Adding open port 10000/tcp
2015 Adding open port 901/tcp
2016 Adding open port 631/tcp
2017 Adding open port 25/tcp
2018 Adding open port 111/tcp
2019 Adding open port 32770/tcp
2020 Adding open port 3128/tcp
2021 Adding open port 53/tcp
2022 Adding open port 80/tcp
2023 Adding open port 443/tcp
2024 Adding open port 139/tcp
2025 Adding open port 22/tcp
2026 The Connect() Scan took 0 seconds to scan 1601 ports.
2027 Interesting ports on server.abmas.us (123.45.67.66):
2028 (The 1587 ports scanned but not shown below are in state: closed)
2035 139/tcp open netbios-ssn
2037 445/tcp open microsoft-ds
2040 901/tcp open samba-swat
2041 3128/tcp open squid-http
2043 10000/tcp open snet-sensor-mgmt
2044 32770/tcp open sometimes-rpc3
2046 Nmap run completed -- 1 IP address (1 host up) scanned in 1 second
2048 The above scan was run before the external interface was locked down with the NAT-firewall
2049 script you created above. The following results are obtained after the firewall rules
2050 have been put into place:
2052 &rootprompt; nmap -v -sT server.abmas.us
2054 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2055 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2056 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2057 Adding open port 53/tcp
2058 Adding open port 22/tcp
2059 The Connect() Scan took 168 seconds to scan 1601 ports.
2060 Interesting ports on server.abmas.us (123.45.67.66):
2061 (The 1593 ports scanned but not shown below are in state: filtered)
2067 443/tcp closed https
2069 Nmap run completed -- 1 IP address (1 host up) scanned in 168 seconds
2077 <sect2 id="ch4appscfg">
2078 <title>Application Share Configuration</title>
2081 <indexterm><primary>application server</primary></indexterm>
2082 <indexterm><primary>administrative installation</primary></indexterm>
2083 The use of an application server is a key mechanism by which desktop administration overheads
2084 can be reduced. Check the application manual for your software to identify how best to
2085 create an administrative installation.
2089 Some Windows software will only run locally on the desktop computer. Such software
2090 is typically not suited for administrative installation. Administratively installed software
2091 permits one or more of the following installation choices:
2096 Install software fully onto a workstation, storing data files on the same workstation.
2100 Install software fully onto a workstation with central network data file storage.
2104 Install software to run off a central application server with data files stored
2105 on the local workstation. This is often called a minimum installation, or a
2106 network client installation.
2110 Install software to run off a central application server with data files stored
2111 on a central network share. This type of installation often prevents storage
2112 of work files on the local workstation.
2117 <indexterm><primary></primary></indexterm>
2118 A common application deployed in this environment is an office suite.
2119 Enterprise editions of Microsoft Office XP Professional can be administratively installed
2120 by launching the installation from a command shell. The command that achieves this is
2121 <command>setup /a</command>. It results in a set of prompts through which various
2122 installation choices can be made. Refer to the Microsoft Office Resource SDK and Resource
2123 Kit for more information regarding this mode of installation of MS Office XP Professional.
2124 The full administrative installation of MS Office XP Professional requires approximately
2125 650 MB of disk space.
2129 When the MS Office XP Professional product has been installed to the administrative network
2130 share, the product can be installed onto a workstation by executing the normal setup program.
2131 The installation process now provides a choice to either perform a minimum installation
2132 or a full local installation. A full local installation takes over 100 MB of disk space.
2133 A network workstation (minimum) installation requires typically 10 MB to 15 MB of
2134 local disk space. In the latter case, when the applications are used, they load over the network.
2138 <indexterm><primary>Service Packs</primary></indexterm>
2139 <indexterm><primary>Microsoft Office</primary></indexterm>
2140 Microsoft Office Service Packs can be unpacked to update an administrative share. This makes
2141 it possible to update MS Office XP Professional for all users from a single installation
2142 of the service pack and generally circumvents the need to run updates on each network
2147 The default location for MS Office XP Professional data files can be set through registry
2148 editing or by way of configuration options inside each Office XP Professional application.
2152 <indexterm><primary>OpenOffice</primary></indexterm>
2153 OpenOffice.Org OpenOffice Version 1.1.0 can be installed locally. It can also
2154 be installed to run off a network share. The latter is a most desirable solution for office-bound
2155 network users and for administrative staff alike. It permits quick and easy updates
2156 to be rolled out to all users with a minimum of disruption and with maximum flexibility.
2160 The process for installation of administrative shared OpenOffice involves download of the
2161 distribution ZIP file, followed by extraction of the ZIP file into a temporary disk area.
2162 When fully extracted using the unzipping tool of your choosing, change into the Windows
2163 installation files directory then execute <command>setup -net</command>. You are
2164 prompted on screen for the target installation location. This is the administrative
2165 share point. The full administrative OpenOffice share takes approximately 150 MB of disk
2170 <title>Comments Regarding Software Terms of Use</title>
2172 Many single-user products can be installed into an administrative share, but
2173 personal versions of products such as Microsoft Office XP Professional do not permit this.
2174 Many people do not like terms of use typical with commercial products, so a few comments
2175 regarding software licensing seem important.
2179 Please do not use an administrative installation of proprietary and commercially licensed
2180 software products to violate the copyright holders' property. All software is licensed,
2181 particularly software that is licensed for use free of charge. All software is the property
2182 of the copyright holder unless the author and/or copyright holder has explicitly disavowed
2183 ownership and has placed the software into the public domain.
2187 Software that is under the GNU General Public License, like proprietary software, is
2188 licensed in a way that restricts use. For example, if you modify GPL software and then
2189 distribute the binary version of your modifications, you must offer to provide the source
2190 code as well. This restriction is designed to maintain the momentum
2191 of the diffusion of technology and to protect against the withholding of innovations.
2195 Commercial and proprietary software generally restrict use to those who have paid the
2196 license fees and who comply with the licensee's terms of use. Software that is released
2197 under the GNU General Public License is restricted to particular terms and conditions
2198 also. Whatever the licensing terms may be, if you do not approve of the terms of use,
2199 please do not use the software.
2203 <indexterm><primary>GPL</primary></indexterm>
2204 Samba is provided under the terms of the GNU GPL Version 2, a copy of which is provided
2205 with the source code.
2211 <sect2 id="ch4wincfg">
2212 <title>Windows Client Configuration</title>
2215 Christine needs to roll out 130 new desktop systems. There is no doubt that she also needs
2216 to reinstall many of the notebook computers that will be recycled for use with the new network
2217 configuration. The smartest way to handle the challenge of the roll-out program is to build
2218 a staged system for each type of target machine, and then use an image replication tool such as Norton
2219 Ghost (enterprise edition) to replicate the staged machine to its target desktops. The same can
2220 be done with notebook computers as long as they are identical or sufficiently similar.
2223 <procedure id="sbewinclntprep">
2224 <title>Windows Client Configuration Procedure</title>
2227 <indexterm><primary>WINS</primary></indexterm>
2228 <indexterm><primary>DHCP</primary></indexterm>
2229 Install MS Windows XP Professional. During installation, configure the client to use DHCP for
2230 TCP/IP protocol configuration. DHCP configures all Windows clients to use the WINS Server
2231 address that has been defined for the local subnet.
2235 Join the Windows Domain <constant>PROMISES</constant>. Use the Domain Administrator
2236 username <constant>root</constant> and the SMB password you assigned to this account.
2237 A detailed step-by-step procedure for joining a Windows 200x/XP Professional client to
2238 a Windows Domain is given in Appendix A, <link linkend="domjoin"/>.
2239 Reboot the machine as prompted and then log on using the Domain Administrator account
2240 (<constant>root</constant>).
2244 Verify <constant>DIAMOND</constant> is visible in <guimenu>My Network Places</guimenu>,
2245 that it is possible to connect to it and see the shares <guimenuitem>accounts</guimenuitem>,
2246 <guimenuitem>apps</guimenuitem>, and <guimenuitem>finsvcs</guimenuitem>, and that it is
2247 possible to open each share to reveal its contents.
2251 Create a drive mapping to the <constant>apps</constant> share on the server <constant>DIAMOND</constant>.
2255 Perform an administrative installation of each application to be used. Select the options
2256 that you wish to use. Of course, you can choose to run applications over the network, correct?
2260 Now install all applications to be installed locally. Typical tools include Adobe Acrobat,
2261 NTP-based time synchronization software, drivers for specific local devices such as fingerprint
2262 scanners, and the like. Probably the most significant application for local installation
2263 is antivirus software.
2267 Now install all four printers onto the staging system. The printers you install
2268 include the accounting department HP LaserJet 6 and Minolta QMS Magicolor printers. You will
2269 also configure identical printers that are located in the financial services department.
2270 Install printers on each machine following the steps shown in the Windows client printer
2271 preparation procedure below.
2275 <indexterm><primary>defragmentation</primary></indexterm>
2276 When you are satisfied that the staging systems are complete, use the appropriate procedure to
2277 remove the client from the domain. Reboot the system and then log on as the local administrator
2278 and clean out all temporary files stored on the system. Before shutting down, use the disk
2279 defragmentation tool so that the file system is in optimal condition before replication.
2283 Boot the workstation using the Norton (Symantec) Ghosting diskette (or CD-ROM) and image the
2284 machine to a network share on the server.
2288 <indexterm><primary>Windows security identifier</primary><see>SID</see></indexterm>
2289 <indexterm><primary>SID</primary></indexterm>
2290 You may now replicate the image to the target machines using the appropriate Norton Ghost
2291 procedure. Make sure to use the procedure that ensures each machine has a unique
2292 Windows security identifier (SID). When the installation of the disk image has completed, boot the PC.
2296 Log on to the machine as the local Administrator (the only option), and join the machine to
2297 the Domain, following the procedure set out in Appendix A, <link linkend="domjoin"/>. The system is now
2298 ready for the user to log on, provided you have created a network logon account for that
2303 Instruct all users to log on to the workstation using their assigned username and password.
2307 <procedure id="sbewinclntptrprep">
2308 <title>Windows Client Printer Preparation Procedure</title>
2312 <guimenu>Start</guimenu>
2313 <guimenuitem>Settings</guimenuitem>
2314 <guimenuitem>Printers</guimenuitem>
2315 <guiicon>Add Printer</guiicon>
2316 <guibutton>Next</guibutton>
2317 </menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
2318 Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
2322 Click <guibutton>Next</guibutton>. In the
2323 <guimenuitem>Manufacturer:</guimenuitem> panel, select <constant>HP</constant>.
2324 In the <guimenuitem>Printers:</guimenuitem> panel, select the printer called
2325 <constant>HP LaserJet 6</constant>. Click <guibutton>Next</guibutton>.
2329 In the <guimenuitem>Available ports:</guimenuitem> panel, select
2330 <constant>FILE:</constant>. Accept the default printer name by clicking
2331 <guibutton>Next</guibutton>. When asked, <quote>Would you like to print a
2332 test page?,</quote> click <guimenuitem>No</guimenuitem>. Click
2333 <guibutton>Finish</guibutton>.
2337 You may be prompted for the name of a file to print to. If so, close the
2338 dialog panel. Right-click <menuchoice>
2339 <guiicon>HP LaserJet 6</guiicon>
2340 <guimenuitem>Properties</guimenuitem>
2341 <guisubmenu>Details (Tab)</guisubmenu>
2342 <guimenuitem>Add Port</guimenuitem>
2347 In the <guimenuitem>Network</guimenuitem> panel, enter the name of
2348 the print queue on the Samba server as follows: <constant>\\DIAMOND\hplj6a</constant>.
2350 <guibutton>OK</guibutton>
2351 <guibutton>OK</guibutton>
2352 </menuchoice> to complete the installation.
2356 Repeat the printer installation steps above for both HP LaserJet 6 printers
2357 as well as for both QMS Magicolor laser printers.
2364 <title>Key Points Learned</title>
2367 How do you feel? You have built a capable network, a truly ambitious project.
2368 Future network updates can be handled by
2369 your staff. You must be a satisfied manager. Let's review the achievements.
2374 A simple firewall has been configured to protect the server in the event that
2375 the ISP firewall service should fail.
2379 The Samba configuration uses measures to ensure that only local network users
2380 can connect to SMB/CIFS services.
2384 Samba uses the new <constant>tdbsam</constant> passdb backend facility.
2385 Considerable complexity was added to Samba functionality.
2389 A DHCP server was configured to implement dynamic DNS (DDNS) updates to the DNS
2394 The DNS server was configured to permit DDNS only for local network clients. This
2395 server also provides primary DNS services for the company Internet presence.
2399 You introduced an application server as well as the concept of cloning a Windows
2400 client in order to effect improved standardization of desktops and to reduce
2401 the costs of network management.
2410 <title>Questions and Answers</title>
2420 What is the maximum number of account entries that the <parameter>tdbsam</parameter>
2421 passdb backend can handle?
2428 The tdb data structure and support system can handle more entries than the number of
2429 accounts that are possible on most UNIX systems. A practical limit would come into
2430 play long before a performance boundary would be anticipated. That practical limit
2431 is controlled by the nature of Windows networking. There are few Windows file and
2432 print servers that can handle more than a few hundred concurrent client connections.
2433 The key limiting factors that predicate offloading of services to additional servers
2434 are memory capacity, the number of CPUs, network bandwidth, and disk I/O limitations.
2435 All of these are readily exhausted by just a few hundred concurrent active users.
2436 Such bottlenecks can best be removed by segmentation of the network (distributing
2437 network load across multiple networks).
2441 As the network grows, it becomes necessary to provide additional authentication
2442 servers (domain controllers). The tdbsam is limited to a single machine and cannot
2443 be reliably replicated. This means that practical limits on network design dictate
2444 the point at which a distributed passdb backend is required; at this time, there is
2445 no real alternative other than ldapsam (LDAP).
2449 The guideline provided in <emphasis>TOSHARG</emphasis>, Chapter 10, Section 10.1.2,
2450 is to limit the number of accounts in the tdbsam backend to 250. This is the point
2451 at which most networks tend to want backup domain controllers (BDCs). Samba-3 does
2452 not provide a mechanism for replicating tdbsam data so it can be used by a BDC. The
2453 limitation of 250 users per tdbsam is predicated only on the need for replication,
2454 not on the limits<footnote><para>Bench tests have shown that tdbsam is a very
2455 effective database technology. There is surprisingly little performance loss even
2456 with over 4000 users.</para></footnote> of the tdbsam backend itself.
2466 Would Samba operate any better if the OS level is set to a value higher than 35?
2473 No. MS Windows workstations and servers do not use a value higher than 33. Setting this to a value
2474 of 35 already assures Samba of precedence over MS Windows products in browser elections. There is
2475 no gain to be had from setting this higher.
2485 Why in this example have you provided UNIX group to Windows Group mappings for only Domain Groups?
2492 At this time, Samba has the capacity to use only Domain Groups mappings. It is possible that at
2493 a later date Samba may make use of Windows Local Groups, as well as of the Active Directory special
2494 Groups. Proper operation requires Domain Groups to be mapped to valid UNIX groups.
2504 Why has a path been specified in the <parameter>IPC$</parameter> share?
2511 This is done so that in the event that a software bug may permit a client connection to the IPC$ share to
2512 obtain access to the file system, it does so at a location that presents least risk. Under normal operation
2513 this type of paranoid step should not be necessary. The use of this parameter should not be necessary.
2523 Why does the &smb.conf; file in this exercise include an entry for <smbconfoption name="smb ports"/>?
2530 The default order by which Samba-3 attempts to communicate with MS Windows clients is via port 445 (the TCP port
2531 used by Windows clients when NetBIOS-less SMB over TCP/IP is in use). TCP port 139 is the primary port used for NetBIOS
2532 over TCP/IP. In this configuration Windows network operations are predicated around NetBIOS over TCP/IP. By
2533 specifying the use of port 139 before port 445, the intent is to reduce unsuccessful service connection attempts.
2534 The result of this is improved network performance. Where Samba-3 is installed as an Active Directory Domain
2535 member, the default behavior is highly beneficial and should not be changed.
2545 What is the difference between a print queue and a printer?
2552 A printer is a physical device that is connected either directly to the network or to a computer
2553 via a serial, parallel, or USB connection so that print jobs can be submitted to it to create a
2554 hard copy printout. Network-attached printers that use TCP/IP-based printing generally accept a
2555 single print data stream and block all secondary attempts to dispatch jobs concurrently to the
2556 same device. If many clients were to concurrently print directly via TCP/IP to the same printer,
2557 it would result in a huge amount of network traffic through continually failing connection attempts.
2561 A print server (like CUPS or LPR/LPD) accepts multiple concurrent input streams or
2562 print requests. When the data stream has been fully received, the input stream is closed,
2563 and the job is then submitted to a sequential print queue where the job is stored until
2564 the printer is ready to receive the job.
2574 Can all MS Windows application software be installed onto an application server share?
2581 Much older Windows software is not compatible with installation to and execution from
2582 an application server. Enterprise versions of Microsoft Office XP Professional can
2583 be installed to an application server. Retail consumer versions of Microsoft Office XP
2584 Professional do not permit installation to an application server share and can be installed
2585 and used only to/from a local workstation hard disk.
2595 Why use dynamic DNS (DDNS)?
2602 When DDNS records are updated directly from the DHCP server, it is possible for
2603 network clients that are not NetBIOS-enabled, and thus cannot use WINS, to locate
2604 Windows clients via DNS.
2614 Why would you use WINS as well as DNS-based name resolution?
2621 WINS is to NetBIOS names as DNS is to fully qualified domain names (FQDN). The FQDN is
2622 a name like <quote>myhost.mydomain.tld</quote> where <parameter>tld</parameter>
2623 means <constant>top-level domain</constant>. A FQDN is a longhand but easy-to-remember
2624 expression that may be up to 1024 characters in length and that represents an IP address.
2625 A NetBIOS name is always 16 characters long. The 16<superscript>th</superscript> character
2626 is a name type indicator. A specific name type is registered<footnote><para>
2627 See <emphasis>TOSHARG</emphasis>, Chapter 9, for more information.</para></footnote> for each
2628 type of service that is provided by the Windows server or client and that may be registered
2629 where a WINS server is in use.
2633 WINS is a mechanism by which a client may locate the IP Address that corresponds to a
2634 NetBIOS name. The WINS server may be queried to obtain the IP Address for a NetBIOS name
2635 that includes a particular registered NetBIOS name type. DNS does not provide a mechanism
2636 that permits handling of the NetBIOS name type information.
2640 DNS provides a mechanism by which TCP/IP clients may locate the IP address of a particular
2641 hostname or service name that has been registered in the DNS database for a particular domain.
2642 A DNS server has limited scope of control and is said to be authoritative for the zone over
2643 which it has control.
2647 Windows 200x Active Directory requires the registration in the DNS zone for the domain it
2648 controls of service locator<footnote><para>See TOSHARG, Chapter 9, Section 9.3.3.</para></footnote> records
2649 that Windows clients and servers will use to locate Kerberos and LDAP services. ADS also
2650 requires the registration of special records that are called global catalog (GC) entries
2651 and site entries by which domain controllers and other essential ADS servers may be located.
2661 What are the major benefits of using an application server?
2668 The use of an application server can significantly reduce application update maintenance.
2669 By providing a centralized application share, software updates need be applied to only
2670 one location for all major applications used. This results in faster update roll-outs and
2671 significantly better application usage control.