This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.
[kai/samba.git] / docs / htmldocs / integrate-ms-networks.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Integrating MS Windows networks with Samba</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.77"><LINK
9 REL="HOME"
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
12 REL="PREVIOUS"
13 TITLE="How to Install and Test SAMBA"
14 HREF="install.html"><LINK
15 REL="NEXT"
16 TITLE="Configuring PAM for distributed but centrally 
17 managed authentication"
18 HREF="pam.html"></HEAD
19 ><BODY
20 CLASS="CHAPTER"
21 BGCOLOR="#FFFFFF"
22 TEXT="#000000"
23 LINK="#0000FF"
24 VLINK="#840084"
25 ALINK="#0000FF"
26 ><DIV
27 CLASS="NAVHEADER"
28 ><TABLE
29 SUMMARY="Header navigation table"
30 WIDTH="100%"
31 BORDER="0"
32 CELLPADDING="0"
33 CELLSPACING="0"
34 ><TR
35 ><TH
36 COLSPAN="3"
37 ALIGN="center"
38 >SAMBA Project Documentation</TH
39 ></TR
40 ><TR
41 ><TD
42 WIDTH="10%"
43 ALIGN="left"
44 VALIGN="bottom"
45 ><A
46 HREF="install.html"
47 ACCESSKEY="P"
48 >Prev</A
49 ></TD
50 ><TD
51 WIDTH="80%"
52 ALIGN="center"
53 VALIGN="bottom"
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="right"
58 VALIGN="bottom"
59 ><A
60 HREF="pam.html"
61 ACCESSKEY="N"
62 >Next</A
63 ></TD
64 ></TR
65 ></TABLE
66 ><HR
67 ALIGN="LEFT"
68 WIDTH="100%"></DIV
69 ><DIV
70 CLASS="CHAPTER"
71 ><H1
72 ><A
73 NAME="INTEGRATE-MS-NETWORKS"
74 ></A
75 >Chapter 2. Integrating MS Windows networks with Samba</H1
76 ><DIV
77 CLASS="SECT1"
78 ><H1
79 CLASS="SECT1"
80 ><A
81 NAME="AEN223"
82 ></A
83 >2.1. Agenda</H1
84 ><P
85 >To identify the key functional mechanisms of MS Windows networking 
86 to enable the deployment of Samba as a means of extending and/or 
87 replacing MS Windows NT/2000 technology.</P
88 ><P
89 >We will examine:</P
90 ><P
91 ></P
92 ><OL
93 TYPE="1"
94 ><LI
95 ><P
96 >Name resolution in a pure Unix/Linux TCP/IP 
97         environment
98         </P
99 ></LI
100 ><LI
101 ><P
102 >Name resolution as used within MS Windows 
103         networking
104         </P
105 ></LI
106 ><LI
107 ><P
108 >How browsing functions and how to deploy stable 
109         and dependable browsing using Samba
110         </P
111 ></LI
112 ><LI
113 ><P
114 >MS Windows security options and how to 
115         configure Samba for seemless integration
116         </P
117 ></LI
118 ><LI
119 ><P
120 >Configuration of Samba as:</P
121 ><P
122 ></P
123 ><OL
124 TYPE="a"
125 ><LI
126 ><P
127 >A stand-alone server</P
128 ></LI
129 ><LI
130 ><P
131 >An MS Windows NT 3.x/4.0 security domain member
132                 </P
133 ></LI
134 ><LI
135 ><P
136 >An alternative to an MS Windows NT 3.x/4.0 Domain Controller
137                 </P
138 ></LI
139 ></OL
140 ></LI
141 ></OL
142 ></DIV
143 ><DIV
144 CLASS="SECT1"
145 ><H1
146 CLASS="SECT1"
147 ><A
148 NAME="AEN245"
149 ></A
150 >2.2. Name Resolution in a pure Unix/Linux world</H1
151 ><P
152 >The key configuration files covered in this section are:</P
153 ><P
154 ></P
155 ><UL
156 ><LI
157 ><P
158 ><TT
159 CLASS="FILENAME"
160 >/etc/hosts</TT
161 ></P
162 ></LI
163 ><LI
164 ><P
165 ><TT
166 CLASS="FILENAME"
167 >/etc/resolv.conf</TT
168 ></P
169 ></LI
170 ><LI
171 ><P
172 ><TT
173 CLASS="FILENAME"
174 >/etc/host.conf</TT
175 ></P
176 ></LI
177 ><LI
178 ><P
179 ><TT
180 CLASS="FILENAME"
181 >/etc/nsswitch.conf</TT
182 ></P
183 ></LI
184 ></UL
185 ><DIV
186 CLASS="SECT2"
187 ><H2
188 CLASS="SECT2"
189 ><A
190 NAME="AEN261"
191 ></A
192 >2.2.1. <TT
193 CLASS="FILENAME"
194 >/etc/hosts</TT
195 ></H2
196 ><P
197 >Contains a static list of IP Addresses and names.
198 eg:</P
199 ><P
200 ><PRE
201 CLASS="PROGRAMLISTING"
202 >       127.0.0.1       localhost localhost.localdomain
203         192.168.1.1     bigbox.caldera.com      bigbox  alias4box</PRE
204 ></P
205 ><P
206 >The purpose of <TT
207 CLASS="FILENAME"
208 >/etc/hosts</TT
209 > is to provide a 
210 name resolution mechanism so that uses do not need to remember 
211 IP addresses.</P
212 ><P
213 >Network packets that are sent over the physical network transport 
214 layer communicate not via IP addresses but rather using the Media 
215 Access Control address, or MAC address. IP Addresses are currently 
216 32 bits in length and are typically presented as four (4) decimal 
217 numbers that are separated by a dot (or period). eg: 168.192.1.1</P
218 ><P
219 >MAC Addresses use 48 bits (or 6 bytes) and are typically represented 
220 as two digit hexadecimal numbers separated by colons. eg: 
221 40:8e:0a:12:34:56</P
222 ><P
223 >Every network interfrace must have an MAC address. Associated with 
224 a MAC address there may be one or more IP addresses. There is NO 
225 relationship between an IP address and a MAC address, all such assignments 
226 are arbitary or discretionary in nature. At the most basic level all 
227 network communications takes place using MAC addressing. Since MAC 
228 addresses must be globally unique, and generally remains fixed for 
229 any particular interface, the assignment of an IP address makes sense 
230 from a network management perspective. More than one IP address can 
231 be assigned per MAC address. One address must be the primary IP address, 
232 this is the address that will be returned in the ARP reply.</P
233 ><P
234 >When a user or a process wants to communicate with another machine 
235 the protocol implementation ensures that the "machine name" or "host 
236 name" is resolved to an IP address in a manner that is controlled 
237 by the TCP/IP configuration control files. The file 
238 <TT
239 CLASS="FILENAME"
240 >/etc/hosts</TT
241 > is one such file.</P
242 ><P
243 >When the IP address of the destination interface has been 
244 determined a protocol called ARP/RARP is used to identify 
245 the MAC address of the target interface. ARP stands for Address 
246 Resolution Protocol, and is a broadcast oriented method that 
247 uses UDP (User Datagram Protocol) to send a request to all 
248 interfaces on the local network segment using the all 1's MAC 
249 address. Network interfaces are programmed to respond to two 
250 MAC addresses only; their own unique address and the address 
251 ff:ff:ff:ff:ff:ff. The reply packet from an ARP request will 
252 contain the MAC address and the primary IP address for each 
253 interface.</P
254 ><P
255 >The <TT
256 CLASS="FILENAME"
257 >/etc/hosts</TT
258 > file is foundational to all 
259 Unix/Linux TCP/IP installations and as a minumum will contain 
260 the localhost and local network interface IP addresses and the 
261 primary names by which they are known within the local machine. 
262 This file helps to prime the pump so that a basic level of name 
263 resolution can exist before any other method of name resolution 
264 becomes available.</P
265 ></DIV
266 ><DIV
267 CLASS="SECT2"
268 ><H2
269 CLASS="SECT2"
270 ><A
271 NAME="AEN277"
272 ></A
273 >2.2.2. <TT
274 CLASS="FILENAME"
275 >/etc/resolv.conf</TT
276 ></H2
277 ><P
278 >This file tells the name resolution libraries:</P
279 ><P
280 ></P
281 ><UL
282 ><LI
283 ><P
284 >The name of the domain to which the machine 
285         belongs
286         </P
287 ></LI
288 ><LI
289 ><P
290 >The name(s) of any domains that should be 
291         automatically searched when trying to resolve unqualified 
292         host names to their IP address
293         </P
294 ></LI
295 ><LI
296 ><P
297 >The name or IP address of available Domain 
298         Name Servers that may be asked to perform name to address 
299         translation lookups
300         </P
301 ></LI
302 ></UL
303 ></DIV
304 ><DIV
305 CLASS="SECT2"
306 ><H2
307 CLASS="SECT2"
308 ><A
309 NAME="AEN288"
310 ></A
311 >2.2.3. <TT
312 CLASS="FILENAME"
313 >/etc/host.conf</TT
314 ></H2
315 ><P
316 ><TT
317 CLASS="FILENAME"
318 >/etc/host.conf</TT
319 > is the primary means by 
320 which the setting in /etc/resolv.conf may be affected. It is a 
321 critical configuration file.  This file controls the order by 
322 which name resolution may procede. The typical structure is:</P
323 ><P
324 ><PRE
325 CLASS="PROGRAMLISTING"
326 >       order hosts,bind
327         multi on</PRE
328 ></P
329 ><P
330 >then both addresses should be returned. Please refer to the 
331 man page for host.conf for further details.</P
332 ></DIV
333 ><DIV
334 CLASS="SECT2"
335 ><H2
336 CLASS="SECT2"
337 ><A
338 NAME="AEN296"
339 ></A
340 >2.2.4. <TT
341 CLASS="FILENAME"
342 >/etc/nsswitch.conf</TT
343 ></H2
344 ><P
345 >This file controls the actual name resolution targets. The 
346 file typically has resolver object specifications as follows:</P
347 ><P
348 ><PRE
349 CLASS="PROGRAMLISTING"
350 >       # /etc/nsswitch.conf
351         #
352         # Name Service Switch configuration file.
353         #
354
355         passwd:         compat
356         # Alternative entries for password authentication are:
357         # passwd:       compat files nis ldap winbind
358         shadow:         compat
359         group:          compat
360
361         hosts:          files nis dns
362         # Alternative entries for host name resolution are:
363         # hosts:        files dns nis nis+ hesoid db compat ldap wins
364         networks:       nis files dns
365
366         ethers:         nis files
367         protocols:      nis files
368         rpc:            nis files
369         services:       nis files</PRE
370 ></P
371 ><P
372 >Of course, each of these mechanisms requires that the appropriate 
373 facilities and/or services are correctly configured.</P
374 ><P
375 >It should be noted that unless a network request/message must be 
376 sent, TCP/IP networks are silent. All TCP/IP communications assumes a 
377 principal of speaking only when necessary.</P
378 ><P
379 >Samba version 2.2.0 will add Linux support for extensions to 
380 the name service switch infrastructure so that linux clients will 
381 be able to obtain resolution of MS Windows NetBIOS names to IP 
382 Addresses. To gain this functionality Samba needs to be compiled 
383 with appropriate arguments to the make command (ie: <B
384 CLASS="COMMAND"
385 >make 
386 nsswitch/libnss_wins.so</B
387 >). The resulting library should 
388 then be installed in the <TT
389 CLASS="FILENAME"
390 >/lib</TT
391 > directory and 
392 the "wins" parameter needs to be added to the "hosts:" line in 
393 the <TT
394 CLASS="FILENAME"
395 >/etc/nsswitch.conf</TT
396 > file. At this point it 
397 will be possible to ping any MS Windows machine by it's NetBIOS 
398 machine name, so long as that machine is within the workgroup to 
399 which both the samba machine and the MS Windows machine belong.</P
400 ></DIV
401 ></DIV
402 ><DIV
403 CLASS="SECT1"
404 ><H1
405 CLASS="SECT1"
406 ><A
407 NAME="AEN308"
408 ></A
409 >2.3. Name resolution as used within MS Windows networking</H1
410 ><P
411 >MS Windows networking is predicated about the name each machine 
412 is given. This name is known variously (and inconsistently) as 
413 the "computer name", "machine name", "networking name", "netbios name", 
414 "SMB name". All terms mean the same thing with the exception of 
415 "netbios name" which can apply also to the name of the workgroup or the 
416 domain name. The terms "workgroup" and "domain" are really just a 
417 simply name with which the machine is associated. All NetBIOS names 
418 are exactly 16 characters in length. The 16th character is reserved. 
419 It is used to store a one byte value that indicates service level 
420 information for the NetBIOS name that is registered. A NetBIOS machine 
421 name is therefore registered for each service type that is provided by 
422 the client/server.</P
423 ><P
424 >The following are typical NetBIOS name/service type registrations:</P
425 ><P
426 ><PRE
427 CLASS="PROGRAMLISTING"
428 >       Unique NetBIOS Names:
429                 MACHINENAME&#60;00&#62; = Server Service is running on MACHINENAME
430                 MACHINENAME&#60;03&#62; = Generic Machine Name (NetBIOS name)
431                 MACHINENAME&#60;20&#62; = LanMan Server service is running on MACHINENAME
432                 WORKGROUP&#60;1b&#62; = Domain Master Browser
433
434         Group Names:
435                 WORKGROUP&#60;03&#62; = Generic Name registered by all members of WORKGROUP
436                 WORKGROUP&#60;1c&#62; = Domain Controllers / Netlogon Servers
437                 WORKGROUP&#60;1d&#62; = Local Master Browsers
438                 WORKGROUP&#60;1e&#62; = Internet Name Resolvers</PRE
439 ></P
440 ><P
441 >It should be noted that all NetBIOS machines register their own 
442 names as per the above. This is in vast contrast to TCP/IP 
443 installations where traditionally the system administrator will 
444 determine in the /etc/hosts or in the DNS database what names 
445 are associated with each IP address.</P
446 ><P
447 >One further point of clarification should be noted, the <TT
448 CLASS="FILENAME"
449 >/etc/hosts</TT
450
451 file and the DNS records do not provide the NetBIOS name type information 
452 that MS Windows clients depend on to locate the type of service that may 
453 be needed. An example of this is what happens when an MS Windows client 
454 wants to locate a domain logon server. It find this service and the IP 
455 address of a server that provides it by performing a lookup (via a 
456 NetBIOS broadcast) for enumeration of all machines that have 
457 registered the name type *&#60;1c&#62;. A logon request is then sent to each 
458 IP address that is returned in the enumerated list of IP addresses. Which 
459 ever machine first replies then ends up providing the logon services.</P
460 ><P
461 >The name "workgroup" or "domain" really can be confusing since these 
462 have the added significance of indicating what is the security 
463 architecture of the MS Windows network. The term "workgroup" indicates 
464 that the primary nature of the network environment is that of a 
465 peer-to-peer design. In a WORKGROUP all machines are responsible for 
466 their own security, and generally such security is limited to use of 
467 just a password (known as SHARE MODE security). In most situations 
468 with peer-to-peer networking the users who control their own machines 
469 will simply opt to have no security at all. It is possible to have 
470 USER MODE security in a WORKGROUP environment, thus requiring use 
471 of a user name and a matching password.</P
472 ><P
473 >MS Windows networking is thus predetermined to use machine names 
474 for all local and remote machine message passing. The protocol used is 
475 called Server Message Block (SMB) and this is implemented using 
476 the NetBIOS protocol (Network Basic Input Output System). NetBIOS can 
477 be encapsulated using LLC (Logical Link Control) protocol - in which case 
478 the resulting protocol is called NetBEUI (Network Basic Extended User 
479 Interface). NetBIOS can also be run over IPX (Internetworking Packet 
480 Exchange) protocol as used by Novell NetWare, and it can be run 
481 over TCP/IP protocols - in which case the resulting protocol is called 
482 NBT or NetBT, the NetBIOS over TCP/IP.</P
483 ><P
484 >MS Windows machines use a complex array of name resolution mechanisms. 
485 Since we are primarily concerned with TCP/IP this demonstration is 
486 limited to this area.</P
487 ><DIV
488 CLASS="SECT2"
489 ><H2
490 CLASS="SECT2"
491 ><A
492 NAME="AEN320"
493 ></A
494 >2.3.1. The NetBIOS Name Cache</H2
495 ><P
496 >All MS Windows machines employ an in memory buffer in which is 
497 stored the NetBIOS names and IP addresses for all external 
498 machines that that machine has communicated with over the 
499 past 10-15 minutes. It is more efficient to obtain an IP address 
500 for a machine from the local cache than it is to go through all the 
501 configured name resolution mechanisms.</P
502 ><P
503 >If a machine whose name is in the local name cache has been shut 
504 down before the name had been expired and flushed from the cache, then 
505 an attempt to exchange a message with that machine will be subject 
506 to time-out delays. i.e.: Its name is in the cache, so a name resolution 
507 lookup will succeed, but the machine can not respond. This can be 
508 frustrating for users - but it is a characteristic of the protocol.</P
509 ><P
510 >The MS Windows utility that allows examination of the NetBIOS 
511 name cache is called "nbtstat". The Samba equivalent of this 
512 is called "nmblookup".</P
513 ></DIV
514 ><DIV
515 CLASS="SECT2"
516 ><H2
517 CLASS="SECT2"
518 ><A
519 NAME="AEN325"
520 ></A
521 >2.3.2. The LMHOSTS file</H2
522 ><P
523 >This file is usually located in MS Windows NT 4.0 or 
524 2000 in <TT
525 CLASS="FILENAME"
526 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
527 > and contains 
528 the IP Address and the machine name in matched pairs. The 
529 <TT
530 CLASS="FILENAME"
531 >LMHOSTS</TT
532 > file performs NetBIOS name 
533 to IP address mapping oriented.</P
534 ><P
535 >It typically looks like:</P
536 ><P
537 ><PRE
538 CLASS="PROGRAMLISTING"
539 >       # Copyright (c) 1998 Microsoft Corp.
540         #
541         # This is a sample LMHOSTS file used by the Microsoft Wins Client (NetBIOS
542         # over TCP/IP) stack for Windows98
543         #
544         # This file contains the mappings of IP addresses to NT computernames
545         # (NetBIOS) names.  Each entry should be kept on an individual line.
546         # The IP address should be placed in the first column followed by the
547         # corresponding computername. The address and the comptername
548         # should be separated by at least one space or tab. The "#" character
549         # is generally used to denote the start of a comment (see the exceptions
550         # below).
551         #
552         # This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
553         # files and offers the following extensions:
554         #
555         #      #PRE
556         #      #DOM:&lt;domain&gt;
557         #      #INCLUDE &lt;filename&gt;
558         #      #BEGIN_ALTERNATE
559         #      #END_ALTERNATE
560         #      \0xnn (non-printing character support)
561         #
562         # Following any entry in the file with the characters "#PRE" will cause
563         # the entry to be preloaded into the name cache. By default, entries are
564         # not preloaded, but are parsed only after dynamic name resolution fails.
565         #
566         # Following an entry with the "#DOM:&lt;domain&gt;" tag will associate the
567         # entry with the domain specified by &lt;domain&gt;. This affects how the
568         # browser and logon services behave in TCP/IP environments. To preload
569         # the host name associated with #DOM entry, it is necessary to also add a
570         # #PRE to the line. The &lt;domain&gt; is always preloaded although it will not
571         # be shown when the name cache is viewed.
572         #
573         # Specifying "#INCLUDE &lt;filename&gt;" will force the RFC NetBIOS (NBT)
574         # software to seek the specified &lt;filename&gt; and parse it as if it were
575         # local. &lt;filename&gt; is generally a UNC-based name, allowing a
576         # centralized lmhosts file to be maintained on a server.
577         # It is ALWAYS necessary to provide a mapping for the IP address of the
578         # server prior to the #INCLUDE. This mapping must use the #PRE directive.
579         # In addtion the share "public" in the example below must be in the
580         # LanManServer list of "NullSessionShares" in order for client machines to
581         # be able to read the lmhosts file successfully. This key is under
582         # \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
583         # in the registry. Simply add "public" to the list found there.
584         #
585         # The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
586         # statements to be grouped together. Any single successful include
587         # will cause the group to succeed.
588         #
589         # Finally, non-printing characters can be embedded in mappings by
590         # first surrounding the NetBIOS name in quotations, then using the
591         # \0xnn notation to specify a hex value for a non-printing character.
592         #
593         # The following example illustrates all of these extensions:
594         #
595         # 102.54.94.97     rhino         #PRE #DOM:networking  #net group's DC
596         # 102.54.94.102    "appname  \0x14"                    #special app server
597         # 102.54.94.123    popular            #PRE             #source server
598         # 102.54.94.117    localsrv           #PRE             #needed for the include
599         #
600         # #BEGIN_ALTERNATE
601         # #INCLUDE \\localsrv\public\lmhosts
602         # #INCLUDE \\rhino\public\lmhosts
603         # #END_ALTERNATE
604         #
605         # In the above example, the "appname" server contains a special
606         # character in its name, the "popular" and "localsrv" server names are
607         # preloaded, and the "rhino" server name is specified so it can be used
608         # to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
609         # system is unavailable.
610         #
611         # Note that the whole file is parsed including comments on each lookup,
612         # so keeping the number of comments to a minimum will improve performance.
613         # Therefore it is not advisable to simply add lmhosts file entries onto the
614         # end of this file.</PRE
615 ></P
616 ></DIV
617 ><DIV
618 CLASS="SECT2"
619 ><H2
620 CLASS="SECT2"
621 ><A
622 NAME="AEN333"
623 ></A
624 >2.3.3. HOSTS file</H2
625 ><P
626 >This file is usually located in MS Windows NT 4.0 or 2000 in 
627 <TT
628 CLASS="FILENAME"
629 >C:\WINNT\SYSTEM32\DRIVERS\ETC</TT
630 > and contains 
631 the IP Address and the IP hostname in matched pairs. It can be 
632 used by the name resolution infrastructure in MS Windows, depending 
633 on how the TCP/IP environment is configured. This file is in 
634 every way the equivalent of the Unix/Linux <TT
635 CLASS="FILENAME"
636 >/etc/hosts</TT
637 > file.</P
638 ></DIV
639 ><DIV
640 CLASS="SECT2"
641 ><H2
642 CLASS="SECT2"
643 ><A
644 NAME="AEN338"
645 ></A
646 >2.3.4. DNS Lookup</H2
647 ><P
648 >This capability is configured in the TCP/IP setup area in the network 
649 configuration facility. If enabled an elaborate name resolution sequence 
650 is followed the precise nature of which isdependant on what the NetBIOS 
651 Node Type parameter is configured to. A Node Type of 0 means use 
652 NetBIOS broadcast (over UDP broadcast) is first used if the name 
653 that is the subject of a name lookup is not found in the NetBIOS name 
654 cache. If that fails then DNS, HOSTS and LMHOSTS are checked. If set to 
655 Node Type 8, then a NetBIOS Unicast (over UDP Unicast) is sent to the 
656 WINS Server to obtain a lookup before DNS, HOSTS, LMHOSTS, or broadcast 
657 lookup is used.</P
658 ></DIV
659 ><DIV
660 CLASS="SECT2"
661 ><H2
662 CLASS="SECT2"
663 ><A
664 NAME="AEN341"
665 ></A
666 >2.3.5. WINS Lookup</H2
667 ><P
668 >A WINS (Windows Internet Name Server) service is the equivaent of the 
669 rfc1001/1002 specified NBNS (NetBIOS Name Server). A WINS server stores 
670 the names and IP addresses that are registered by a Windows client 
671 if the TCP/IP setup has been given at least one WINS Server IP Address.</P
672 ><P
673 >To configure Samba to be a WINS server the following parameter needs 
674 to be added to the <TT
675 CLASS="FILENAME"
676 >smb.conf</TT
677 > file:</P
678 ><P
679 ><PRE
680 CLASS="PROGRAMLISTING"
681 >       wins support = Yes</PRE
682 ></P
683 ><P
684 >To configure Samba to use a WINS server the following parameters are 
685 needed in the smb.conf file:</P
686 ><P
687 ><PRE
688 CLASS="PROGRAMLISTING"
689 >       wins support = No
690         wins server = xxx.xxx.xxx.xxx</PRE
691 ></P
692 ><P
693 >where <TT
694 CLASS="REPLACEABLE"
695 ><I
696 >xxx.xxx.xxx.xxx</I
697 ></TT
698 > is the IP address 
699 of the WINS server.</P
700 ></DIV
701 ></DIV
702 ><DIV
703 CLASS="SECT1"
704 ><H1
705 CLASS="SECT1"
706 ><A
707 NAME="AEN353"
708 ></A
709 >2.4. How browsing functions and how to deploy stable and 
710 dependable browsing using Samba</H1
711 ><P
712 >As stated above, MS Windows machines register their NetBIOS names 
713 (i.e.: the machine name for each service type in operation) on start 
714 up. Also, as stated above, the exact method by which this name registration 
715 takes place is determined by whether or not the MS Windows client/server 
716 has been given a WINS server address, whether or not LMHOSTS lookup 
717 is enabled, or if DNS for NetBIOS name resolution is enabled, etc.</P
718 ><P
719 >In the case where there is no WINS server all name registrations as 
720 well as name lookups are done by UDP broadcast. This isolates name 
721 resolution to the local subnet, unless LMHOSTS is used to list all 
722 names and IP addresses. In such situations Samba provides a means by 
723 which the samba server name may be forcibly injected into the browse 
724 list of a remote MS Windows network (using the "remote announce" parameter).</P
725 ><P
726 >Where a WINS server is used, the MS Windows client will use UDP 
727 unicast to register with the WINS server. Such packets can be routed 
728 and thus WINS allows name resolution to function across routed networks.</P
729 ><P
730 >During the startup process an election will take place to create a 
731 local master browser if one does not already exist. On each NetBIOS network 
732 one machine will be elected to function as the domain master browser. This 
733 domain browsing has nothing to do with MS security domain control. 
734 Instead, the domain master browser serves the role of contacting each local 
735 master browser (found by asking WINS or from LMHOSTS) and exchanging browse 
736 list contents. This way every master browser will eventually obtain a complete 
737 list of all machines that are on the network. Every 11-15 minutes an election 
738 is held to determine which machine will be the master browser. By the nature of 
739 the election criteria used, the machine with the highest uptime, or the 
740 most senior protocol version, or other criteria, will win the election 
741 as domain master browser.</P
742 ><P
743 >Clients wishing to browse the network make use of this list, but also depend 
744 on the availability of correct name resolution to the respective IP 
745 address/addresses. </P
746 ><P
747 >Any configuration that breaks name resolution and/or browsing intrinsics 
748 will annoy users because they will have to put up with protracted 
749 inability to use the network services.</P
750 ><P
751 >Samba supports a feature that allows forced synchonisation 
752 of browse lists across routed networks using the "remote 
753 browse sync" parameter in the smb.conf file. This causes Samba 
754 to contact the local master browser on a remote network and 
755 to request browse list synchronisation. This effectively bridges 
756 two networks that are separated by routers. The two remote 
757 networks may use either broadcast based name resolution or WINS 
758 based name resolution, but it should be noted that the "remote 
759 browse sync" parameter provides browse list synchronisation - and 
760 that is distinct from name to address resolution, in other 
761 words, for cross subnet browsing to function correctly it is 
762 essential that a name to address resolution mechanism be provided. 
763 This mechanism could be via DNS, <TT
764 CLASS="FILENAME"
765 >/etc/hosts</TT
766 >, 
767 and so on.</P
768 ></DIV
769 ><DIV
770 CLASS="SECT1"
771 ><H1
772 CLASS="SECT1"
773 ><A
774 NAME="AEN363"
775 ></A
776 >2.5. MS Windows security options and how to configure 
777 Samba for seemless integration</H1
778 ><P
779 >MS Windows clients may use encrypted passwords as part of a 
780 challenege/response authentication model (a.k.a. NTLMv1) or 
781 alone, or clear text strings for simple password based 
782 authentication. It should be realized that with the SMB 
783 protocol the password is passed over the network either 
784 in plain text or encrypted, but not both in the same 
785 authentication requets.</P
786 ><P
787 >When encrypted passwords are used a password that has been 
788 entered by the user is encrypted in two ways:</P
789 ><P
790 ></P
791 ><UL
792 ><LI
793 ><P
794 >An MD4 hash of the UNICODE of the password
795         string.  This is known as the NT hash.
796         </P
797 ></LI
798 ><LI
799 ><P
800 >The password is converted to upper case,
801         and then padded or trucated to 14 bytes.  This string is 
802         then appended with 5 bytes of NULL characters and split to
803         form two 56 bit DES keys to encrypt a "magic" 8 byte value.
804         The resulting 16 bytes for the LanMan hash.
805         </P
806 ></LI
807 ></UL
808 ><P
809 >You should refer to the <A
810 HREF="ENCRYPTION.html"
811 TARGET="_top"
812 >Password Encryption</A
813 > chapter in this HOWTO collection
814 for more details on the inner workings</P
815 ><P
816 >MS Windows 95 pre-service pack 1, MS Windows NT versions 3.x 
817 and version 4.0 pre-service pack 3 will use either mode of 
818 password authentication. All versions of MS Windows that follow 
819 these versions no longer support plain text passwords by default.</P
820 ><P
821 >MS Windows clients have a habit of dropping network mappings that 
822 have been idle for 10 minutes or longer. When the user attempts to 
823 use the mapped drive connection that has been dropped, the client
824 re-establishes the connection using 
825 a cached copy of the password.</P
826 ><P
827 >When Microsoft changed the default password mode, they dropped support for 
828 caching of the plain text password. This means that when the registry 
829 parameter is changed to re-enable use of plain text passwords it appears to 
830 work, but when a dropped mapping attempts to revalidate it will fail if 
831 the remote authentication server does not support encrypted passwords. 
832 This means that it is definitely not a good idea to re-enable plain text 
833 password support in such clients.</P
834 ><P
835 >The following parameters can be used to work around the 
836 issue of Windows 9x client upper casing usernames and
837 password before transmitting them to the SMB server
838 when using clear text authentication.</P
839 ><P
840 ><PRE
841 CLASS="PROGRAMLISTING"
842 >       <A
843 HREF="smb.conf.5.html#PASSWORDLEVEL"
844 TARGET="_top"
845 >passsword level</A
846 > = <TT
847 CLASS="REPLACEABLE"
848 ><I
849 >integer</I
850 ></TT
851 >
852         <A
853 HREF="smb.conf.5.html#USERNAMELEVEL"
854 TARGET="_top"
855 >username level</A
856 > = <TT
857 CLASS="REPLACEABLE"
858 ><I
859 >integer</I
860 ></TT
861 ></PRE
862 ></P
863 ><P
864 >By default Samba will lower case the username before attempting
865 to lookup the user in the database of local system accounts.
866 Because UNIX usernames conventionally only contain lower case
867 character, the <TT
868 CLASS="PARAMETER"
869 ><I
870 >username level</I
871 ></TT
872 > parameter
873 is rarely even needed.</P
874 ><P
875 >However, password on UNIX systems often make use of mixed case
876 characters.  This means that in order for a user on a Windows 9x
877 client to connect to a Samba server using clear text authentication,
878 the <TT
879 CLASS="PARAMETER"
880 ><I
881 >password level</I
882 ></TT
883 > must be set to the maximum
884 number of upper case letter which <SPAN
885 CLASS="emphasis"
886 ><I
887 CLASS="EMPHASIS"
888 >could</I
889 ></SPAN
890 > appear
891 is a password.  Note that is the server OS uses the traditional
892 DES version of crypt(), then a <TT
893 CLASS="PARAMETER"
894 ><I
895 >password level</I
896 ></TT
897 >
898 of 8 will result in case insensitive passwords as seen from Windows
899 users.  This will also result in longer login times as Samba
900 hash to compute the permutations of the password string and 
901 try them one by one until a match is located (or all combinations fail).</P
902 ><P
903 >The best option to adopt is to enable support for encrypted passwords 
904 where ever Samba is used. There are three configuration possibilities 
905 for support of encrypted passwords:</P
906 ><DIV
907 CLASS="SECT2"
908 ><H2
909 CLASS="SECT2"
910 ><A
911 NAME="AEN391"
912 ></A
913 >2.5.1. Use MS Windows NT as an authentication server</H2
914 ><P
915 >This method involves the additions of the following parameters 
916 in the smb.conf file:</P
917 ><P
918 ><PRE
919 CLASS="PROGRAMLISTING"
920 >       encrypt passwords = Yes
921         security = server
922         password server = "NetBIOS_name_of_PDC"</PRE
923 ></P
924 ><P
925 >There are two ways of identifying whether or not a username and 
926 password pair was valid or not. One uses the reply information provided 
927 as part of the authentication messaging process, the other uses 
928 just and error code.</P
929 ><P
930 >The down-side of this mode of configuration is the fact that 
931 for security reasons Samba will send the password server a bogus 
932 username and a bogus password and if the remote server fails to 
933 reject the username and password pair then an alternative mode 
934 of identification of validation is used. Where a site uses password 
935 lock out after a certain number of failed authentication attempts 
936 this will result in user lockouts.</P
937 ><P
938 >Use of this mode of authentication does require there to be 
939 a standard Unix account for the user, this account can be blocked 
940 to prevent logons by other than MS Windows clients.</P
941 ></DIV
942 ><DIV
943 CLASS="SECT2"
944 ><H2
945 CLASS="SECT2"
946 ><A
947 NAME="AEN399"
948 ></A
949 >2.5.2. Make Samba a member of an MS Windows NT security domain</H2
950 ><P
951 >This method involves additon of the following paramters in the smb.conf file:</P
952 ><P
953 ><PRE
954 CLASS="PROGRAMLISTING"
955 >       encrypt passwords = Yes
956         security = domain
957         workgroup = "name of NT domain"
958         password server = *</PRE
959 ></P
960 ><P
961 >The use of the "*" argument to "password server" will cause samba 
962 to locate the domain controller in a way analogous to the way 
963 this is done within MS Windows NT.</P
964 ><P
965 >In order for this method to work the Samba server needs to join the 
966 MS Windows NT security domain. This is done as follows:</P
967 ><P
968 ></P
969 ><UL
970 ><LI
971 ><P
972 >On the MS Windows NT domain controller using 
973         the Server Manager add a machine account for the Samba server.
974         </P
975 ></LI
976 ><LI
977 ><P
978 >Next, on the Linux system execute: 
979         <B
980 CLASS="COMMAND"
981 >smbpasswd -r PDC_NAME -j DOMAIN_NAME</B
982 >
983         </P
984 ></LI
985 ></UL
986 ><P
987 >Use of this mode of authentication does require there to be 
988 a standard Unix account for the user in order to assign
989 a uid once the account has been authenticated by the remote
990 Windows DC.  This account can be blocked to prevent logons by 
991 other than MS Windows clients by things such as setting an invalid
992 shell in the <TT
993 CLASS="FILENAME"
994 >/etc/passwd</TT
995 > entry.</P
996 ><P
997 >An alternative to assigning UIDs to Windows users on a 
998 Samba member server is presented in the <A
999 HREF="winbind.html"
1000 TARGET="_top"
1001 >Winbind Overview</A
1002 > chapter in
1003 this HOWTO collection.</P
1004 ></DIV
1005 ><DIV
1006 CLASS="SECT2"
1007 ><H2
1008 CLASS="SECT2"
1009 ><A
1010 NAME="AEN416"
1011 ></A
1012 >2.5.3. Configure Samba as an authentication server</H2
1013 ><P
1014 >This mode of authentication demands that there be on the 
1015 Unix/Linux system both a Unix style account as well as an 
1016 smbpasswd entry for the user. The Unix system account can be 
1017 locked if required as only the encrypted password will be 
1018 used for SMB client authentication.</P
1019 ><P
1020 >This method involves addition of the following parameters to 
1021 the smb.conf file:</P
1022 ><P
1023 ><PRE
1024 CLASS="PROGRAMLISTING"
1025 >## please refer to the Samba PDC HOWTO chapter later in 
1026 ## this collection for more details
1027 [global]
1028         encrypt passwords = Yes
1029         security = user
1030         domain logons = Yes
1031         ; an OS level of 33 or more is recommended
1032         os level = 33
1033
1034 [NETLOGON]
1035         path = /somewhare/in/file/system
1036         read only = yes</PRE
1037 ></P
1038 ><P
1039 >in order for this method to work a Unix system account needs 
1040 to be created for each user, as well as for each MS Windows NT/2000 
1041 machine. The following structure is required.</P
1042 ><DIV
1043 CLASS="SECT3"
1044 ><H3
1045 CLASS="SECT3"
1046 ><A
1047 NAME="AEN423"
1048 ></A
1049 >2.5.3.1. Users</H3
1050 ><P
1051 >A user account that may provide a home directory should be 
1052 created. The following Linux system commands are typical of 
1053 the procedure for creating an account.</P
1054 ><P
1055 ><PRE
1056 CLASS="PROGRAMLISTING"
1057 >       # useradd -s /bin/bash -d /home/"userid" -m "userid"
1058         # passwd "userid"
1059           Enter Password: &lt;pw&gt;
1060           
1061         # smbpasswd -a "userid"
1062           Enter Password: &lt;pw&gt;</PRE
1063 ></P
1064 ></DIV
1065 ><DIV
1066 CLASS="SECT3"
1067 ><H3
1068 CLASS="SECT3"
1069 ><A
1070 NAME="AEN428"
1071 ></A
1072 >2.5.3.2. MS Windows NT Machine Accounts</H3
1073 ><P
1074 >These are required only when Samba is used as a domain 
1075 controller.  Refer to the Samba-PDC-HOWTO for more details.</P
1076 ><P
1077 ><PRE
1078 CLASS="PROGRAMLISTING"
1079 >       # useradd -s /bin/false -d /dev/null "machine_name"\$
1080         # passwd -l "machine_name"\$
1081         # smbpasswd -a -m "machine_name"</PRE
1082 ></P
1083 ></DIV
1084 ></DIV
1085 ></DIV
1086 ><DIV
1087 CLASS="SECT1"
1088 ><H1
1089 CLASS="SECT1"
1090 ><A
1091 NAME="AEN433"
1092 ></A
1093 >2.6. Conclusions</H1
1094 ><P
1095 >Samba provides a flexible means to operate as...</P
1096 ><P
1097 ></P
1098 ><UL
1099 ><LI
1100 ><P
1101 >A Stand-alone server - No special action is needed 
1102         other than to create user accounts. Stand-alone servers do NOT 
1103         provide network logon services, meaning that machines that use this 
1104         server do NOT perform a domain logon but instead make use only of 
1105         the MS Windows logon which is local to the MS Windows 
1106         workstation/server.
1107         </P
1108 ></LI
1109 ><LI
1110 ><P
1111 >An MS Windows NT 3.x/4.0 security domain member.
1112         </P
1113 ></LI
1114 ><LI
1115 ><P
1116 >An alternative to an MS Windows NT 3.x/4.0 
1117         Domain Controller.
1118         </P
1119 ></LI
1120 ></UL
1121 ></DIV
1122 ></DIV
1123 ><DIV
1124 CLASS="NAVFOOTER"
1125 ><HR
1126 ALIGN="LEFT"
1127 WIDTH="100%"><TABLE
1128 SUMMARY="Footer navigation table"
1129 WIDTH="100%"
1130 BORDER="0"
1131 CELLPADDING="0"
1132 CELLSPACING="0"
1133 ><TR
1134 ><TD
1135 WIDTH="33%"
1136 ALIGN="left"
1137 VALIGN="top"
1138 ><A
1139 HREF="install.html"
1140 ACCESSKEY="P"
1141 >Prev</A
1142 ></TD
1143 ><TD
1144 WIDTH="34%"
1145 ALIGN="center"
1146 VALIGN="top"
1147 ><A
1148 HREF="samba-howto-collection.html"
1149 ACCESSKEY="H"
1150 >Home</A
1151 ></TD
1152 ><TD
1153 WIDTH="33%"
1154 ALIGN="right"
1155 VALIGN="top"
1156 ><A
1157 HREF="pam.html"
1158 ACCESSKEY="N"
1159 >Next</A
1160 ></TD
1161 ></TR
1162 ><TR
1163 ><TD
1164 WIDTH="33%"
1165 ALIGN="left"
1166 VALIGN="top"
1167 >How to Install and Test SAMBA</TD
1168 ><TD
1169 WIDTH="34%"
1170 ALIGN="center"
1171 VALIGN="top"
1172 >&nbsp;</TD
1173 ><TD
1174 WIDTH="33%"
1175 ALIGN="right"
1176 VALIGN="top"
1177 >Configuring PAM for distributed but centrally 
1178 managed authentication</TD
1179 ></TR
1180 ></TABLE
1181 ></DIV
1182 ></BODY
1183 ></HTML
1184 >