1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
4 <title>Secure Office Networking</title>
7 Congratulations, your Samba networking skills are developing nicely. You started out
8 with three simple networks in <link linkend="simple"/>, and then in <link linkend="small"/>
9 you designed and built a network that provides a high degree of flexibility, integrity,
10 and dependability. It was enough for the basic needs each was designed to fulfill. In
11 this chapter you address a more complex set of needs. The solution you explore
12 introduces you to basic features that are specific to Samba-3.
16 You should note that a working and secure solution could be implemented using Samba-2.2.x.
17 In the exercises presented here, you are gradually using more Samba-3-specific features,
18 so caution is advised for anyone who tries to use Samba-2.2.x with the guidance here given.
19 To avoid confusion, this book is all about Samba-3. Let's get the exercises in this
24 <title>Introduction</title>
27 You have made Mr. Meany a very happy man. Recently he paid you a fat bonus for work
28 well done. It is one year since the last network upgrade. You have been quite busy.
29 Two months ago Mr. Meany gave approval to hire Christine Roberson, who has taken over
30 general network management. Soon she will provide primary user support. You have
31 demonstrated that you can delegate responsibility and can plan and execute according
32 to that plan. Above all, you have shown Mr. Meany that you are a responsible person.
33 Today is a big day. Mr. Meany called you to his office at 9 a.m. for news you never
34 expected: You are going to take charge of business operations. Mr. Meany
35 is retiring and has entrusted the business to your capable hands.
39 Mr. Meany may be retiring from this company, but not from work. He is taking the
40 opportunity to develop Abmas Accounting into a larger and more substantial company.
41 He says that it took him many years to learn that there is no future in just running
42 a business. He now realizes there is great personal satisfaction in the creation of
43 career opportunities for people in the local community. He wants to do more for others,
44 as he is doing for you. Today he spent a lot of time talking about his grand plan
45 for growth, which you will deal with in the chapters ahead.
49 Over the past year, the growth projections were exceeded. The network has grown to
50 meet the needs of 130 users. Along with growth, the demand for improved services
51 and better functionality has also developed. You are about to make an interim
52 improvement and then hand over all Help desk and network maintenance to Christine.
53 Christine has professional certifications in Microsoft Windows as well as in Linux;
54 she is a hard worker and quite likable. Christine does not want to manage the department
55 (although she manages well). She gains job satisfaction when left to sort things out.
56 Occasionally she wants to work with you on a challenging problem. When you told her
57 about your move, she almost resigned, although she was reassured that a new manager would
58 be hired to run Information Technology, and she would be responsible only for operations.
62 <title>Assignment Tasks</title>
65 You promised the staff Internet services including Web browsing, electronic mail, virus
66 protection, and a company Web site. Christine is eager to help turn the vision into
67 reality. Let's see how close you can get to the promises made.
71 The network you are about to deliver will service 130 users today. Within a year,
72 Abmas will aquire another company. Mr. Meany claims that within 2 years there will be
73 well over 500 users on the network. You have bought into the big picture, so prepare
74 for growth. You have purchased a new server and will implement a new network infrastructure.
78 You have decided to not recycle old network components. The only items that will be
79 carried forward are notebook computers. You offered staff new notebooks, but not
80 one person wanted the disruption for what was perceived as a marginal update.
81 You decided to give everyone, even the notebook user, a new desktop computer.
85 You procured a DSL Internet connection that provides 1.5 Mb/sec (bidirectional)
86 and a 10 Mb/sec ethernet port. You registered the domain
87 <constant>abmas.us</constant>, and the Internet Service Provider (ISP) is supplying
88 secondary DNS. Information furnished by your ISP is shown in <link linkend="chap4netid"/>.
92 It is of paramount priority that under no circumstances will Samba offer
93 service access from an Internet connection. You are paying an ISP to
94 give, as part of its value-added services, full firewall protection for your
95 connection to the outside world. The only services allowed in from
96 the Internet side are the following destination ports: <constant>http/https (ports
97 80 and 443), email (port 25), DNS (port 53)</constant>. All Internet traffic
98 will be allowed out after network address translation (NAT). No internal IP addresses
99 are permitted through the NAT filter because complete privacy of internal network
100 operations must be assured.
103 <table id="chap4netid">
104 <title>Abmas.US ISP Information</title>
106 <colspec align="left"/>
107 <colspec align="center"/>
110 <entry>Parameter</entry>
116 <entry>Server IP Address</entry>
117 <entry>123.45.67.66</entry>
120 <entry>DSL Device IP Address</entry>
121 <entry>123.45.67.65</entry>
124 <entry>Network Address</entry>
125 <entry>123.45.67.64/30</entry>
128 <entry>Gateway Address</entry>
129 <entry>123.45.54.65</entry>
132 <entry>Primary DNS Server</entry>
133 <entry>123.45.54.65</entry>
136 <entry>Secondary DNS Server</entry>
137 <entry>123.45.54.32</entry>
140 <entry>Forwarding DNS Server</entry>
141 <entry>123.45.12.23</entry>
147 <figure id="ch04net">
148 <title>Abmas Network Topology &smbmdash; 130 Users</title>
149 <imagefile scale="65">chap4-net</imagefile>
153 Christine recommended that desktop systems should be installed from a single cloned
154 master system that has a minimum of locally installed software and loads all software
155 off a central application server. The benefit of having the central application server
156 is that it allows single-point maintenance of all business applications, a more
157 efficient way to manage software. She further recommended installation of antivirus
158 software on workstations as well as on the Samba server. Christine knows the dangers
159 of potential virus infection and insists on a comprehensive approach to detective
160 as well as corrective action to protect network operations.
164 A significant concern is the problem of managing company growth. Recently, a number
165 of users had to share a PC while waiting for new machines to arrive. This presented
166 some problems with desktop computers and software installation into the new users'
174 <title>Dissection and Discussion</title>
177 Many of the conclusions you draw here are obvious. Some requirements are not very clear
178 or may simply be your means of drawing the most out of Samba-3. Much can be done more simply
179 than you will demonstrate here, but keep in mind that the network must scale to at least 500
180 users. This means that some functionality will be overdesigned for the current 130-user
185 <title>Technical Issues</title>
188 In this exercise we use a 24-bit subnet mask for the two local networks. This,
189 of course, limits our network to a maximum of 253 usable IP addresses. The network
190 address range chosen is one assigned by RFC1918 for private networks.
191 When the number of users on the network begins to approach the limit of usable
192 addresses, it is a good idea to switch to a network address specified in RFC1918
193 in the 172.16.0.0/16 range. This is done in subsequent chapters.
197 <indexterm><primary>tdbsam</primary></indexterm>
198 <indexterm><primary>smbpasswd</primary></indexterm>
199 The high growth rates projected are a good reason to use the <constant>tdbsam</constant>
200 passdb backend. The use of <constant>smbpasswd</constant> for the backend may result in
201 performance problems. The <constant>tdbsam</constant> passdb backend offers features that
202 are not available with the older, flat ASCII-based <constant>smbpasswd</constant> database.
206 <indexterm><primary>risk</primary></indexterm>
207 The proposed network design uses a single server to act as an Internet services host for
208 electronic mail, Web serving, remote administrative access via SSH,
209 Samba-based file and print services. This design is often chosen by sites that feel
210 they cannot afford or justify the cost or overhead of having separate servers. It must
211 be realized that if security of this type of server should ever be violated (compromised),
212 the whole network and all data is at risk. Many sites continue to choose this type
213 of solution; therefore, this chapter provides detailed coverage of key implementation
218 Samba will be configured to specifically not operate on the Ethernet interface that is
219 directly connected to the Internet.
223 <indexterm><primary>iptables</primary></indexterm>
224 <indexterm><primary>NAT</primary></indexterm>
225 <indexterm><primary>Network Address Translation</primary><see>NAT</see></indexterm>
226 <indexterm><primary>firewall</primary></indexterm>
227 You know that your ISP is providing full firewall services, but you cannot rely on that.
228 Always assume that human error will occur, so be prepared by using Linux firewall facilities
229 based on <command>iptables</command> to effect NAT. Block all
230 incoming traffic except to permitted well-known ports. You must also allow incoming packets
231 to establish outgoing connections. You will permit all internal outgoing requests.
235 The configuration of Web serving, Web proxy services, electronic mail, and the details of
236 generic antivirus handling are beyond the scope of this book and therefore are not
237 covered except insofar as this affects Samba-3.
241 <indexterm><primary>login</primary></indexterm>
242 Notebook computers are configured to use a network login when in the office and a
243 local account to log in while away from the office. Users store all work done in
244 transit (away from the office) by using a local share for work files. Standard procedures
245 dictate that on completion of the work that necessitates mobile file access, all
246 work files are moved back to secure storage on the office server. Staff is instructed
247 to not carry on any company notebook computer any files that are not absolutely required.
248 This is a preventative measure to protect client information as well as private business
253 <indexterm><primary>application server</primary></indexterm>
254 All applications are served from the central server from a share called <constant>apps</constant>.
255 Microsoft Office XP Professional and OpenOffice 1.1.0 will be installed using a network
256 (or administrative) installation. Accounting and financial management software can also
257 be run only from the central application server. Notebook users are provided with
258 locally installed applications on a need-to-have basis only.
262 <indexterm><primary>roaming profiles</primary></indexterm>
263 The introduction of roaming profiles support means that users can move between
264 desktop computer systems without constraint while retaining full access to their data.
265 The desktop travels with them as they move.
269 <indexterm><primary>DNS</primary></indexterm>
270 The DNS server implementation must now address both internal and external
271 needs. You forward DNS lookups to your ISP-provided server as well as the
272 <constant>abmas.us</constant> external secondary DNS server.
276 <indexterm><primary>dynamic DNS</primary></indexterm>
277 <indexterm><primary>DDNS</primary><see>dynamic DNS</see></indexterm>
278 <indexterm><primary>DHCP server</primary></indexterm>
279 Compared with the DHCP server configuration in <link linkend="small"/>, <link linkend="dhcp01"/>, the
280 configuration used in this example has to deal with the presence of an Internet connection.
281 The scope set for it ensures that no DHCP services will be offered on the external
282 connection. All printers are configured as DHCP clients so that the DHCP server assigns
283 the printer a fixed IP address by way of the Ethernet interface (MAC) address. One additional
284 feature of this DHCP server configuration file is the inclusion of parameters to allow dynamic
285 DNS (DDNS) operation.
289 This is the first implementation that depends on a correctly functioning DNS server.
290 Comprehensive steps are included to provide for a fully functioning DNS server that also
291 is enabled for DDNS operation. This means that DHCP clients can be autoregistered
296 You are taking the opportunity to manually set the netbios name of the Samba server to
297 a name other than what will be automatically resolved. You are doing this to ensure that
298 the machine has the same NetBIOS name on both network segments.
302 As in the previous network configuration, printing in this network configuration uses
303 direct raw printing (i.e., no smart printing and no print driver autodownload to Windows
304 clients). Printer drivers are installed on the Windows client manually. This is not
305 a problem because Christine is to install and configure one single workstation and
306 then clone that configuration, using Norton Ghost, to all workstations. Each machine is
307 identical, so this should pose no problem.
311 <title>Hardware Requirements</title>
314 <indexterm><primary>memory requirements</primary></indexterm>
315 This server runs a considerable number of services. From similarly configured Linux
316 installations, the approximate calculated memory requirements are as shown in
317 <link linkend="ch4memoryest"/>.
319 <example id="ch4memoryest">
320 <title>Estimation of Memory Requirements</title>
322 Application Memory per User 130 Users 500 Users
323 Name (MBytes) Total MBytes Total MBytes
324 ----------- --------------- ------------ ------------
327 Samba (nmbd) 16.0 16 16
328 Samba (winbind) 16.0 16 16
329 Samba (smbd) 4.0 520 2000
330 Apache 10.0 (20 User) 200 200
332 Basic OS 256.0 256 256
333 -------------- --------------
334 Total: 1043 MBytes 2539 MBytes
335 -------------- --------------
338 You should add a safety margin of at least 50% to these estimates. The minimum
339 system memory recommended for initial startup 1 GB, but to permit the system
340 to scale to 500 users, it makes sense to provision the machine with 4 GB memory.
341 An initial configuration with only 1 GB memory would lead to early performance complaints
342 as the system load builds up. Given the low cost of memory, it does not make sense to
343 compromise in this area.
347 <indexterm><primary>bandwidth calculations</primary></indexterm>
348 Aggregate input/output loads should be considered for sizing network configuration as
349 well as disk subsystems. For network bandwidth calculations, one would typically use an
350 estimate of 0.1 MB/sec per user. This suggests that 100-Base-T (approx. 10 MB/sec)
351 would deliver below acceptable capacity for the initial user load. It is therefore a good
352 idea to begin with 1 Gb Ethernet cards for the two internal networks, each attached
353 to a 1 Gb Ethernet switch that provides connectivity to an expandable array of 100-Base-T
358 <indexterm><primary>network segments</primary></indexterm>
359 <indexterm><primary>RAID</primary></indexterm>
360 Considering the choice of 1 Gb Ethernet interfaces for the two local network segments,
361 the aggregate network I/O capacity will be 2100 Mb/sec (about 230 MB/sec), an I/O
362 demand that would require a fast disk storage I/O capability. Peak disk throughput is
363 limited by the disk subsystem chosen. It is desirable to provide the maximum
364 I/O bandwidth affordable. If a low-cost solution must be chosen,
365 3Ware IDE RAID Controllers are a good choice. These controllers can be fitted into a
366 64-bit, 66 MHz PCI-X slot. They appear to the operating system as a high-speed SCSI
367 controller that can operate at the peak of the PCI-X bandwidth (approximately 450 MB/sec).
368 Alternative SCSI-based hardware RAID controllers should also be considered. Alternately,
369 it makes sense to purchase well-known, branded hardware that has appropriate performance
370 specifications. As a minimum, one should attempt to provide a disk subsystem that can
371 deliver I/O rates of at least 100 MB/sec.
375 Disk storage requirements may be calculated as shown in <link linkend="ch4diskest"/>.
377 <example id="ch4diskest">
378 <title>Estimation of Disk Storage Requirements</title>
380 Corporate Data: 100 MBytes/user per year
381 Email Storage: 500 MBytes/user per year
382 Applications: 5000 MBytes
383 Safety Buffer: At least 50%
385 Given 500 Users and 2 years:
386 -----------------------------
387 Corporate Data: 2 x 100 x 500 = 100000 MBytes = 100 GBytes
388 Email Storage: 2 x 500 x 500 = 500000 MBytes = 500 GBytes
389 Applications: 5000 MBytes = 5 GBytes
390 ----------------------------
392 Add 50% buffer 303 GBytes
393 Recommended Storage: 908 GBytes
396 <indexterm><primary>storage capacity</primary></indexterm>
397 The preferred storage capacity should be approximately 1 Terabyte. Use of RAID level 5
398 with two hot spare drives would require an 8-drive by 200 GB capacity per drive array.
407 <title>Political Issues</title>
410 Your industry is coming under increasing accountability pressures. Increased paranoia
411 is necessary so you can demonstrate that you have acted with due diligence. You must
412 not trust your Internet connection.
416 Apart from permitting more efficient management of business applications through use of
417 an application server, your primary reason for the decision to implement this is that it
418 gives you greater control over software licensing.
422 <indexterm><primary>Outlook Express</primary></indexterm>
423 You are well aware that the current configuration results in some performance issues
424 as the size of the desktop profile grows. Given that users use Microsoft Outlook
425 Express, you know that the storage implications of the <constant>.PST</constant> file
426 is something that needs to be addressed later.
434 <title>Implementation</title>
437 <link linkend="ch04net"/> demonstrates the overall design of the network that you will implement.
441 The information presented here assumes that you are already familiar with many basic steps.
442 As this stands, the details provided already extend well beyond just the necessities of
443 Samba configuration. This decision is deliberate to ensure that key determinants
444 of a successful installation are not overlooked. This is the last case that documents
445 the finite minutiae of DHCP and DNS server configuration. Beyond the information provided
446 here, there are many other good reference books on these subjects.
450 The &smb.conf; file has the following noteworthy features:
455 The NetBIOS name of the Samba server is set to <constant>DIAMOND</constant>.
459 The Domain name is set to <constant>PROMISES</constant>.
463 <indexterm><primary>broadcast messages</primary></indexterm>
464 <indexterm><primary>interfaces</primary></indexterm>
465 <indexterm><primary>bind interfaces only</primary></indexterm>
466 Ethernet interface <constant>eth0</constant> is attached to the Internet connection
467 and is externally exposed. This interface is explicitly not available for Samba to use.
468 Samba listens on this interface for broadcast messages but does not broadcast any
469 information on <constant>eth0</constant>, nor does it accept any connections from it.
470 This is achieved by way of the <parameter>interfaces</parameter> parameter and the
471 <parameter>bind interfaces only</parameter> entry.
475 <indexterm><primary>passdb backend</primary></indexterm>
476 <indexterm><primary>tdbsam</primary></indexterm>
477 <indexterm><primary>binary database</primary></indexterm>
478 The <parameter>passdb backend</parameter> parameter specifies the creation and use
479 of the <constant>tdbsam</constant> password backend. This is a binary database that
480 has excellent scalability for a large number of user account entries.
484 <indexterm><primary>WINS serving</primary></indexterm>
485 <indexterm><primary>wins support</primary></indexterm>
486 <indexterm><primary>name resolve order</primary></indexterm>
487 WINS serving is enabled by the <smbconfoption name="wins support">Yes</smbconfoption>,
488 and name resolution is set to use it by means of the
489 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption> entry.
493 <indexterm><primary>time server</primary></indexterm>
494 The Samba server is configured for use by Windows clients as a time server.
498 <indexterm><primary>CUPS</primary></indexterm>
499 <indexterm><primary>printing</primary></indexterm>
500 <indexterm><primary>printcap name</primary></indexterm>
501 Samba is configured to directly interface with CUPS via the direct internal interface
502 that is provided by CUPS libraries. This is achieved with the
503 <smbconfoption name="printing">CUPS</smbconfoption> as well as the
504 <smbconfoption name="printcap name">CUPS</smbconfoption> entries.
508 <indexterm><primary>user management</primary></indexterm>
509 <indexterm><primary>group management</primary></indexterm>
510 <indexterm><primary>SRVTOOLS.EXE</primary></indexterm>
511 External interface scripts are provided to enable Samba to interface smoothly to
512 essential operating system functions for user and group management. This is important
513 to enable workstations to join the Domain and is also important so that you can use
514 the Windows NT4 Domain User Manager as well as the Domain Server Manager. These tools
515 are provided as part of the <filename>SRVTOOLS.EXE</filename> toolkit that can be
516 downloaded from the Microsoft FTP
517 <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">site</ulink>.
521 <indexterm><primary>User Mode</primary></indexterm>
522 The &smb.conf; file specifies that the Samba server will operate in (default) <parameter>
523 security = user</parameter> mode<footnote><para>See <emphasis>TOSHARG2</emphasis>, Chapter 3.
524 This is necessary so that Samba can act as a Domain Controller (PDC); see
525 <emphasis>TOSHARG2</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 ip_tables
702 /sbin/modprobe ip_conntrack
703 /sbin/modprobe ip_conntrack_ftp
704 /sbin/modprobe iptable_nat
705 /sbin/modprobe ip_nat_ftp
706 $IPTABLES -P INPUT DROP
708 $IPTABLES -P OUTPUT ACCEPT
710 $IPTABLES -P FORWARD DROP
713 $IPTABLES -A INPUT -i lo -j ACCEPT
714 $IPTABLES -A INPUT -i $INTIFA -j ACCEPT
715 $IPTABLES -A INPUT -i $INTIFB -j ACCEPT
716 $IPTABLES -A INPUT -i $EXTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
717 # Enable incoming traffic for: SSH, SMTP, DNS(tcp), HTTP, HTTPS
718 for i in 22 25 53 80 443
720 $IPTABLES -A INPUT -i $EXTIF -p tcp --dport $i -j ACCEPT
723 $IPTABLES -A INPUT -i $EXTIF -p udp -dport 53 -j ACCEPT
724 echo "Allow all connections OUT and only existing and specified ones IN"
725 $IPTABLES -A FORWARD -i $EXTIF -o $INTIFA -m state \
726 --state ESTABLISHED,RELATED -j ACCEPT
727 $IPTABLES -A FORWARD -i $EXTIF -o $INTIFB -m state \
728 --state ESTABLISHED,RELATED -j ACCEPT
729 $IPTABLES -A FORWARD -i $INTIFA -o $EXTIF -j ACCEPT
730 $IPTABLES -A FORWARD -i $INTIFB -o $EXTIF -j ACCEPT
731 $IPTABLES -A FORWARD -j LOG
732 echo " Enabling SNAT (MASQUERADE) functionality on $EXTIF"
733 $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
734 echo "1" > /proc/sys/net/ipv4/ip_forward
735 echo -e "\nNAT firewall done.\n"
741 Execute the following to make the script executable:
743 &rootprompt; chmod 755 /usr/local/sbin/abmas-natfw.sh
745 You must now edit <filename>/etc/rc.d/boot.local</filename> to add an entry
746 that runs your <command>abmas-natfw.sh</command> script. The following
751 # Copyright (c) 2002 SUSE Linux AG Nuernberg, Germany.
752 # All rights reserved.
754 # Author: Werner Fink, 1996
755 # Burchard Steinbild, 1996
757 # /etc/init.d/boot.local
759 # script with local commands to be executed from init on system startup
761 # Here you should add things that should happen directly after booting
762 # before we're going to the first run level.
764 /usr/local/sbin/abmas-natfw.sh
770 <indexterm><primary>/etc/hosts</primary></indexterm>
771 The server is now ready for Samba configuration. During the validation step, you remove
772 the entry for the Samba server <constant>diamond</constant> from the <filename>/etc/hosts</filename>
773 file. This is done after you are satisfied that DNS-based name resolution is functioning correctly.
779 <title>Samba Configuration</title>
782 When you have completed this section, the Samba server is ready for testing and validation;
783 however, testing and validation have to wait until DHCP, DNS, and printing (CUPS) services have
788 <title>Samba Configuration Steps</title>
791 Install the Samba-3 binary RPM from the Samba-Team FTP site. Assuming that the binary
792 RPM file is called <filename>samba-3.0.20-1.i386.rpm</filename>, one way to install this
795 &rootprompt; rpm -Uvh samba-3.0.20-1.i386.rpm
797 This operation must be performed while logged in as the <command>root</command> user.
798 Successful operation is clearly indicated. If this installation should fail for any reason,
799 refer to the operating system manufacturer's documentation for guidance.
803 Install the &smb.conf; file shown in <link linkend="promisnet"/>, <link linkend="promisnetsvca"/>,
804 and <link linkend="promisnetsvcb"/>. Concatenate (join) all three files to make a single &smb.conf;
805 file. The final, fully qualified path for this file should be <filename>/etc/samba/smb.conf</filename>.
807 <example id="promisnet">
808 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; [globals] Section</title>
810 <smbconfcomment>Global parameters</smbconfcomment>
811 <smbconfsection name="[global]"/>
812 <smbconfoption name="workgroup">PROMISES</smbconfoption>
813 <smbconfoption name="netbios name">DIAMOND</smbconfoption>
814 <smbconfoption name="interfaces">eth1, eth2, lo</smbconfoption>
815 <smbconfoption name="bind interfaces only">Yes</smbconfoption>
816 <smbconfoption name="passdb backend">tdbsam</smbconfoption>
817 <smbconfoption name="pam password change">Yes</smbconfoption>
818 <smbconfoption name="passwd program">/usr/bin/passwd %u</smbconfoption>
819 <smbconfoption name="passwd chat">*New*Password* %n\n *Re-enter*new*password*%n\n *Password*changed*</smbconfoption>
820 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
821 <smbconfoption name="unix password sync">Yes</smbconfoption>
822 <smbconfoption name="log level">1</smbconfoption>
823 <smbconfoption name="syslog">0</smbconfoption>
824 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
825 <smbconfoption name="max log size">50</smbconfoption>
826 <smbconfoption name="smb ports">139</smbconfoption>
827 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
828 <smbconfoption name="time server">Yes</smbconfoption>
829 <smbconfoption name="printcap name">CUPS</smbconfoption>
830 <smbconfoption name="show add printer wizard">No</smbconfoption>
831 <smbconfoption name="add user script">/usr/sbin/useradd -m '%u'</smbconfoption>
832 <smbconfoption name="delete user script">/usr/sbin/userdel -r '%u'</smbconfoption>
833 <smbconfoption name="add group script">/usr/sbin/groupadd '%g'</smbconfoption>
834 <smbconfoption name="delete group script">/usr/sbin/groupdel '%g'</smbconfoption>
835 <smbconfoption name="add user to group script">/usr/sbin/usermod -G '%g' '%u'</smbconfoption>
836 <smbconfoption name="add machine script">/usr/sbin/useradd -s /bin/false -d /tmp '%u'</smbconfoption>
837 <smbconfoption name="shutdown script">/var/lib/samba/scripts/shutdown.sh</smbconfoption>
838 <smbconfoption name="abort shutdown script">/sbin/shutdown -c</smbconfoption>
839 <smbconfoption name="logon script">scripts\logon.bat</smbconfoption>
840 <smbconfoption name="logon path">\\%L\profiles\%U</smbconfoption>
841 <smbconfoption name="logon drive">X:</smbconfoption>
842 <smbconfoption name="logon home">\\%L\%U</smbconfoption>
843 <smbconfoption name="domain logons">Yes</smbconfoption>
844 <smbconfoption name="preferred master">Yes</smbconfoption>
845 <smbconfoption name="wins support">Yes</smbconfoption>
846 <smbconfoption name="utmp">Yes</smbconfoption>
847 <smbconfoption name="map acl inherit">Yes</smbconfoption>
848 <smbconfoption name="printing">cups</smbconfoption>
849 <smbconfoption name="cups options">Raw</smbconfoption>
850 <smbconfoption name="veto files">/*.eml/*.nws/*.{*}/</smbconfoption>
851 <smbconfoption name="veto oplock files">/*.doc/*.xls/*.mdb/</smbconfoption>
855 <example id="promisnetsvca">
856 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part A</title>
858 <smbconfsection name="[homes]"/>
859 <smbconfoption name="comment">Home Directories</smbconfoption>
860 <smbconfoption name="valid users">%S</smbconfoption>
861 <smbconfoption name="read only">No</smbconfoption>
862 <smbconfoption name="browseable">No</smbconfoption>
864 <smbconfsection name="[printers]"/>
865 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
866 <smbconfoption name="path">/var/spool/samba</smbconfoption>
867 <smbconfoption name="guest ok">Yes</smbconfoption>
868 <smbconfoption name="printable">Yes</smbconfoption>
869 <smbconfoption name="use client driver">Yes</smbconfoption>
870 <smbconfoption name="default devmode">Yes</smbconfoption>
871 <smbconfoption name="browseable">No</smbconfoption>
873 <smbconfsection name="[netlogon]"/>
874 <smbconfoption name="comment">Network Logon Service</smbconfoption>
875 <smbconfoption name="path">/var/lib/samba/netlogon</smbconfoption>
876 <smbconfoption name="guest ok">Yes</smbconfoption>
877 <smbconfoption name="locking">No</smbconfoption>
879 <smbconfsection name="[profiles]"/>
880 <smbconfoption name="comment">Profile Share</smbconfoption>
881 <smbconfoption name="path">/var/lib/samba/profiles</smbconfoption>
882 <smbconfoption name="read only">No</smbconfoption>
883 <smbconfoption name="profile acls">Yes</smbconfoption>
885 <smbconfsection name="[accounts]"/>
886 <smbconfoption name="comment">Accounting Files</smbconfoption>
887 <smbconfoption name="path">/data/accounts</smbconfoption>
888 <smbconfoption name="read only">No</smbconfoption>
892 <example id="promisnetsvcb">
893 <title>130 User Network with <emphasis>tdbsam</emphasis> &smbmdash; Services Section Part B</title>
895 <smbconfsection name="[service]"/>
896 <smbconfoption name="comment">Financial Services Files</smbconfoption>
897 <smbconfoption name="path">/data/service</smbconfoption>
898 <smbconfoption name="read only">No</smbconfoption>
900 <smbconfsection name="[pidata]"/>
901 <smbconfoption name="comment">Property Insurance Files</smbconfoption>
902 <smbconfoption name="path">/data/pidata</smbconfoption>
903 <smbconfoption name="read only">No</smbconfoption>
905 <smbconfsection name="[apps]"/>
906 <smbconfoption name="comment">Application Files</smbconfoption>
907 <smbconfoption name="path">/apps</smbconfoption>
908 <smbconfoption name="read only">Yes</smbconfoption>
909 <smbconfoption name="admin users">bjordan</smbconfoption>
915 <indexterm><primary>administrator</primary></indexterm><indexterm>
916 <primary>smbpasswd</primary>
918 Add the <constant>root</constant> user to the password backend as follows:
920 &rootprompt; smbpasswd -a root
921 New SMB password: XXXXXXXX
922 Retype new SMB password: XXXXXXXX
925 The <constant>root</constant> account is the UNIX equivalent of the Windows Domain Administrator.
926 This account is essential in the regular maintenance of your Samba server. It must never be
927 deleted. If for any reason the account is deleted, you may not be able to recreate this account
928 without considerable trouble.
932 <indexterm><primary>username map</primary></indexterm>
933 Create the username map file to permit the <constant>root</constant> account to be called
934 <constant>Administrator</constant> from the Windows network environment. To do this, create
935 the file <filename>/etc/samba/smbusers</filename> with the following contents:
942 # Unix_ID = Windows_ID
945 # root = Administrator
946 # janes = "Jane Smith"
949 # Note: If the name contains a space it must be double quoted.
950 # In the example above the name 'jimbo' will be mapped to Windows
951 # user names 'Jim' and 'Bones' because the space was not quoted.
952 #######################################################################
961 <indexterm><primary>initGrps.sh</primary></indexterm>
962 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>add</tertiary></indexterm>
963 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>modify</tertiary></indexterm>
964 <indexterm><primary>net</primary><secondary>groupmap</secondary><tertiary>list</tertiary></indexterm>
965 Create and map Windows Domain Groups to UNIX groups. A sample script is provided in <link linkend="small"/>,
966 <link linkend="initGrps"/>. Create a file containing this script. We called ours
967 <filename>/etc/samba/initGrps.sh</filename>. Set this file so it can be executed,
968 and then execute the script. Sample output should be as follows:
970 <example id="ch4initGrps">
971 <title>Script to Map Windows NT Groups to UNIX Groups</title>
972 <indexterm><primary>initGrps.sh</primary></indexterm>
983 # Map Windows Domain Groups to UNIX groups
984 net groupmap add ntgroup="Domain Admins" unixgroup=root type=d
985 net groupmap add ntgroup="Domain Users" unixgroup=users type=d
986 net groupmap add ntgroup="Domain Guests" unixgroup=nobody type=d
988 # Add Functional Domain Groups
989 net groupmap add ntgroup="Accounts Dept" unixgroup=acctsdep type=d
990 net groupmap add ntgroup="Financial Services" unixgroup=finsrvcs type=d
991 net groupmap add ntgroup="Insurance Group" unixgroup=piops type=d
993 # Map Windows NT machine local groups to local UNIX groups
994 # Mapping of local groups is not necessary and not functional
995 # for this installation.
1000 &rootprompt; chmod 755 initGrps.sh
1001 &rootprompt; /etc/samba # ./initGrps.sh
1002 Updated mapping entry for Domain Admins
1003 Updated mapping entry for Domain Users
1004 Updated mapping entry for Domain Guests
1005 No rid or sid specified, choosing algorithmic mapping
1006 Successfully added group Accounts Dept to the mapping db
1007 No rid or sid specified, choosing algorithmic mapping
1008 Successfully added group Domain Guests to the mapping db
1010 &rootprompt; /etc/samba # net groupmap list | sort
1011 Account Operators (S-1-5-32-548) -> -1
1012 Accounts Dept (S-1-5-21-179504-2437109-488451-2003) -> acctsdep
1013 Administrators (S-1-5-32-544) -> -1
1014 Backup Operators (S-1-5-32-551) -> -1
1015 Domain Admins (S-1-5-21-179504-2437109-488451-512) -> root
1016 Domain Guests (S-1-5-21-179504-2437109-488451-514) -> nobody
1017 Domain Users (S-1-5-21-179504-2437109-488451-513) -> users
1018 Financial Services (S-1-5-21-179504-2437109-488451-2005) -> finsrvcs
1019 Guests (S-1-5-32-546) -> -1
1020 Power Users (S-1-5-32-547) -> -1
1021 Print Operators (S-1-5-32-550) -> -1
1022 Replicators (S-1-5-32-552) -> -1
1023 System Operators (S-1-5-32-549) -> -1
1024 Users (S-1-5-32-545) -> -1
1029 <indexterm><primary>useradd</primary></indexterm>
1030 <indexterm><primary>adduser</primary></indexterm>
1031 <indexterm><primary>passwd</primary></indexterm>
1032 <indexterm><primary>smbpasswd</primary></indexterm>
1033 <indexterm><primary>/etc/passwd</primary></indexterm>
1034 <indexterm><primary>password</primary><secondary>backend</secondary></indexterm>
1035 <indexterm><primary>user</primary><secondary>management</secondary></indexterm>
1036 There is one preparatory step without which you will not have a working Samba
1037 network environment. You must add an account for each network user.
1038 For each user who needs to be given a Windows Domain account, make an entry in the
1039 <filename>/etc/passwd</filename> file as well as in the Samba password backend.
1040 Use the system tool of your choice to create the UNIX system account, and use the Samba
1041 <command>smbpasswd</command> to create a Domain user account.
1042 There are a number of tools for user management under UNIX, such as
1043 <command>useradd</command>, and <command>adduser</command>, as well as a plethora of custom
1044 tools. You also want to create a home directory for each user.
1045 You can do this by executing the following steps for each user:
1047 &rootprompt; useradd -m <parameter>username</parameter>
1048 &rootprompt; passwd <parameter>username</parameter>
1049 Changing password for <parameter>username</parameter>.
1050 New password: XXXXXXXX
1051 Re-enter new password: XXXXXXXX
1053 &rootprompt; smbpasswd -a <parameter>username</parameter>
1054 New SMB password: XXXXXXXX
1055 Retype new SMB password: XXXXXXXX
1056 Added user <parameter>username</parameter>.
1058 You do of course use a valid user login ID in place of <parameter>username</parameter>.
1062 <indexterm><primary>file system</primary><secondary>access control</secondary></indexterm>
1063 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1064 <indexterm><primary>group membership</primary></indexterm>
1065 Using the preferred tool for your UNIX system, add each user to the UNIX groups created
1066 previously as necessary. File system access control will be based on UNIX group membership.
1070 Create the directory mount point for the disk subsystem that can be mounted to provide
1071 data storage for company files. In this case the mount point is indicated in the &smb.conf;
1072 file is <filename>/data</filename>. Format the file system as required, and mount the formatted
1073 file system partition using appropriate system tools.
1077 <indexterm><primary>file system</primary><secondary>permissions</secondary></indexterm>
1078 Create the top-level file storage directories for data and applications as follows:
1080 &rootprompt; mkdir -p /data/{accounts,finsrvcs}
1081 &rootprompt; mkdir -p /apps
1082 &rootprompt; chown -R root:root /data
1083 &rootprompt; chown -R root:root /apps
1084 &rootprompt; chown -R bjordan:acctsdep /data/accounts
1085 &rootprompt; chown -R bjordan:finsrvcs /data/finsrvcs
1086 &rootprompt; chmod -R ug+rwxs,o-rwx /data
1087 &rootprompt; chmod -R ug+rwx,o+rx-w /apps
1089 Each department is responsible for creating its own directory structure within the departmental
1090 share. The directory root of the <command>accounts</command> share is <filename>/data/accounts</filename>.
1091 The directory root of the <command>finsvcs</command> share is <filename>/data/finsvcs</filename>.
1092 The <filename>/apps</filename> directory is the root of the <constant>apps</constant> share
1093 that provides the application server infrastructure.
1097 The &smb.conf; file specifies an infrastructure to support roaming profiles and network
1098 logon services. You can now create the file system infrastructure to provide the
1099 locations on disk that these services require. Adequate planning is essential,
1100 since desktop profiles can grow to be quite large. For planning purposes, a minimum of
1101 200 MB of storage should be allowed per user for profile storage. The following
1102 commands create the directory infrastructure needed:
1104 &rootprompt; mkdir -p /var/spool/samba
1105 &rootprompt; mkdir -p /var/lib/samba/{netlogon/scripts,profiles}
1106 &rootprompt; chown -R root:root /var/spool/samba
1107 &rootprompt; chown -R root:root /var/lib/samba
1108 &rootprompt; chmod a+rwxt /var/spool/samba
1109 &rootprompt; chmod 2775 /var/lib/samba/profiles
1110 &rootprompt; chgrp users /var/lib/samba/profiles
1112 For each user account that is created on the system, the following commands should be
1115 &rootprompt; mkdir /var/lib/samba/profiles/'username'
1116 &rootprompt; chown 'username':users /var/lib/samba/profiles/'username'
1117 &rootprompt; chmod ug+wrx,o+rx,-w /var/lib/samba/profiles/'username'
1122 <indexterm><primary>logon scrip</primary></indexterm>
1123 <indexterm><primary>unix2dos</primary></indexterm>
1124 <indexterm><primary>dos2unix</primary></indexterm>
1125 Create a logon script. It is important that each line is correctly terminated with
1126 a carriage return and line-feed combination (i.e., DOS encoding). The following procedure
1127 works if the right tools (<constant>unix2dos</constant> and <constant>dos2unix</constant>) are installed.
1128 First, create a file called <filename>/var/lib/samba/netlogon/scripts/logon.bat.unix</filename>
1129 with the following contents:
1131 net time \\diamond /set /yes
1133 net use p: \\diamond\apps
1135 Convert the UNIX file to a DOS file using the <command>unix2dos</command> as shown here:
1137 &rootprompt; unix2dos < /var/lib/samba/netlogon/scripts/logon.bat.unix \
1138 > /var/lib/samba/netlogon/scripts/logon.bat
1145 <sect2 id="ch4dhcpdns">
1146 <title>Configuration of DHCP and DNS Servers</title>
1149 DHCP services are a basic component of the entire network client installation. DNS operation is
1150 foundational to Internet access as well as to trouble-free operation of local networking. When
1151 you have completed this section, the server should be ready for solid duty operation.
1155 <title>DHCP and DNS Server Configuration Steps</title>
1158 <indexterm><primary>/etc/dhcpd.conf</primary></indexterm>
1159 Create a file called <filename>/etc/dhcpd.conf</filename> with the contents as
1160 shown in <link linkend="prom-dhcp"/>.
1162 <example id="prom-dhcp">
1163 <title>DHCP Server Configuration File &smbmdash; <filename>/etc/dhcpd.conf</filename></title>
1165 # Abmas Accounting Inc.
1166 default-lease-time 86400;
1167 max-lease-time 172800;
1168 default-lease-time 86400;
1169 option ntp-servers 192.168.1.1;
1170 option domain-name "abmas.biz";
1171 option domain-name-servers 192.168.1.1, 192.168.2.1;
1172 option netbios-name-servers 192.168.1.1, 192.168.2.1;
1173 option netbios-node-type 8; ### Node type = Hybrid ###
1174 ddns-updates on; ### Dynamic DNS enabled ###
1175 ddns-update-style interim;
1177 subnet 192.168.1.0 netmask 255.255.255.0 {
1178 range dynamic-bootp 192.168.1.128 192.168.1.254;
1179 option subnet-mask 255.255.255.0;
1180 option routers 192.168.1.1;
1181 allow unknown-clients;
1183 hardware ethernet 08:00:46:7a:35:e4;
1184 fixed-address 192.168.1.20;
1187 hardware ethernet 00:03:47:cb:81:e0;
1188 fixed-address 192.168.1.30;
1191 subnet 192.168.2.0 netmask 255.255.255.0 {
1192 range dynamic-bootp 192.168.2.128 192.168.2.254;
1193 option subnet-mask 255.255.255.0;
1194 option routers 192.168.2.1;
1195 allow unknown-clients;
1197 hardware ethernet 01:04:31:db:e1:c0;
1198 fixed-address 192.168.1.20;
1201 hardware ethernet 00:03:47:cf:83:e2;
1202 fixed-address 192.168.2.30;
1205 subnet 127.0.0.0 netmask 255.0.0.0 {
1207 subnet 123.45.67.64 netmask 255.255.255.252 {
1214 <indexterm><primary>/etc/named.conf</primary></indexterm>
1215 Create a file called <filename>/etc/named.conf</filename> that has the combined contents
1216 of the <link linkend="ch4namedcfg"/>, <link linkend="ch4namedvarfwd"/>, and
1217 <link linkend="ch4namedvarrev"/> files that are concatenated (merged) in this
1222 Create the files shown in their respective directories as shown in <link linkend="namedrscfiles">DNS
1223 (named) Resource Files</link>.
1225 <table id="namedrscfiles">
1226 <title>DNS (named) Resource Files</title>
1228 <colspec align="left"/>
1229 <colspec align="left"/>
1232 <entry>Reference</entry>
1233 <entry>File Location</entry>
1238 <entry><link linkend="loopback"/></entry>
1239 <entry>/var/lib/named/localhost.zone</entry>
1242 <entry><link linkend="dnsloopy"/></entry>
1243 <entry>/var/lib/named/127.0.0.zone</entry>
1246 <entry><link linkend="roothint"/></entry>
1247 <entry>/var/lib/named/root.hint</entry>
1250 <entry><link linkend="abmasbiz"/></entry>
1251 <entry>/var/lib/named/master/abmas.biz.hosts</entry>
1254 <entry><link linkend="abmasus"/></entry>
1255 <entry>/var/lib/named/abmas.us.hosts</entry>
1258 <entry><link linkend="eth1zone"/></entry>
1259 <entry>/var/lib/named/192.168.1.0.rev</entry>
1262 <entry><link linkend="eth2zone"/></entry>
1263 <entry>/var/lib/named/192.168.2.0.rev</entry>
1269 <example id="ch4namedcfg">
1270 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Master Section</title>
1271 <indexterm><primary>/etc/named.conf</primary></indexterm>
1274 # Abmas Biz DNS Control File
1276 # Date: November 15, 2003
1279 directory "/var/lib/named";
1288 multiple-cnames yes;
1297 zone "localhost" in {
1299 file "localhost.zone";
1302 zone "0.0.127.in-addr.arpa" in {
1304 file "127.0.0.zone";
1320 <example id="ch4namedvarfwd">
1321 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Forward Lookup Definition Section</title>
1325 file "/var/lib/named/master/abmas.biz.hosts";
1339 file "/var/lib/named/master/abmas.us.hosts";
1350 <example id="ch4namedvarrev">
1351 <title>DNS Master Configuration File &smbmdash; <filename>/etc/named.conf</filename> Reverse Lookup Definition Section</title>
1353 zone "1.168.192.in-addr.arpa" {
1355 file "/var/lib/named/master/192.168.1.0.rev";
1367 zone "2.168.192.in-addr.arpa" {
1369 file "/var/lib/named/master/192.168.2.0.rev";
1383 <example id="eth1zone">
1384 <title>DNS 192.168.1 Reverse Zone File</title>
1387 $TTL 38400 ; 10 hours 40 minutes
1388 1.168.192.in-addr.arpa IN SOA sleeth.abmas.biz. root.abmas.biz. (
1390 10800 ; refresh (3 hours)
1391 3600 ; retry (1 hour)
1392 604800 ; expire (1 week)
1393 38400 ; minimum (10 hours 40 minutes)
1395 NS sleeth1.abmas.biz.
1396 $ORIGIN 1.168.192.in-addr.arpa.
1397 1 PTR sleeth1.abmas.biz.
1398 20 PTR qmsa.abmas.biz.
1399 30 PTR hplj6a.abmas.biz.
1403 <example id="eth2zone">
1404 <title>DNS 192.168.2 Reverse Zone File</title>
1407 $TTL 38400 ; 10 hours 40 minutes
1408 2.168.192.in-addr.arpa IN SOA sleeth.abmas.biz. root.abmas.biz. (
1410 10800 ; refresh (3 hours)
1411 3600 ; retry (1 hour)
1412 604800 ; expire (1 week)
1413 38400 ; minimum (10 hours 40 minutes)
1415 NS sleeth2.abmas.biz.
1416 $ORIGIN 2.168.192.in-addr.arpa.
1417 1 PTR sleeth2.abmas.biz.
1418 20 PTR qmsf.abmas.biz.
1419 30 PTR hplj6f.abmas.biz.
1423 <example id="abmasbiz">
1424 <title>DNS Abmas.biz Forward Zone File</title>
1427 $TTL 38400 ; 10 hours 40 minutes
1428 abmas.biz IN SOA sleeth1.abmas.biz. root.abmas.biz. (
1430 10800 ; refresh (3 hours)
1431 3600 ; retry (1 hour)
1432 604800 ; expire (1 week)
1433 38400 ; minimum (10 hours 40 minutes)
1436 MX 10 mail.abmas.biz.
1438 sleeth1 A 192.168.1.1
1439 sleeth2 A 192.168.2.1
1441 hplj6a A 192.168.1.30
1443 hplj6f A 192.168.2.30
1445 diamond CNAME sleeth1
1450 <example id="abmasus">
1451 <title>DNS Abmas.us Forward Zone File</title>
1454 $TTL 38400 ; 10 hours 40 minutes
1455 abmas.us IN SOA server.abmas.us. root.abmas.us. (
1457 10800 ; refresh (3 hours)
1458 3600 ; retry (1 hour)
1459 604800 ; expire (1 week)
1460 38400 ; minimum (10 hours 40 minutes)
1464 MX 10 mail.abmas.us.
1466 server A 123.45.67.66
1478 <indexterm><primary>/etc/resolv.conf</primary></indexterm><indexterm>
1479 <primary>name resolution</primary>
1481 All DNS name resolution should be handled locally. To ensure that the server is configured
1482 correctly to handle this, edit <filename>/etc/resolv.conf</filename> to have the following
1485 search abmas.us abmas.biz
1486 nameserver 127.0.0.1
1487 nameserver 123.45.54.23
1490 <primary>DNS server</primary>
1492 This instructs the name resolver function (when configured correctly) to ask the DNS server
1493 that is running locally to resolve names to addresses. In the event that the local name server
1494 is not available, ask the name server provided by the ISP. The latter, of course, does not resolve
1495 purely local names to IP addresses.
1499 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1500 The final step is to edit the <filename>/etc/nsswitch.conf</filename> file.
1501 This file controls the operation of the various resolver libraries that are part of the Linux
1502 Glibc libraries. Edit this file so that it contains the following entries:
1504 hosts: files dns wins
1510 The basic DHCP and DNS services are now ready for validation testing. Before you can proceed,
1511 there are a few more steps along the road. First, configure the print spooling and print
1512 processing system. Then you can configure the server so that all services
1513 start automatically on reboot. You must also manually start all services prior to validation testing.
1518 <sect2 id="ch4ptrcfg">
1519 <title>Printer Configuration</title>
1522 Network administrators who are new to CUPS based-printing typically experience some difficulty mastering
1523 its powerful features. The steps outlined in this section are designed to navigate around the distractions
1524 of learning CUPS. Instead of implementing smart features and capabilities, our approach is to use it as a
1525 transparent print queue that performs no filtering, and only minimal handling of each print job that is
1526 submitted to it. In other words, our configuration turns CUPS into a raw-mode print queue. This means that
1527 the correct printer driver must be installed on all clients.
1531 <title>Printer Configuration Steps</title>
1534 Configure each printer to be a DHCP client, carefully following the manufacturer's guidelines.
1538 Follow the instructions in the printer manufacturer's manuals to permit printing to port 9100.
1539 Use any other port the manufacturer specifies for direct-mode raw printing, and adjust the
1540 port as necessary in the following example commands.
1541 This allows the CUPS spooler to print using raw mode protocols.
1542 <indexterm><primary>CUPS</primary></indexterm>
1543 <indexterm><primary>raw printing</primary></indexterm>
1547 <indexterm><primary>CUPS</primary><secondary>queue</secondary></indexterm><indexterm>
1548 <primary>lpadmin</primary>
1550 Configure the CUPS Print Queues as follows:
1552 &rootprompt; lpadmin -p qmsa -v socket://qmsa.abmas.biz:9100 -E
1553 &rootprompt; lpadmin -p hplj6a -v socket://hplj6a.abmas.biz:9100 -E
1554 &rootprompt; lpadmin -p qmsf -v socket://qmsf.abmas.biz:9100 -E
1555 &rootprompt; lpadmin -p hplj6f -v socket://hplj6f.abmas.biz:9100 -E
1557 <indexterm><primary>print filter</primary></indexterm>
1558 This creates the necessary print queues with no assigned print filter.
1561 <step><para><indexterm>
1562 <primary>enable</primary>
1564 Print queues may not be enabled at creation. Use <command>lpc stat</command> to check
1565 the status of the print queues and, if necessary, make certain that the queues you have
1566 just created are enabled by executing the following:
1568 &rootprompt; /usr/bin/enable qmsa
1569 &rootprompt; /usr/bin/enable hplj6a
1570 &rootprompt; /usr/bin/enable qmsf
1571 &rootprompt; /usr/bin/enable hplj6f
1575 <step><para><indexterm>
1576 <primary>accept</primary>
1578 Even though your print queues may be enabled, it is still possible that they
1579 are not accepting print jobs. A print queue services incoming printing
1580 requests only when configured to do so. Ensure that your print queues are
1581 set to accept incoming jobs by executing the following commands:
1583 &rootprompt; /usr/sbin/accept qmsa
1584 &rootprompt; /usr/sbin/accept hplj6a
1585 &rootprompt; /usr/sbin/accept qmsf
1586 &rootprompt; /usr/sbin/accept hplj6f
1591 <indexterm><primary>mime type</primary></indexterm>
1592 <indexterm><primary>/etc/mime.convs</primary></indexterm>
1593 <indexterm><primary>application/octet-stream</primary></indexterm>
1594 Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
1596 application/octet-stream application/vnd.cups-raw 0 -
1601 <indexterm><primary>/etc/mime.types</primary></indexterm>
1602 Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
1604 application/octet-stream
1609 Printing drivers are installed on each network client workstation.
1614 Note: If the parameter <parameter>cups options = Raw</parameter> is specified in the &smb.conf; file,
1615 the last two steps can be omitted with CUPS version 1.1.18, or later.
1619 The UNIX system print queues have been configured and are ready for validation testing.
1624 <sect2 id="procstart">
1625 <title>Process Startup Configuration</title>
1628 <indexterm><primary>chkconfig</primary></indexterm>
1629 There are two essential steps to process startup configuration. First, the process
1630 must be configured so that it automatically restarts each time the server
1631 is rebooted. This step involves use of the <command>chkconfig</command> tool that
1632 creates the appropriate symbolic links from the master daemon control file that is
1633 located in the <filename>/etc/rc.d</filename> directory, to the <filename>/etc/rc'x'.d</filename>
1634 directories. Links are created so that when the system run level is changed, the
1635 necessary start or kill script is run.
1639 <indexterm><primary>/etc/xinetd.d</primary></indexterm>
1640 <indexterm><primary>inetd</primary></indexterm>
1641 <indexterm><primary>xinetd</primary></indexterm>
1642 <indexterm><primary>chkconfig</primary></indexterm>
1643 <indexterm><primary>super daemon</primary></indexterm>
1644 In the event that a service is not run as a daemon, but via the internetworking
1645 super daemon (<command>inetd</command> or <command>xinetd</command>), then the <command>chkconfig</command>
1646 tool makes the necessary entries in the <filename>/etc/xinetd.d</filename> directory
1647 and sends a hang-up (HUP) signal to the the super daemon, thus forcing it to
1648 re-read its control files.
1652 Last, each service must be started to permit system validation to proceed.
1657 Use the standard system tool to configure each service to restart
1658 automatically at every system reboot. For example,
1659 <indexterm><primary>chkconfig</primary></indexterm>
1661 &rootprompt; chkconfig dhpcd on
1662 &rootprompt; chkconfig named on
1663 &rootprompt; chkconfig cups on
1664 &rootprompt; chkconfig smb on
1669 <indexterm><primary>starting dhcpd</primary></indexterm>
1670 <indexterm><primary>starting samba</primary></indexterm>
1671 <indexterm><primary>starting CUPS</primary></indexterm>
1672 Now start each service to permit the system to be validated.
1673 Execute each of the following in the sequence shown:
1676 &rootprompt; /etc/rc.d/init.d/dhcpd restart
1677 &rootprompt; /etc/rc.d/init.d/named restart
1678 &rootprompt; /etc/rc.d/init.d/cups restart
1679 &rootprompt; /etc/rc.d/init.d/smb restart
1686 <sect2 id="ch4valid">
1687 <title>Validation</title>
1690 <indexterm><primary>validation</primary></indexterm>
1691 Complex networking problems are most often caused by simple things that are poorly or incorrectly
1692 configured. The validation process adopted here should be followed carefully; it is the result of the
1693 experience gained from years of making and correcting the most common mistakes. Shortcuts often lead to basic errors. You should
1694 refrain from taking shortcuts, from making basic assumptions, and from not exercising due process
1695 and diligence in network validation. By thoroughly testing and validating every step in the process
1696 of network installation and configuration, you can save yourself from sleepless nights and restless
1697 days. A well debugged network is a foundation for happy network users and network administrators.
1698 Later in this book you learn how to make users happier. For now, it is enough to learn to
1699 validate. Let's get on with it.
1703 <title>Server Validation Steps</title>
1706 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1707 One of the most important facets of Samba configuration is to ensure that
1708 name resolution functions correctly. You can check name resolution
1709 with a few simple tests. The most basic name resolution is provided from the
1710 <filename>/etc/hosts</filename> file. To test its operation, make a
1711 temporary edit to the <filename>/etc/nsswitch.conf</filename> file. Using
1712 your favorite editor, change the entry for <constant>hosts</constant> to read:
1716 When you have saved this file, execute the following command:
1718 &rootprompt; ping diamond
1719 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1720 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.131 ms
1721 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.179 ms
1722 64 bytes from sleeth1 (192.168.1.1): icmp_seq=3 ttl=64 time=0.192 ms
1723 64 bytes from sleeth1 (192.168.1.1): icmp_seq=4 ttl=64 time=0.191 ms
1725 --- sleeth1.abmas.biz ping statistics ---
1726 4 packets transmitted, 4 received, 0% packet loss, time 3016ms
1727 rtt min/avg/max/mdev = 0.131/0.173/0.192/0.026 ms
1729 This proves that name resolution via the <filename>/etc/hosts</filename> file
1734 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1735 So far, your installation is going particularly well. In this step we validate
1736 DNS server and name resolution operation. Using your favorite UNIX system editor,
1737 change the <filename>/etc/nsswitch.conf</filename> file so that the
1738 <constant>hosts</constant> entry reads:
1745 <indexterm><primary>named</primary></indexterm>
1746 Before you test DNS operation, it is a good idea to verify that the DNS server
1747 is running by executing the following:
1749 &rootprompt; ps ax | grep named
1750 437 ? S 0:00 /sbin/syslogd -a /var/lib/named/dev/log
1751 524 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1752 525 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1753 526 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1754 529 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1755 540 ? S 0:00 /usr/sbin/named -t /var/lib/named -u named
1756 2552 pts/2 S 0:00 grep named
1758 This means that we are ready to check DNS operation. Do so by executing:
1759 <indexterm><primary>ping</primary></indexterm>
1761 &rootprompt; ping diamond
1762 PING sleeth1.abmas.biz (192.168.1.1) 56(84) bytes of data.
1763 64 bytes from sleeth1 (192.168.1.1): icmp_seq=1 ttl=64 time=0.156 ms
1764 64 bytes from sleeth1 (192.168.1.1): icmp_seq=2 ttl=64 time=0.183 ms
1766 --- sleeth1.abmas.biz ping statistics ---
1767 2 packets transmitted, 2 received, 0% packet loss, time 999ms
1768 rtt min/avg/max/mdev = 0.156/0.169/0.183/0.018 ms
1770 You should take a few more steps to validate DNS server operation, as follows:
1772 &rootprompt; host -f diamond.abmas.biz
1773 sleeth1.abmas.biz has address 192.168.1.1
1775 <indexterm><primary>/etc/hosts</primary></indexterm>
1776 You may now remove the entry called <constant>diamond</constant> from the
1777 <filename>/etc/hosts</filename> file. It does not hurt to leave it there,
1778 but its removal reduces the number of administrative steps for this name.
1782 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1783 WINS is a great way to resolve NetBIOS names to their IP address. You can test
1784 the operation of WINS by starting <command>nmbd</command> (manually or by way
1785 of the Samba startup method shown in <link linkend="procstart"/>). You must edit
1786 the <filename>/etc/nsswitch.conf</filename> file so that the <constant>hosts</constant>
1787 entry is as follows:
1791 The next step is to make certain that Samba is running using <command>ps ax | grep mbd</command>.
1792 The <command>nmbd</command> daemon will provide the WINS name resolution service when the
1793 &smb.conf; file <smbconfsection name="global"/> parameter <smbconfoption name="wins
1794 support">Yes</smbconfoption> has been specified. Having validated that Samba is operational,
1795 excute the following:
1797 &rootprompt; ping diamond
1798 PING diamond (192.168.1.1) 56(84) bytes of data.
1799 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.094 ms
1800 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.479 ms
1802 <indexterm><primary>ping</primary></indexterm>
1803 Now that you can relax with the knowledge that all three major forms of name
1804 resolution to IP address resolution are working, edit the <filename>/etc/nsswitch.conf</filename>
1805 again. This time you add all three forms of name resolution to this file.
1806 Your edited entry for <constant>hosts</constant> should now look like this:
1808 hosts: files dns wins
1810 The system is looking good. Let's move on.
1814 It would give you peace of mind to know that the DHCP server is running
1815 and available for service. You can validate DHCP services by running:
1818 &rootprompt; ps ax | grep dhcp
1819 2618 ? S 0:00 /usr/sbin/dhcpd ...
1820 8180 pts/2 S 0:00 grep dhcp
1822 This shows that the server is running. The proof of whether or not it is working
1823 comes when you try to add the first DHCP client to the network.
1827 <indexterm><primary>testparm</primary></indexterm>
1828 This is a good point at which to start validating Samba operation. You are
1829 content that name resolution is working for basic TCP/IP needs. Let's move on.
1830 If your &smb.conf; file has bogus options or parameters, this may cause Samba
1831 to refuse to start. The first step should always be to validate the contents
1832 of this file by running:
1834 &rootprompt; testparm -s
1835 Load smb config files from smb.conf
1836 Processing section "[homes]"
1837 Processing section "[printers]"
1838 Processing section "[netlogon]"
1839 Processing section "[profiles]"
1840 Processing section "[accounts]"
1841 Processing section "[service]"
1842 Processing section "[apps]"
1843 Loaded services file OK.
1846 workgroup = PROMISES
1847 netbios name = DIAMOND
1848 interfaces = eth1, eth2, lo
1849 bind interfaces only = Yes
1850 passdb backend = tdbsam
1851 pam password change = Yes
1852 passwd program = /usr/bin/passwd '%u'
1853 passwd chat = *New*Password* %n\n \
1854 *Re-enter*new*password* %n\n *Password*changed*
1855 username map = /etc/samba/smbusers
1856 unix password sync = Yes
1859 log file = /var/log/samba/%m
1862 name resolve order = wins bcast hosts
1864 printcap name = CUPS
1865 show add printer wizard = No
1866 add user script = /usr/sbin/useradd -m '%u'
1867 delete user script = /usr/sbin/userdel -r '%u'
1868 add group script = /usr/sbin/groupadd '%g'
1869 delete group script = /usr/sbin/groupdel '%g'
1870 add user to group script = /usr/sbin/usermod -G '%g' '%u'
1871 add machine script = /usr/sbin/useradd \
1872 -s /bin/false -d /dev/null '%u'
1873 shutdown script = /var/lib/samba/scripts/shutdown.sh
1874 abort shutdown script = /sbin/shutdown -c
1875 logon script = scripts\logon.bat
1876 logon path = \\%L\profiles\%U
1878 logon home = \\%L\%U
1880 preferred master = Yes
1883 winbind use default domain = Yes
1884 map acl inherit = Yes
1886 veto files = /*.eml/*.nws/*.{*}/
1887 veto oplock files = /*.doc/*.xls/*.mdb/
1890 comment = Home Directories
1895 ### Remainder cut to save space ###
1897 Clear away all errors before proceeding.
1901 <indexterm><primary>check samba daemons</primary></indexterm>
1902 <indexterm><primary>smbd</primary></indexterm>
1903 <indexterm><primary>nmbd</primary></indexterm>
1904 <indexterm><primary>winbindd</primary></indexterm>
1905 Check that the Samba server is running:
1907 &rootprompt; ps ax | grep mbd
1908 14244 ? S 0:00 /usr/sbin/nmbd -D
1909 14245 ? S 0:00 /usr/sbin/nmbd -D
1910 14290 ? S 0:00 /usr/sbin/smbd -D
1912 $rootprompt; ps ax | grep winbind
1913 14293 ? S 0:00 /usr/sbin/winbindd -D
1914 14295 ? S 0:00 /usr/sbin/winbindd -D
1916 The <command>winbindd</command> daemon is running in split mode (normal), so there are also
1917 two instances<footnote><para>For more information regarding winbindd, see <emphasis>TOSHARG2</emphasis>,
1918 Chapter 23, Section 23.3. The single instance of <command>smbd</command> is normal. One additional
1919 <command>smbd</command> slave process is spawned for each SMB/CIFS client
1920 connection.</para></footnote> of it.
1924 <indexterm><primary>anonymous
1925 connection</primary></indexterm>
1927 <primary>smbclient</primary>
1929 Check that an anonymous connection can be made to the Samba server:
1931 &rootprompt; smbclient -L localhost -U%
1933 Sharename Type Comment
1934 --------- ---- -------
1935 IPC$ IPC IPC Service (Samba 3.0.20)
1936 netlogon Disk Network Logon Service
1937 profiles Disk Profile Share
1938 accounts Disk Accounting Files
1939 service Disk Financial Services Files
1940 apps Disk Application Files
1941 ADMIN$ IPC IPC Service (Samba 3.0.20)
1942 hplj6a Printer hplj6a
1943 hplj6f Printer hplj6f
1949 DIAMOND Samba 3.0.20
1955 This demonstrates that an anonymous listing of shares can be obtained. This is the equivalent
1956 of browsing the server from a Windows client to obtain a list of shares on the server.
1957 The <constant>-U%</constant> argument means to send a <constant>NULL</constant> username and
1958 a <constant>NULL</constant> password.
1962 <indexterm><primary>dhcp client validation</primary></indexterm>
1963 <indexterm><primary>printer validation</primary></indexterm>
1964 <indexterm><primary>arp</primary></indexterm>
1965 Verify that each printer has the IP address assigned in the DHCP server configuration file.
1966 The easiest way to do this is to ping the printer name. Immediately after the ping response
1967 has been received, execute <command>arp -a</command> to find the MAC address of the printer
1968 that has responded. Now you can compare the IP address and the MAC address of the printer
1969 with the configuration information in the <filename>/etc/dhcpd.conf</filename> file. They
1970 should, of course, match. For example,
1972 &rootprompt; ping hplj6
1973 PING hplj6a (192.168.1.30) 56(84) bytes of data.
1974 64 bytes from hplj6a (192.168.1.30): icmp_seq=1 ttl=64 time=0.113 ms
1977 hplj6a (192.168.1.30) at 00:03:47:CB:81:E0 [ether] on eth0
1980 <primary>/etc/dhcpd.conf</primary>
1982 The MAC address <constant>00:03:47:CB:81:E0</constant> matches that specified for the
1983 IP address from which the printer has responded and with the entry for it in the
1984 <filename>/etc/dhcpd.conf</filename> file. Repeat this for each printer configured.
1988 <indexterm><primary>authenticated connection</primary></indexterm>
1989 Make an authenticated connection to the server using the <command>smbclient</command> tool:
1991 &rootprompt; smbclient //diamond/accounts -U gholmes
1994 . D 0 Thu Nov 27 15:07:09 2003
1995 .. D 0 Sat Nov 15 17:40:50 2003
1996 zakadmin.exe 161424 Thu Nov 27 15:06:52 2003
1997 zak.exe 6066384 Thu Nov 27 15:06:52 2003
1998 dhcpd.conf 1256 Thu Nov 27 15:06:52 2003
1999 smb.conf 2131 Thu Nov 27 15:06:52 2003
2000 initGrps.sh A 1089 Thu Nov 27 15:06:52 2003
2001 POLICY.EXE 86542 Thu Nov 27 15:06:52 2003
2003 55974 blocks of size 65536. 33968 blocks available
2009 <indexterm><primary>nmap</primary></indexterm>
2010 Your new server is connected to an Internet-accessible connection. Before you start
2011 your firewall, you should run a port scanner against your system. You should repeat that
2012 after the firewall has been started. This helps you understand to what extent the
2013 server may be vulnerable to external attack. One way you can do this is by using an
2014 external service, such as the <ulink url="http://www.dslreports.com/scan">DSL Reports</ulink>
2015 tools. Alternately, if you can gain root-level access to a remote
2016 UNIX/Linux system that has the <command>nmap</command> tool, you can run the following:
2018 &rootprompt; nmap -v -sT server.abmas.us
2020 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2021 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2022 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2023 Adding open port 6000/tcp
2024 Adding open port 873/tcp
2025 Adding open port 445/tcp
2026 Adding open port 10000/tcp
2027 Adding open port 901/tcp
2028 Adding open port 631/tcp
2029 Adding open port 25/tcp
2030 Adding open port 111/tcp
2031 Adding open port 32770/tcp
2032 Adding open port 3128/tcp
2033 Adding open port 53/tcp
2034 Adding open port 80/tcp
2035 Adding open port 443/tcp
2036 Adding open port 139/tcp
2037 Adding open port 22/tcp
2038 The Connect() Scan took 0 seconds to scan 1601 ports.
2039 Interesting ports on server.abmas.us (123.45.67.66):
2040 (The 1587 ports scanned but not shown below are in state: closed)
2047 139/tcp open netbios-ssn
2049 445/tcp open microsoft-ds
2052 901/tcp open samba-swat
2053 3128/tcp open squid-http
2055 10000/tcp open snet-sensor-mgmt
2056 32770/tcp open sometimes-rpc3
2058 Nmap run completed -- 1 IP address (1 host up) scanned in 1 second
2060 The above scan was run before the external interface was locked down with the NAT-firewall
2061 script you created above. The following results are obtained after the firewall rules
2062 have been put into place:
2064 &rootprompt; nmap -v -sT server.abmas.us
2066 Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
2067 Host server.abmas.us (123.45.67.66) appears to be up ... good.
2068 Initiating Connect() Scan against server.abmas.us (123.45.67.66)
2069 Adding open port 53/tcp
2070 Adding open port 22/tcp
2071 The Connect() Scan took 168 seconds to scan 1601 ports.
2072 Interesting ports on server.abmas.us (123.45.67.66):
2073 (The 1593 ports scanned but not shown below are in state: filtered)
2079 443/tcp closed https
2081 Nmap run completed -- 1 IP address (1 host up) scanned in 168 seconds
2089 <sect2 id="ch4appscfg">
2090 <title>Application Share Configuration</title>
2093 <indexterm><primary>application server</primary></indexterm>
2094 <indexterm><primary>administrative installation</primary></indexterm>
2095 The use of an application server is a key mechanism by which desktop administration overheads
2096 can be reduced. Check the application manual for your software to identify how best to
2097 create an administrative installation.
2101 Some Windows software will only run locally on the desktop computer. Such software
2102 is typically not suited for administrative installation. Administratively installed software
2103 permits one or more of the following installation choices:
2108 Install software fully onto a workstation, storing data files on the same workstation.
2112 Install software fully onto a workstation with central network data file storage.
2116 Install software to run off a central application server with data files stored
2117 on the local workstation. This is often called a minimum installation, or a
2118 network client installation.
2122 Install software to run off a central application server with data files stored
2123 on a central network share. This type of installation often prevents storage
2124 of work files on the local workstation.
2129 <indexterm><primary></primary></indexterm>
2130 A common application deployed in this environment is an office suite.
2131 Enterprise editions of Microsoft Office XP Professional can be administratively installed
2132 by launching the installation from a command shell. The command that achieves this is
2133 <command>setup /a</command>. It results in a set of prompts through which various
2134 installation choices can be made. Refer to the Microsoft Office Resource SDK and Resource
2135 Kit for more information regarding this mode of installation of MS Office XP Professional.
2136 The full administrative installation of MS Office XP Professional requires approximately
2137 650 MB of disk space.
2141 When the MS Office XP Professional product has been installed to the administrative network
2142 share, the product can be installed onto a workstation by executing the normal setup program.
2143 The installation process now provides a choice to either perform a minimum installation
2144 or a full local installation. A full local installation takes over 100 MB of disk space.
2145 A network workstation (minimum) installation requires typically 10 MB to 15 MB of
2146 local disk space. In the latter case, when the applications are used, they load over the network.
2150 <indexterm><primary>Service Packs</primary></indexterm>
2151 <indexterm><primary>Microsoft Office</primary></indexterm>
2152 Microsoft Office Service Packs can be unpacked to update an administrative share. This makes
2153 it possible to update MS Office XP Professional for all users from a single installation
2154 of the service pack and generally circumvents the need to run updates on each network
2159 The default location for MS Office XP Professional data files can be set through registry
2160 editing or by way of configuration options inside each Office XP Professional application.
2164 <indexterm><primary>OpenOffice</primary></indexterm>
2165 OpenOffice.Org OpenOffice Version 1.1.0 can be installed locally. It can also
2166 be installed to run off a network share. The latter is a most desirable solution for office-bound
2167 network users and for administrative staff alike. It permits quick and easy updates
2168 to be rolled out to all users with a minimum of disruption and with maximum flexibility.
2172 The process for installation of administrative shared OpenOffice involves download of the
2173 distribution ZIP file, followed by extraction of the ZIP file into a temporary disk area.
2174 When fully extracted using the unzipping tool of your choosing, change into the Windows
2175 installation files directory then execute <command>setup -net</command>. You are
2176 prompted on screen for the target installation location. This is the administrative
2177 share point. The full administrative OpenOffice share takes approximately 150 MB of disk
2182 <title>Comments Regarding Software Terms of Use</title>
2184 Many single-user products can be installed into an administrative share, but
2185 personal versions of products such as Microsoft Office XP Professional do not permit this.
2186 Many people do not like terms of use typical with commercial products, so a few comments
2187 regarding software licensing seem important.
2191 Please do not use an administrative installation of proprietary and commercially licensed
2192 software products to violate the copyright holders' property. All software is licensed,
2193 particularly software that is licensed for use free of charge. All software is the property
2194 of the copyright holder unless the author and/or copyright holder has explicitly disavowed
2195 ownership and has placed the software into the public domain.
2199 Software that is under the GNU General Public License, like proprietary software, is
2200 licensed in a way that restricts use. For example, if you modify GPL software and then
2201 distribute the binary version of your modifications, you must offer to provide the source
2202 code as well. This restriction is designed to maintain the momentum
2203 of the diffusion of technology and to protect against the withholding of innovations.
2207 Commercial and proprietary software generally restrict use to those who have paid the
2208 license fees and who comply with the licensee's terms of use. Software that is released
2209 under the GNU General Public License is restricted to particular terms and conditions
2210 also. Whatever the licensing terms may be, if you do not approve of the terms of use,
2211 please do not use the software.
2215 <indexterm><primary>GPL</primary></indexterm>
2216 Samba is provided under the terms of the GNU GPL Version 2, a copy of which is provided
2217 with the source code.
2223 <sect2 id="ch4wincfg">
2224 <title>Windows Client Configuration</title>
2227 Christine needs to roll out 130 new desktop systems. There is no doubt that she also needs
2228 to reinstall many of the notebook computers that will be recycled for use with the new network
2229 configuration. The smartest way to handle the challenge of the roll-out program is to build
2230 a staged system for each type of target machine, and then use an image replication tool such as Norton
2231 Ghost (enterprise edition) to replicate the staged machine to its target desktops. The same can
2232 be done with notebook computers as long as they are identical or sufficiently similar.
2235 <procedure id="sbewinclntprep">
2236 <title>Windows Client Configuration Procedure</title>
2239 <indexterm><primary>WINS</primary></indexterm>
2240 <indexterm><primary>DHCP</primary></indexterm>
2241 Install MS Windows XP Professional. During installation, configure the client to use DHCP for
2242 TCP/IP protocol configuration. DHCP configures all Windows clients to use the WINS Server
2243 address that has been defined for the local subnet.
2247 Join the Windows Domain <constant>PROMISES</constant>. Use the Domain Administrator
2248 username <constant>root</constant> and the SMB password you assigned to this account.
2249 A detailed step-by-step procedure for joining a Windows 200x/XP Professional client to
2250 a Windows Domain is given in <link linkend="appendix"/>, <link linkend="domjoin"/>.
2251 Reboot the machine as prompted and then log on using the Domain Administrator account
2252 (<constant>root</constant>).
2256 Verify <constant>DIAMOND</constant> is visible in <guimenu>My Network Places</guimenu>,
2257 that it is possible to connect to it and see the shares <guimenuitem>accounts</guimenuitem>,
2258 <guimenuitem>apps</guimenuitem>, and <guimenuitem>finsvcs</guimenuitem>, and that it is
2259 possible to open each share to reveal its contents.
2263 Create a drive mapping to the <constant>apps</constant> share on the server <constant>DIAMOND</constant>.
2267 Perform an administrative installation of each application to be used. Select the options
2268 that you wish to use. Of course, you can choose to run applications over the network, correct?
2272 Now install all applications to be installed locally. Typical tools include Adobe Acrobat,
2273 NTP-based time synchronization software, drivers for specific local devices such as fingerprint
2274 scanners, and the like. Probably the most significant application for local installation
2275 is antivirus software.
2279 Now install all four printers onto the staging system. The printers you install
2280 include the accounting department HP LaserJet 6 and Minolta QMS Magicolor printers. You will
2281 also configure identical printers that are located in the financial services department.
2282 Install printers on each machine following the steps shown in the Windows client printer
2283 preparation procedure below.
2287 <indexterm><primary>defragmentation</primary></indexterm>
2288 When you are satisfied that the staging systems are complete, use the appropriate procedure to
2289 remove the client from the domain. Reboot the system and then log on as the local administrator
2290 and clean out all temporary files stored on the system. Before shutting down, use the disk
2291 defragmentation tool so that the file system is in optimal condition before replication.
2295 Boot the workstation using the Norton (Symantec) Ghosting diskette (or CD-ROM) and image the
2296 machine to a network share on the server.
2300 <indexterm><primary>Windows security identifier</primary><see>SID</see></indexterm>
2301 <indexterm><primary>SID</primary></indexterm>
2302 You may now replicate the image to the target machines using the appropriate Norton Ghost
2303 procedure. Make sure to use the procedure that ensures each machine has a unique
2304 Windows security identifier (SID). When the installation of the disk image has completed, boot the PC.
2308 Log on to the machine as the local Administrator (the only option), and join the machine to
2309 the Domain, following the procedure set out in <link linkend="appendix"/>, <link linkend="domjoin"/>. The system is now
2310 ready for the user to log on, provided you have created a network logon account for that
2315 Instruct all users to log on to the workstation using their assigned username and password.
2319 <procedure id="sbewinclntptrprep">
2320 <title>Windows Client Printer Preparation Procedure</title>
2324 <guimenu>Start</guimenu>
2325 <guimenuitem>Settings</guimenuitem>
2326 <guimenuitem>Printers</guimenuitem>
2327 <guiicon>Add Printer</guiicon>
2328 <guibutton>Next</guibutton>
2329 </menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
2330 Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
2334 Click <guibutton>Next</guibutton>. In the
2335 <guimenuitem>Manufacturer:</guimenuitem> panel, select <constant>HP</constant>.
2336 In the <guimenuitem>Printers:</guimenuitem> panel, select the printer called
2337 <constant>HP LaserJet 6</constant>. Click <guibutton>Next</guibutton>.
2341 In the <guimenuitem>Available ports:</guimenuitem> panel, select
2342 <constant>FILE:</constant>. Accept the default printer name by clicking
2343 <guibutton>Next</guibutton>. When asked, <quote>Would you like to print a
2344 test page?,</quote> click <guimenuitem>No</guimenuitem>. Click
2345 <guibutton>Finish</guibutton>.
2349 You may be prompted for the name of a file to print to. If so, close the
2350 dialog panel. Right-click <menuchoice>
2351 <guiicon>HP LaserJet 6</guiicon>
2352 <guimenuitem>Properties</guimenuitem>
2353 <guisubmenu>Details (Tab)</guisubmenu>
2354 <guimenuitem>Add Port</guimenuitem>
2359 In the <guimenuitem>Network</guimenuitem> panel, enter the name of
2360 the print queue on the Samba server as follows: <constant>\\DIAMOND\hplj6a</constant>.
2362 <guibutton>OK</guibutton>
2363 <guibutton>OK</guibutton>
2364 </menuchoice> to complete the installation.
2368 Repeat the printer installation steps above for both HP LaserJet 6 printers
2369 as well as for both QMS Magicolor laser printers.
2376 <title>Key Points Learned</title>
2379 How do you feel? You have built a capable network, a truly ambitious project.
2380 Future network updates can be handled by
2381 your staff. You must be a satisfied manager. Let's review the achievements.
2386 A simple firewall has been configured to protect the server in the event that
2387 the ISP firewall service should fail.
2391 The Samba configuration uses measures to ensure that only local network users
2392 can connect to SMB/CIFS services.
2396 Samba uses the new <constant>tdbsam</constant> passdb backend facility.
2397 Considerable complexity was added to Samba functionality.
2401 A DHCP server was configured to implement dynamic DNS (DDNS) updates to the DNS
2406 The DNS server was configured to permit DDNS only for local network clients. This
2407 server also provides primary DNS services for the company Internet presence.
2411 You introduced an application server as well as the concept of cloning a Windows
2412 client in order to effect improved standardization of desktops and to reduce
2413 the costs of network management.
2422 <title>Questions and Answers</title>
2427 <qandaset defaultlable="missed01" type="number">
2432 What is the maximum number of account entries that the <parameter>tdbsam</parameter>
2433 passdb backend can handle?
2440 The tdb data structure and support system can handle more entries than the number of
2441 accounts that are possible on most UNIX systems. A practical limit would come into
2442 play long before a performance boundary would be anticipated. That practical limit
2443 is controlled by the nature of Windows networking. There are few Windows file and
2444 print servers that can handle more than a few hundred concurrent client connections.
2445 The key limiting factors that predicate offloading of services to additional servers
2446 are memory capacity, the number of CPUs, network bandwidth, and disk I/O limitations.
2447 All of these are readily exhausted by just a few hundred concurrent active users.
2448 Such bottlenecks can best be removed by segmentation of the network (distributing
2449 network load across multiple networks).
2453 As the network grows, it becomes necessary to provide additional authentication
2454 servers (domain controllers). The tdbsam is limited to a single machine and cannot
2455 be reliably replicated. This means that practical limits on network design dictate
2456 the point at which a distributed passdb backend is required; at this time, there is
2457 no real alternative other than ldapsam (LDAP).
2461 The guideline provided in <emphasis>TOSHARG2</emphasis>, Chapter 10, Section 10.1.2,
2462 is to limit the number of accounts in the tdbsam backend to 250. This is the point
2463 at which most networks tend to want backup domain controllers (BDCs). Samba-3 does
2464 not provide a mechanism for replicating tdbsam data so it can be used by a BDC. The
2465 limitation of 250 users per tdbsam is predicated only on the need for replication,
2466 not on the limits<footnote><para>Bench tests have shown that tdbsam is a very
2467 effective database technology. There is surprisingly little performance loss even
2468 with over 4000 users.</para></footnote> of the tdbsam backend itself.
2478 Would Samba operate any better if the OS level is set to a value higher than 35?
2485 No. MS Windows workstations and servers do not use a value higher than 33. Setting this to a value
2486 of 35 already assures Samba of precedence over MS Windows products in browser elections. There is
2487 no gain to be had from setting this higher.
2497 Why in this example have you provided UNIX group to Windows Group mappings for only Domain Groups?
2504 At this time, Samba has the capacity to use only Domain Groups mappings. It is possible that at
2505 a later date Samba may make use of Windows Local Groups, as well as of the Active Directory special
2506 Groups. Proper operation requires Domain Groups to be mapped to valid UNIX groups.
2516 Why has a path been specified in the <parameter>IPC$</parameter> share?
2523 This is done so that in the event that a software bug may permit a client connection to the IPC$ share to
2524 obtain access to the file system, it does so at a location that presents least risk. Under normal operation
2525 this type of paranoid step should not be necessary. The use of this parameter should not be necessary.
2535 Why does the &smb.conf; file in this exercise include an entry for <smbconfoption name="smb ports"/>?
2542 The default order by which Samba-3 attempts to communicate with MS Windows clients is via port 445 (the TCP port
2543 used by Windows clients when NetBIOS-less SMB over TCP/IP is in use). TCP port 139 is the primary port used for NetBIOS
2544 over TCP/IP. In this configuration Windows network operations are predicated around NetBIOS over TCP/IP. By
2545 specifying the use of only port 139, the intent is to reduce unsuccessful service connection attempts.
2546 The result of this is improved network performance. Where Samba-3 is installed as an Active Directory Domain
2547 member, the default behavior is highly beneficial and should not be changed.
2557 What is the difference between a print queue and a printer?
2564 A printer is a physical device that is connected either directly to the network or to a computer
2565 via a serial, parallel, or USB connection so that print jobs can be submitted to it to create a
2566 hard copy printout. Network-attached printers that use TCP/IP-based printing generally accept a
2567 single print data stream and block all secondary attempts to dispatch jobs concurrently to the
2568 same device. If many clients were to concurrently print directly via TCP/IP to the same printer,
2569 it would result in a huge amount of network traffic through continually failing connection attempts.
2573 A print server (like CUPS or LPR/LPD) accepts multiple concurrent input streams or
2574 print requests. When the data stream has been fully received, the input stream is closed,
2575 and the job is then submitted to a sequential print queue where the job is stored until
2576 the printer is ready to receive the job.
2586 Can all MS Windows application software be installed onto an application server share?
2593 Much older Windows software is not compatible with installation to and execution from
2594 an application server. Enterprise versions of Microsoft Office XP Professional can
2595 be installed to an application server. Retail consumer versions of Microsoft Office XP
2596 Professional do not permit installation to an application server share and can be installed
2597 and used only to/from a local workstation hard disk.
2607 Why use dynamic DNS (DDNS)?
2614 When DDNS records are updated directly from the DHCP server, it is possible for
2615 network clients that are not NetBIOS-enabled, and thus cannot use WINS, to locate
2616 Windows clients via DNS.
2626 Why would you use WINS as well as DNS-based name resolution?
2633 WINS is to NetBIOS names as DNS is to fully qualified domain names (FQDN). The FQDN is
2634 a name like <quote>myhost.mydomain.tld</quote> where <parameter>tld</parameter>
2635 means <constant>top-level domain</constant>. A FQDN is a longhand but easy-to-remember
2636 expression that may be up to 1024 characters in length and that represents an IP address.
2637 A NetBIOS name is always 16 characters long. The 16<superscript>th</superscript> character
2638 is a name type indicator. A specific name type is registered<footnote><para>
2639 See <emphasis>TOSHARG2</emphasis>, Chapter 9, for more information.</para></footnote> for each
2640 type of service that is provided by the Windows server or client and that may be registered
2641 where a WINS server is in use.
2645 WINS is a mechanism by which a client may locate the IP Address that corresponds to a
2646 NetBIOS name. The WINS server may be queried to obtain the IP Address for a NetBIOS name
2647 that includes a particular registered NetBIOS name type. DNS does not provide a mechanism
2648 that permits handling of the NetBIOS name type information.
2652 DNS provides a mechanism by which TCP/IP clients may locate the IP address of a particular
2653 hostname or service name that has been registered in the DNS database for a particular domain.
2654 A DNS server has limited scope of control and is said to be authoritative for the zone over
2655 which it has control.
2659 Windows 200x Active Directory requires the registration in the DNS zone for the domain it
2660 controls of service locator<footnote><para>See TOSHARG2, Chapter 9, Section 9.3.3.</para></footnote> records
2661 that Windows clients and servers will use to locate Kerberos and LDAP services. ADS also
2662 requires the registration of special records that are called global catalog (GC) entries
2663 and site entries by which domain controllers and other essential ADS servers may be located.
2673 What are the major benefits of using an application server?
2680 The use of an application server can significantly reduce application update maintenance.
2681 By providing a centralized application share, software updates need be applied to only
2682 one location for all major applications used. This results in faster update roll-outs and
2683 significantly better application usage control.