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">
3 <chapter id="unixclients">
4 <title>Adding Domain Member Servers and Clients</title>
7 <primary>Open Magazine</primary>
8 </indexterm><indexterm>
9 <primary>survey</primary>
11 The most frequently discussed Samba subjects over the past 2 years have focused around domain control and printing.
12 It is well known that Samba is a file and print server. A recent survey conducted by <emphasis>Open Magazine</emphasis> found
13 that of all respondents, 97 percent use Samba for file and print services, and 68 percent use Samba for Domain Control. See the
14 <ulink url="http://www.open-mag.com/cgi-bin/opencgi/surveys/survey.cgi?survey_name=samba">Open-Mag</ulink>
15 Web site for current information. The survey results as found on January 14, 2004, are shown in
16 <link linkend="ch09openmag"/>.
19 <figure id="ch09openmag">
20 <title>Open Magazine Samba Survey</title>
21 <imagefile scale="60">openmag</imagefile>
25 While domain control is an exciting subject, basic file and print sharing remains the staple bread-and-butter
26 function that Samba provides. Yet this book may give the appearance of having focused too much on more
27 exciting aspects of Samba deployment. This chapter directs your attention to provide important information on
28 the addition of Samba servers into your present Windows network &smbmdash; whatever the controlling technology
29 may be. So let's get back to our good friends at Abmas.
33 <title>Introduction</title>
36 <primary>Linux desktop</primary>
37 </indexterm><indexterm>
38 <primary>Domain Member</primary>
39 <secondary>server</secondary>
41 Looking back over the achievements of the past year or two, daily events at Abmas are rather straightforward
42 with not too many distractions or problems. Your team is doing well, but a number of employees
43 are asking for Linux desktop systems. Your network has grown and demands additional domain member servers. Let's
44 get on with this; Christine and Stan are ready to go.
48 <primary>Domain Member</primary>
49 <secondary>desktop</secondary>
51 Stan is firmly in control of the department of the future, while Christine is enjoying a stable and
52 predictable network environment. It is time to add more servers and to add Linux desktops. It is
53 time to meet the demands of future growth and endure trial by fire.
57 <title>Assignment Tasks</title>
60 <primary>Active Directory</primary>
62 You must now add UNIX/Linux domain member servers to your network. You have a friend who has a Windows 2003
63 Active Directory domain network who wants to add a Samba/Linux server and has asked Christine to help him
64 out. Your real objective is to help Christine to see more of the way the Microsoft world lives and use
65 her help to get validation that Samba really does live up to expectations.
69 Over the past 6 months, you have hired several new staff who want Linux on their desktops. You must integrate
70 these systems to make sure that Abmas is not building islands of technology. You ask Christine to
71 do likewise at Swodniw Biz NL (your friend's company) to help them to evaluate a Linux desktop. You want to make
72 the right decision, don't you?
79 <title>Dissection and Discussion</title>
82 <indexterm><primary>winbind</primary></indexterm>
83 Recent Samba mailing-list activity is witness to how many sites are using winbind. Some have no trouble
84 at all with it, yet to others the problems seem insurmountable. Periodically there are complaints concerning
85 an inability to achieve identical user and group IDs between Windows and UNIX environments.
89 You provide step-by-step implementations of the various tools that can be used for identity
90 resolution. You also provide working examples of solutions for integrated authentication for
91 both UNIX/Linux and Windows environments.
95 <title>Technical Issues</title>
98 One of the great challenges we face when people ask us, <quote>What is the best way to solve
99 this problem?</quote> is to get beyond the facts so we not only can clearly comprehend
100 the immediate technical problem, but also can understand how needs may change.
104 <indexterm><primary>integrate</primary></indexterm>
105 There are a few facts we should note when dealing with the question of how best to
106 integrate UNIX/Linux clients and servers into a Windows networking environment:
111 <indexterm><primary>Domain Controller</primary></indexterm>
112 <indexterm><primary>authoritative</primary></indexterm>
113 <indexterm><primary>accounts</primary><secondary>authoritative</secondary></indexterm>
114 <indexterm><primary>PDC</primary></indexterm>
115 <indexterm><primary>BDC</primary></indexterm>
116 A domain controller (PDC or BDC) is always authoritative for all accounts in its domain.
117 This means that a BDC must (of necessity) be able to resolve all account UIDs and GIDs
118 to the same values that the PDC resolved them to.
122 <indexterm><primary>local accounts</primary></indexterm>
123 <indexterm><primary>Domain Member</primary><secondary>authoritative</secondary><tertiary>local accounts</tertiary></indexterm>
124 <indexterm><primary>Domain accounts</primary></indexterm>
125 <indexterm><primary>winbindd</primary></indexterm>
126 A domain member can be authoritative for local accounts, but is never authoritative for
127 domain accounts. If a user is accessing a domain member server and that user's account
128 is not known locally, the domain member server must resolve the identity of that user
129 from the domain in which that user's account resides. It must then map that ID to a
130 UID/GID pair that it can use locally. This is handled by <command>winbindd</command>.
134 Samba, when running on a domain member server, can resolve user identities from a
140 <indexterm><primary>getpwnam</primary></indexterm>
141 <indexterm><primary>getgrnam</primary></indexterm>
142 <indexterm><primary>NSS</primary></indexterm>
143 <indexterm><primary>LDAP</primary></indexterm>
144 <indexterm><primary>NIS</primary></indexterm>
145 By executing a system <command>getpwnam()</command> or <command>getgrnam()</command> call.
146 On systems that support it, this utilizes the name service switch (NSS) facility to
147 resolve names according to the configuration of the <filename>/etc/nsswitch.conf</filename>
148 file. NSS can be configured to use LDAP, winbind, NIS, or local files.
152 <indexterm><primary>passdb backend</primary></indexterm>
153 <indexterm><primary>PADL</primary></indexterm>
154 <indexterm><primary>nss_ldap</primary></indexterm>
155 Performing, via NSS, a direct LDAP search (where an LDAP passdb backend has been configured).
156 This requires the use of the PADL nss_ldap tool (or equivalent).
160 <indexterm><primary>winbindd</primary></indexterm>
161 <indexterm><primary>SID</primary></indexterm>
162 <indexterm><primary>winbindd_idmap.tdb</primary></indexterm>
163 <indexterm><primary>winbindd_cache.tdb</primary></indexterm>
164 Directly by querying <command>winbindd</command>. The <command>winbindd</command>
165 contacts a domain controller to attempt to resolve the identity of the user or group. It
166 receives the Windows networking security identifier (SID) for that appropriate
167 account and then allocates a local UID or GID from the range of available IDs and
168 creates an entry in its <filename>winbindd_idmap.tdb</filename> and
169 <filename>winbindd_cache.tdb</filename> files.
173 <indexterm><primary>idmap backend</primary></indexterm>
174 <indexterm><primary>mapping</primary></indexterm>
175 If the parameter <smbconfoption name="idmap backend">ldap:ldap://myserver.domain</smbconfoption>
176 was specified and the LDAP server has been configured with a container in which it may
177 store the IDMAP entries, all domain members may share a common mapping.
182 Irrespective of how &smb.conf; is configured, winbind creates and caches a local copy of
183 the ID mapping database. It uses the <filename>winbindd_idmap.tdb</filename> and
184 <filename>winbindd_cache.tdb</filename> files to do this.
188 Which of the resolver methods is chosen is determined by the way that Samba is configured
189 in the &smb.conf; file. Some of the configuration options are rather less than obvious to the
194 <indexterm><primary>winbind trusted domains only</primary></indexterm>
195 <indexterm><primary>domain member</primary><secondary>servers</secondary></indexterm>
196 <indexterm><primary>domain controllers</primary></indexterm>
197 If you wish to make use of accounts (users and/or groups) that are local to (i.e., capable
198 of being resolved using) the NSS facility, it is possible to use the
199 <smbconfoption name="winbind trusted domains only">Yes</smbconfoption>
200 in the &smb.conf; file. This parameter specifically applies to domain controllers,
201 and to domain member servers.
207 <indexterm><primary>Posix accounts</primary></indexterm>
208 <indexterm><primary>Samba accounts</primary></indexterm>
209 <indexterm><primary>LDAP</primary></indexterm>
210 For many administrators, it should be plain that the use of an LDAP-based repository for all network
211 accounts (both for POSIX accounts and for Samba accounts) provides the most elegant and
212 controllable facility. You eventually appreciate the decision to use LDAP.
216 <indexterm><primary>nss_ldap</primary></indexterm>
217 <indexterm><primary>identifiers</primary></indexterm>
218 <indexterm><primary>resolve</primary></indexterm>
219 If your network account information resides in an LDAP repository, you should use it ahead of any
220 alternative method. This means that if it is humanly possible to use the <command>nss_ldap</command>
221 tools to resolve UNIX account UIDs/GIDs via LDAP, this is the preferred solution, because it provides
222 a more readily controllable method for asserting the exact same user and group identifiers
223 throughout the network.
227 <indexterm><primary>Domain Member</primary><secondary>server</secondary></indexterm>
228 <indexterm><primary>winbind trusted domains only</primary></indexterm>
229 <indexterm><primary>getpwnam</primary></indexterm>
230 <indexterm><primary>smbd</primary></indexterm>
231 <indexterm><primary>Trusted Domains</primary></indexterm>
232 <indexterm><primary>External Domains</primary></indexterm>
233 In the situation where UNIX accounts are held on the domain member server itself, the only effective
234 way to use them involves the &smb.conf; entry
235 <smbconfoption name="winbind trusted domains only">Yes</smbconfoption>. This forces
236 Samba (<command>smbd</command>) to perform a <command>getpwnam()</command> system call that can
237 then be controlled via <filename>/etc/nsswitch.conf</filename> file settings. The use of this parameter
238 disables the use of Samba with trusted domains (i.e., external domains).
242 <indexterm><primary>appliance mode</primary></indexterm>
243 <indexterm><primary>Domain Member</primary><secondary>server</secondary></indexterm>
244 <indexterm><primary>winbindd</primary></indexterm>
245 <indexterm><primary>automatically allocate</primary></indexterm>
246 Winbind can be used to create an appliance mode domain member server. In this capacity, <command>winbindd</command>
247 is configured to automatically allocate UIDs/GIDs from numeric ranges set in the &smb.conf; file. The allocation
248 is made for all accounts that connect to that domain member server, whether within its own domain or from
249 trusted domains. If not stored in an LDAP backend, each domain member maintains its own unique mapping database.
250 This means that it is almost certain that a given user who accesses two domain member servers does not have the
251 same UID/GID on both servers &smbmdash; however, this is transparent to the Windows network user. This data
252 is stored in the <filename>winbindd_idmap.tdb</filename> and <filename>winbindd_cache.tdb</filename> files.
256 <indexterm><primary>mapping</primary></indexterm>
257 The use of an LDAP backend for the Winbind IDMAP facility permits Windows domain SIDs
258 mappings to UIDs/GIDs to be stored centrally. The result is a consistent mapping across all domain member
259 servers so configured. This solves one of the major headaches for network administrators who need to copy
260 files between or across network file servers.
266 <title>Political Issues</title>
269 <indexterm><primary>OpenLDAP</primary></indexterm>
270 <indexterm><primary>NIS</primary></indexterm>
271 <indexterm><primary>yellow pages</primary><see>NIS</see></indexterm>
272 <indexterm><primary>identity management</primary></indexterm>
273 One of the most fierce conflicts recently being waged is resistance to the adoption of LDAP, in
274 particular OpenLDAP, as a replacement for UNIX NIS (previously called Yellow Pages). Let's face it, LDAP
275 is different and requires a new approach to the need for a better identity management solution. The more
276 you work with LDAP, the more its power and flexibility emerges from its dark, cavernous chasm.
280 LDAP is a most suitable solution for heterogenous environments. If you need crypto, add Kerberos.
281 The reason these are preferable is because they are heterogenous. Windows solutions of this sort are <emphasis>not</emphasis>
282 heterogenous by design. This is fundamental &smbmdash; it isn't religious or political. This also doesn't say that
283 you can't use Windows Active Directory in a heterogenous environment &smbmdash; it can be done, it just requires
284 commercial integration products. But it's not what Active Directory was designed for.
288 <indexterm><primary>directory</primary></indexterm>
289 <indexterm><primary>management</primary></indexterm>
290 A number of long-term UNIX devotees have recently commented in various communications that the Samba Team
291 is the first application group to almost force network administrators to use LDAP. It should be pointed
292 out that we resisted this for as long as we could. It is not out of laziness or malice that LDAP has
293 finally emerged as the preferred identity management backend for Samba. We recommend LDAP for your total
294 organizational directory needs.
302 <title>Implementation</title>
305 <indexterm><primary>Domain Member</primary><secondary>server</secondary></indexterm>
306 <indexterm><primary>Domain Member</primary><secondary>client</secondary></indexterm>
307 <indexterm><primary>Domain Controller</primary></indexterm>
308 The domain member server and the domain member client are at the center of focus in this chapter.
309 Configuration of Samba-3 domain controller is covered in earlier chapters, so if your
310 interest is in domain controller configuration, you will not find that here. You will find good
311 oil that helps you to add domain member servers and clients.
315 <indexterm><primary>Domain Member</primary><secondary>workstations</secondary></indexterm>
316 In practice, domain member servers and domain member workstations are very different entities, but in
317 terms of technology they share similar core infrastructure. A technologist would argue that servers
318 and workstations are identical. Many users would argue otherwise, given that in a well-disciplined
319 environment a workstation (client) is a device from which a user creates documents and files that
320 are located on servers. A workstation is frequently viewed as a disposable (easy to replace) item,
321 but a server is viewed as a core component of the business.
325 <indexterm><primary>workstation</primary></indexterm>
326 We can look at this another way. If a workstation breaks down, one user is affected, but if a
327 server breaks down, hundreds of users may not be able to work. The services that a workstation
328 must provide are document- and file-production oriented; a server provides information storage
329 and is distribution oriented.
333 <indexterm><primary>authentication process</primary></indexterm>
334 <indexterm><primary>logon process</primary></indexterm>
335 <indexterm><primary>user identities</primary></indexterm>
336 <emphasis>Why is this important?</emphasis> For starters, we must identify what
337 components of the operating system and its environment must be configured. Also, it is necessary
338 to recognize where the interdependencies between the various services to be used are.
339 In particular, it is important to understand the operation of each critical part of the
340 authentication process, the logon process, and how user identities get resolved and applied
341 within the operating system and applications (like Samba) that depend on this and may
342 actually contribute to it.
346 So, in this chapter we demonstrate how to implement the technology. It is done within a context of
347 what type of service need must be fulfilled.
350 <sect2 id="sdcsdmldap">
351 <title>Samba Domain with Samba Domain Member Server &smbmdash; Using NSS LDAP</title>
354 <indexterm><primary>ldapsam</primary></indexterm>
355 <indexterm><primary>ldapsam backend</primary></indexterm>
356 <indexterm><primary>IDMAP</primary></indexterm>
357 <indexterm><primary>mapping</primary><secondary>consistent</secondary></indexterm>
358 <indexterm><primary>winbindd</primary></indexterm>
359 <indexterm><primary>foreign SID</primary></indexterm>
360 In this example, it is assumed that you have Samba PDC/BDC servers. This means you are using
361 an LDAP ldapsam backend. We are adding to the LDAP backend database (directory)
362 containers for use by the IDMAP facility. This makes it possible to have globally consistent
363 mapping of SIDs to and from UIDs and GIDs. This means that it is necessary to run
364 <command>winbindd</command> as part of your configuration. The primary purpose of running
365 <command>winbindd</command> (within this operational context) is to permit mapping of foreign
366 SIDs (those not originating from the the local Samba server). Foreign SIDs can come from any
367 domain member client or server, or from Windows clients that do not belong to a domain. Another
368 way to explain the necessity to run <command>winbindd</command> is that Samba can locally
369 resolve only accounts that belong to the security context of its own machine SID. Winbind
370 handles all non-local SIDs and maps them to a local UID/GID value. The UID and GID are allocated
371 from the parameter values set in the &smb.conf; file for the <parameter>idmap uid</parameter> and
372 <parameter>idmap gid</parameter> ranges. Where LDAP is used, the mappings can be stored in LDAP
373 so that all domain member servers can use a consistent mapping.
377 <indexterm><primary>winbindd</primary></indexterm>
378 <indexterm><primary>getpwnam</primary></indexterm>
379 <indexterm><primary>NSS</primary></indexterm>
380 If your installation is accessed only from clients that are members of your own domain, and all
381 user accounts are present in a local passdb backend then it is not necessary to run
382 <command>winbindd</command>. The local passdb backend can be in smbpasswd, tdbsam, or in ldapsam.
386 It is possible to use a local passdb backend with any convenient means of resolving the POSIX
387 user and group account information. The POSIX information is usually obtained using the
388 <command>getpwnam()</command> system call. On NSS-enabled systems, the actual POSIX account
389 source can be provided from
394 <indexterm><primary>/etc/passwd</primary></indexterm>
395 <indexterm><primary>/etc/group</primary></indexterm>
396 Accounts in <filename>/etc/passwd</filename> or in <filename>/etc/group</filename>.
400 <indexterm><primary>NSS</primary></indexterm>
401 <indexterm><primary>compat</primary></indexterm>
402 <indexterm><primary>ldap</primary></indexterm>
403 <indexterm><primary>nis</primary></indexterm>
404 <indexterm><primary>nisplus</primary></indexterm>
405 <indexterm><primary>hesiod</primary></indexterm>
406 <indexterm><primary>ldap</primary></indexterm>
407 <indexterm><primary>nss_ldap</primary></indexterm>
408 <indexterm><primary>PADL Software</primary></indexterm>
409 Resolution via NSS. On NSS-enabled systems, there is usually a facility to resolve IDs
410 via multiple methods. The methods typically include <command>files</command>,
411 <command>compat</command>, <command>db</command>, <command>ldap</command>,
412 <command>nis</command>, <command>nisplus</command>, <command>hesiod.</command> When
413 correctly installed, Samba adds to this list the <command>winbindd</command> facility.
414 The ldap facility is frequently the nss_ldap tool provided by PADL Software.
419 To advoid confusion the use of the term <literal>local passdb backend</literal> means that
420 the user account backend is not shared by any other Samba server &smbmdash; instead, it is
421 used only locally on the Samba domain member server under discussion.
425 <indexterm><primary>Identity resolution</primary></indexterm>
426 The diagram in <link linkend="ch9-sambadc"/> demonstrates the relationship of Samba and system
427 components that are involved in the identity resolution process where Samba is used as a domain
428 member server within a Samba domain control network.
431 <figure id="ch9-sambadc">
432 <title>Samba Domain: Samba Member Server</title>
433 <imagefile scale="60">chap9-SambaDC</imagefile>
437 <indexterm><primary>IDMAP</primary></indexterm>
438 <indexterm><primary>foreign</primary></indexterm>
439 In this example configuration, Samba will directly search the LDAP-based passwd backend ldapsam
440 to obtain authentication and user identity information. The IDMAP information is stored in the LDAP
441 backend so that it can be shared by all domain member servers so that every user will have a
442 consistent UID and GID across all of them. The IDMAP facility will be used for all foreign
443 (i.e., not having the same SID as the domain it is a member of) domains. The configuration of
444 NSS will ensure that all UNIX processes will obtain a consistent UID/GID.
448 The instructions given here apply to the Samba environment shown in <link linkend="happy"/> and <link linkend="2000users"/>.
449 If the network does not have an LDAP slave server (i.e., <link linkend="happy"/> configuration),
450 change the target LDAP server from <constant>lapdc</constant> to <constant>massive.</constant>
454 <title>Configuration of NSS_LDAP-Based Identity Resolution</title>
457 Create the &smb.conf; file as shown in <link linkend="ch9-sdmsdc"/>. Locate
458 this file in the directory <filename>/etc/samba</filename>.
462 <indexterm><primary>ldap.conf</primary></indexterm>
463 Configure the file that will be used by <constant>nss_ldap</constant> to
464 locate and communicate with the LDAP server. This file is called <filename>ldap.conf</filename>.
465 If your implementation of <constant>nss_ldap</constant> is consistent with
466 the defaults suggested by PADL (the authors), it will be located in the
467 <filename>/etc</filename> directory. On some systems, the default location is
468 the <filename>/etc/openldap</filename> directory, however this file is intended
469 for use by the OpenLDAP utilities and should not really be used by the nss_ldap
470 utility since its content and structure serves the specific purpose of enabling
471 the resolution of user and group IDs via NSS.
475 Change the parameters inside the file that is located on your OS so it matches
476 <link linkend="ch9-sdmlcnf"/>. To find the correct location of this file, you
477 can obtain this from the library that will be used by executing the following:
479 &rootprompt; strings /lib/libnss_ldap* | grep ldap.conf
485 Configure the NSS control file so it matches the one shown in
486 <link linkend="ch9-sdmnss"/>.
490 <indexterm><primary>Identity resolution</primary></indexterm>
491 <indexterm><primary>getent</primary></indexterm>
492 Before proceeding to configure Samba, validate the operation of the NSS identity
493 resolution via LDAP by executing:
495 &rootprompt; getent passwd
497 root:x:0:512:Netbios Domain Administrator:/root:/bin/false
498 nobody:x:999:514:nobody:/dev/null:/bin/false
499 bobj:x:1000:513:Robert Jordan:/home/bobj:/bin/bash
500 stans:x:1001:513:Stanley Soroka:/home/stans:/bin/bash
501 chrisr:x:1002:513:Christine Roberson:/home/chrisr:/bin/bash
502 maryv:x:1003:513:Mary Vortexis:/home/maryv:/bin/bash
503 jht:x:1004:513:John H Terpstra:/home/jht:/bin/bash
504 bldg1$:x:1006:553:bldg1$:/dev/null:/bin/false
505 temptation$:x:1009:553:temptation$:/dev/null:/bin/false
506 vaioboss$:x:1005:553:vaioboss$:/dev/null:/bin/false
507 fran$:x:1008:553:fran$:/dev/null:/bin/false
508 josephj:x:1007:513:Joseph James:/home/josephj:/bin/bash
510 You should notice the location of the users' home directories. First, make certain that
511 the home directories exist on the domain member server; otherwise, the home directory
512 share is not available. The home directories could be mounted off a domain controller
513 using NFS or by any other suitable means. Second, the absence of the domain name in the
514 home directory path is indicative that identity resolution is not being done via winbind.
516 &rootprompt; getent group
518 Domain Admins:x:512:root,jht
519 Domain Users:x:513:bobj,stans,chrisr,maryv,jht,josephj
526 <indexterm><primary>secondary group</primary></indexterm>
527 <indexterm><primary>primary group</primary></indexterm>
528 <indexterm><primary>group membership</primary></indexterm>
529 This shows that all is working as it should be. Notice that in the LDAP database
530 the users' primary and secondary group memberships are identical. It is not
531 necessary to add secondary group memberships (in the group database) if the
532 user is already a member via primary group membership in the password database.
533 When using winbind, it is in fact undesirable to do this because it results in
534 doubling up of group memberships and may cause problems with winbind under certain
535 conditions. It is intended that these limitations with winbind will be resolved soon
536 after Samba-3.0.20 has been released.
540 <indexterm><primary>slapcat</primary></indexterm>
541 The LDAP directory must have a container object for IDMAP data. There are several ways you can
542 check that your LDAP database is able to receive IDMAP information. One of the simplest is to
545 &rootprompt; slapcat | grep -i idmap
546 dn: ou=Idmap,dc=abmas,dc=biz
549 <indexterm><primary>ldapadd</primary></indexterm>
550 If the execution of this command does not return IDMAP entries, you need to create an LDIF
551 template file (see <link linkend="ch9-ldifadd"/>). You can add the required entries using
552 the following command:
554 &rootprompt; ldapadd -x -D "cn=Manager,dc=abmas,dc=biz" \
555 -w not24get < /etc/openldap/idmap.LDIF
560 Samba automatically populates the LDAP directory container when it needs to. To permit Samba
561 write access to the LDAP directory it is necessary to set the LDAP administrative password
562 in the <filename>secrets.tdb</filename> file as shown here:
564 &rootprompt; smbpasswd -w not24get
569 <indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
570 <indexterm><primary>Domain join</primary></indexterm>
571 The system is ready to join the domain. Execute the following:
573 &rootprompt; net rpc join -U root%not24get
574 Joined domain MEGANET2.
576 This indicates that the domain join succeeded.
580 Failure to join the domain could be caused by any number of variables. The most common
581 causes of failure to join are:
586 <listitem><para>Broken resolution of NetBIOS names to the respective IP address.</para></listitem>
587 <listitem><para>Incorrect username and password credentials.</para></listitem>
588 <listitem><para>The NT4 <parameter>restrict anonymous</parameter> is set to exclude anonymous
589 connections.</para></listitem>
594 The connection setup can be diagnosed by executing:
596 &rootprompt; net rpc join -S 'pdc-name' -U administrator%password -d 5
598 <indexterm><primary>failed</primary></indexterm>
599 <indexterm><primary>failed join</primary></indexterm>
600 <indexterm><primary>rejected</primary></indexterm>
601 <indexterm><primary>restrict anonymous</primary></indexterm>
602 Note: Use "root" for UNIX/Linux and Samba, use "Administrator" for Windows NT4/200X. If the cause of
603 the failure appears to be related to a rejected or failed NT_SESSION_SETUP* or an error message that
604 says NT_STATUS_ACCESS_DENIED immediately check the Windows registry setting that controls the
605 <constant>restrict anonymous</constant> setting. Set this to the value 0 so that an anonymous connection
606 can be sustained, then try again.
610 It is possible (perhaps even recommended) to use the following to validate the ability to connect
613 &rootprompt; net rpc info -S 'pdc-name' -U Administrator%not24get
614 Domain Name: MEGANET2
615 Domain SID: S-1-5-21-422319763-4138913805-7168186429
616 Sequence number: 1519909596
618 Num domain groups: 821
621 &rootprompt; net rpc testjoin -S 'pdc-name' -U Administrator%not24get
622 Join to 'MEGANET2' is OK
624 If for any reason the following response is obtained to the last command above,it is time to
625 call in the Networking Super-Snooper task force (i.e., start debugging):
627 NT_STATUS_ACCESS_DENIED
628 Join to 'MEGANET2' failed.
633 <indexterm><primary>wbinfo</primary></indexterm>
634 Just joining the domain is not quite enough; you must now provide a privileged set
635 of credentials through which <command>winbindd</command> can interact with the
636 domain servers. Execute the following to implant the necessary credentials:
638 &rootprompt; wbinfo --set-auth-user=Administrator%not24get
640 The configuration is now ready to obtain the Samba domain user and group information.
644 You may now start Samba in the usual manner, and your Samba domain member server
645 is ready for use. Just add shares as required.
650 <example id="ch9-sdmsdc">
651 <title>Samba Domain Member in Samba Domain Using LDAP &smbmdash; &smb.conf; File</title>
653 <smbconfcomment>Global parameters</smbconfcomment>
654 <smbconfsection name="[global]"/>
655 <smbconfoption name="unix charset">LOCALE</smbconfoption>
656 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
657 <smbconfoption name="security">DOMAIN</smbconfoption>
658 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
659 <smbconfoption name="log level">10</smbconfoption>
660 <smbconfoption name="syslog">0</smbconfoption>
661 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
662 <smbconfoption name="max log size">50</smbconfoption>
663 <smbconfoption name="smb ports">139</smbconfoption>
664 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
665 <smbconfoption name="printcap name">CUPS</smbconfoption>
666 <smbconfoption name="wins server">192.168.2.1</smbconfoption>
667 <smbconfoption name="ldap suffix">dc=abmas,dc=biz</smbconfoption>
668 <smbconfoption name="ldap machine suffix">ou=People</smbconfoption>
669 <smbconfoption name="ldap user suffix">ou=People</smbconfoption>
670 <smbconfoption name="ldap group suffix">ou=Groups</smbconfoption>
671 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
672 <smbconfoption name="ldap admin dn">cn=Manager,dc=abmas,dc=biz</smbconfoption>
673 <smbconfoption name="idmap backend">ldap:ldap://lapdc.abmas.biz</smbconfoption>
674 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
675 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
676 <smbconfoption name="winbind trusted domains only">Yes</smbconfoption>
677 <smbconfoption name="printer admin">root</smbconfoption>
678 <smbconfoption name="printing">cups</smbconfoption>
680 <smbconfsection name="[homes]"/>
681 <smbconfoption name="comment">Home Directories</smbconfoption>
682 <smbconfoption name="valid users">%S</smbconfoption>
683 <smbconfoption name="read only">No</smbconfoption>
684 <smbconfoption name="browseable">No</smbconfoption>
686 <smbconfsection name="[printers]"/>
687 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
688 <smbconfoption name="path">/var/spool/samba</smbconfoption>
689 <smbconfoption name="guest ok">Yes</smbconfoption>
690 <smbconfoption name="printable">Yes</smbconfoption>
691 <smbconfoption name="browseable">No</smbconfoption>
693 <smbconfsection name="[print$]"/>
694 <smbconfoption name="comment">Printer Drivers</smbconfoption>
695 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
696 <smbconfoption name="admin users">root, Administrator</smbconfoption>
697 <smbconfoption name="write list">root</smbconfoption>
701 <example id="ch9-ldifadd">
702 <title>LDIF IDMAP Add-On Load File &smbmdash; File: /etc/openldap/idmap.LDIF</title>
704 dn: ou=Idmap,dc=abmas,dc=biz
705 objectClass: organizationalUnit
707 structuralObjectClass: organizationalUnit
711 <example id="ch9-sdmlcnf">
712 <title>Configuration File for NSS LDAP Support &smbmdash; <filename>/etc/ldap.conf</filename></title>
714 URI ldap://massive.abmas.biz ldap://massive.abmas.biz:636
717 binddn cn=Manager,dc=abmas,dc=biz
722 nss_base_passwd ou=People,dc=abmas,dc=biz?one
723 nss_base_shadow ou=People,dc=abmas,dc=biz?one
724 nss_base_group ou=Groups,dc=abmas,dc=biz?one
729 <example id="ch9-sdmnss">
730 <title>NSS using LDAP for Identity Resolution &smbmdash; File: <filename>/etc/nsswitch.conf</filename></title>
736 hosts: files dns wins
756 <title>NT4/Samba Domain with Samba Domain Member Server: Using NSS and Winbind</title>
759 You need to use this method for creating a Samba domain member server if any of the following conditions
765 LDAP support (client) is not installed on the system.
769 There are mitigating circumstances forcing a decision not to use LDAP.
773 The Samba domain member server must be part of a Windows NT4 Domain, or a Samba Domain.
778 <indexterm><primary>Windows ADS Domain</primary></indexterm>
779 <indexterm><primary>Samba Domain</primary></indexterm>
780 <indexterm><primary>LDAP</primary></indexterm>
781 Later in the chapter, you can see how to configure a Samba domain member server for a Windows ADS domain.
782 Right now your objective is to configure a Samba server that can be a member of a Windows NT4-style
783 domain and/or does not use LDAP.
787 <indexterm><primary>duplicate accounts</primary></indexterm>
788 If you use <command>winbind</command> for identity resolution, make sure that there are no
793 <indexterm><primary>/etc/passwd</primary></indexterm>
794 For example, do not have more than one account that has UID=0 in the password database. If there
795 is an account called <constant>root</constant> in the <filename>/etc/passwd</filename> database,
796 it is okay to have an account called <constant>root</constant> in the LDAP ldapsam or in the
797 tdbsam. But if there are two accounts in the passdb backend that have the same UID, winbind will
798 break. This means that the <constant>Administrator</constant> account must be called
799 <constant>root</constant>.
803 <indexterm><primary>/etc/passwd</primary></indexterm>
804 <indexterm><primary>ldapsam</primary></indexterm>
805 <indexterm><primary>tdbsam</primary></indexterm>
806 Winbind will break if there is an account in <filename>/etc/passwd</filename> that has
807 the same UID as an account that is in LDAP ldapsam (or in tdbsam) but that differs in name only.
811 <indexterm><primary>credentials</primary></indexterm>
812 <indexterm><primary>traverse</primary></indexterm>
813 <indexterm><primary>wide-area</primary></indexterm>
814 <indexterm><primary>network</primary><secondary>wide-area</secondary></indexterm>
815 <indexterm><primary>tdbdump</primary></indexterm>
816 The following configuration uses CIFS/SMB protocols alone to obtain user and group credentials.
817 The winbind information is locally cached in the <filename>winbindd_cache.tdb winbindd_idmap.tdb</filename>
818 files. This provides considerable performance benefits compared with the LDAP solution, particularly
819 where the LDAP lookups must traverse WAN links. You may examine the contents of these
820 files using the tool <command>tdbdump</command>, though you may have to build this from the Samba
821 source code if it has not been supplied as part of a binary package distribution that you may be using.
825 <title>Configuration of Winbind-Based Identity Resolution</title>
828 Using your favorite text editor, create the &smb.conf; file so it has the contents
829 shown in <link linkend="ch0-NT4DSDM"/>.
833 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
834 Edit the <filename>/etc/nsswitch.conf</filename> so it has the entries shown in
835 <link linkend="ch9-sdmnss"/>.
839 <indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
840 The system is ready to join the domain. Execute the following:
842 net rpc join -U root%not2g4et
843 Joined domain MEGANET2.
845 This indicates that the domain join succeed.
850 <indexterm><primary>winbind</primary></indexterm>
851 <indexterm><primary>wbinfo</primary></indexterm>
852 Validate operation of <command>winbind</command> using the <command>wbinfo</command>
855 &rootprompt; wbinfo -u
866 This shows that domain users have been listed correctly.
868 &rootprompt; wbinfo -g
869 MEGANET2+Domain Admins
870 MEGANET2+Domain Users
871 MEGANET2+Domain Guests
876 This shows that domain groups have been correctly obtained also.
880 <indexterm><primary>NSS</primary></indexterm>
881 <indexterm><primary>getent</primary></indexterm>
882 <indexterm><primary>winbind</primary></indexterm>
883 The next step verifies that NSS is able to obtain this information
884 correctly from <command>winbind</command> also.
886 &rootprompt; getent passwd
888 MEGANET2+root:x:10000:10001:NetBIOS Domain Admin:
889 /home/MEGANET2/root:/bin/bash
890 MEGANET2+nobody:x:10001:10001:nobody:
891 /home/MEGANET2/nobody:/bin/bash
892 MEGANET2+jht:x:10002:10001:John H Terpstra:
893 /home/MEGANET2/jht:/bin/bash
894 MEGANET2+maryv:x:10003:10001:Mary Vortexis:
895 /home/MEGANET2/maryv:/bin/bash
896 MEGANET2+billr:x:10004:10001:William Randalph:
897 /home/MEGANET2/billr:/bin/bash
898 MEGANET2+jelliott:x:10005:10001:John G Elliott:
899 /home/MEGANET2/jelliott:/bin/bash
900 MEGANET2+dbrady:x:10006:10001:Darren Brady:
901 /home/MEGANET2/dbrady:/bin/bash
902 MEGANET2+joeg:x:10007:10001:Joe Green:
903 /home/MEGANET2/joeg:/bin/bash
904 MEGANET2+balap:x:10008:10001:Bala Pillay:
905 /home/MEGANET2/balap:/bin/bash
907 The user account information has been correctly obtained. This information has
908 been merged with the winbind template information configured in the &smb.conf; file.
910 &rootprompt;# getent group
912 MEGANET2+Domain Admins:x:10000:MEGANET2+root,MEGANET2+jht
913 MEGANET2+Domain Users:x:10001:MEGANET2+jht,MEGANET2+maryv,\
914 MEGANET2+billr,MEGANET2+jelliott,MEGANET2+dbrady,\
915 MEGANET2+joeg,MEGANET2+balap
916 MEGANET2+Domain Guests:x:10002:MEGANET2+nobody
917 MEGANET2+Accounts:x:10003:
918 MEGANET2+Finances:x:10004:
919 MEGANET2+PIOps:x:10005:
924 The Samba member server of a Windows NT4 domain is ready for use.
929 <example id="ch0-NT4DSDM">
930 <title>Samba Domain Member Server Using Winbind &smb.conf; File for NT4 Domain</title>
932 <smbconfcomment>Global parameters</smbconfcomment>
933 <smbconfsection name="[global]"/>
934 <smbconfoption name="unix charset">LOCALE</smbconfoption>
935 <smbconfoption name="workgroup">MEGANET2</smbconfoption>
936 <smbconfoption name="security">DOMAIN</smbconfoption>
937 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
938 <smbconfoption name="log level">1</smbconfoption>
939 <smbconfoption name="syslog">0</smbconfoption>
940 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
941 <smbconfoption name="max log size">0</smbconfoption>
942 <smbconfoption name="smb ports">139</smbconfoption>
943 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
944 <smbconfoption name="printcap name">CUPS</smbconfoption>
945 <smbconfoption name="wins server">192.168.2.1</smbconfoption>
946 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
947 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
948 <smbconfoption name="template primary group">"Domain Users"</smbconfoption>
949 <smbconfoption name="template shell">/bin/bash</smbconfoption>
950 <smbconfoption name="winbind separator">+</smbconfoption>
951 <smbconfoption name="printer admin">root</smbconfoption>
952 <smbconfoption name="hosts allow">192.168.2., 192.168.3., 127.</smbconfoption>
953 <smbconfoption name="printing">cups</smbconfoption>
955 <smbconfsection name="[homes]"/>
956 <smbconfoption name="comment">Home Directories</smbconfoption>
957 <smbconfoption name="valid users">%S</smbconfoption>
958 <smbconfoption name="read only">No</smbconfoption>
959 <smbconfoption name="browseable">No</smbconfoption>
961 <smbconfsection name="[printers]"/>
962 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
963 <smbconfoption name="path">/var/spool/samba</smbconfoption>
964 <smbconfoption name="guest ok">Yes</smbconfoption>
965 <smbconfoption name="printable">Yes</smbconfoption>
966 <smbconfoption name="browseable">No</smbconfoption>
968 <smbconfsection name="[print$]"/>
969 <smbconfoption name="comment">Printer Drivers</smbconfoption>
970 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
971 <smbconfoption name="admin users">root, Administrator</smbconfoption>
972 <smbconfoption name="write list">root</smbconfoption>
979 <title>NT4/Samba Domain with Samba Domain Member Server without NSS Support</title>
982 No matter how many UNIX/Linux administrators there may be who believe that a UNIX operating
983 system that does not have NSS and PAM support to be outdated, the fact is there
984 are still many such systems in use today. Samba can be used without NSS support, but this
985 does limit it to the use of local user and group accounts only.
989 The following steps may be followed to implement Samba with support for local accounts.
990 In this configuration Samba is made a domain member server. All incoming connections
991 to the Samba server will cause the look-up of the incoming username. If the account
992 is found, it is used. If the account is not found, one will be automatically created
993 on the local machine so that it can then be used for all access controls.
997 <title>Configuration Using Local Accounts Only</title>
1000 Using your favorite text editor, create the &smb.conf; file so it has the contents
1001 shown in <link linkend="ch0-NT4DSCM"/>.
1005 <para><indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
1006 The system is ready to join the domain. Execute the following:
1008 net rpc join -U root%not24get
1009 Joined domain MEGANET2.
1011 This indicates that the domain join succeed.
1015 Be sure to run all three Samba daemons: <command>smbd</command>, <command>nmbd</command>, <command>winbindd</command>.
1019 The Samba member server of a Windows NT4 domain is ready for use.
1023 <example id="ch0-NT4DSCM">
1024 <title>Samba Domain Member Server Using Local Accounts &smb.conf; File for NT4 Domain</title>
1026 <smbconfcomment>Global parameters</smbconfcomment>
1027 <smbconfsection name="[global]"/>
1028 <smbconfoption name="unix charset">LOCALE</smbconfoption>
1029 <smbconfoption name="workgroup">MEGANET3</smbconfoption>
1030 <smbconfoption name="netbios name">BSDBOX</smbconfoption>
1031 <smbconfoption name="security">DOMAIN</smbconfoption>
1032 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1033 <smbconfoption name="log level">1</smbconfoption>
1034 <smbconfoption name="syslog">0</smbconfoption>
1035 <smbconfoption name="add user script">/usr/sbin/useradd -m '%u'</smbconfoption>
1036 <smbconfoption name="add machine script">/usr/sbin/useradd -M '%u'</smbconfoption>
1037 <smbconfoption name="add group script">/usr/sbin/groupadd '%g'</smbconfoption>
1038 <smbconfoption name="winbind enable local accounts">Yes</smbconfoption>
1039 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
1040 <smbconfoption name="max log size">0</smbconfoption>
1041 <smbconfoption name="smb ports">139</smbconfoption>
1042 <smbconfoption name="name resolve order">wins bcast hosts</smbconfoption>
1043 <smbconfoption name="printcap name">CUPS</smbconfoption>
1044 <smbconfoption name="wins server">192.168.2.1</smbconfoption>
1045 <smbconfoption name="printer admin">root</smbconfoption>
1046 <smbconfoption name="hosts allow">192.168.2., 192.168.3., 127.</smbconfoption>
1047 <smbconfoption name="printing">cups</smbconfoption>
1049 <smbconfsection name="[homes]"/>
1050 <smbconfoption name="comment">Home Directories</smbconfoption>
1051 <smbconfoption name="valid users">%S</smbconfoption>
1052 <smbconfoption name="read only">No</smbconfoption>
1053 <smbconfoption name="browseable">No</smbconfoption>
1055 <smbconfsection name="[printers]"/>
1056 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
1057 <smbconfoption name="path">/var/spool/samba</smbconfoption>
1058 <smbconfoption name="guest ok">Yes</smbconfoption>
1059 <smbconfoption name="printable">Yes</smbconfoption>
1060 <smbconfoption name="browseable">No</smbconfoption>
1062 <smbconfsection name="[print$]"/>
1063 <smbconfoption name="comment">Printer Drivers</smbconfoption>
1064 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
1065 <smbconfoption name="admin users">root, Administrator</smbconfoption>
1066 <smbconfoption name="write list">root</smbconfoption>
1072 <title>Active Directory Domain with Samba Domain Member Server</title>
1075 <indexterm><primary>Active Directory</primary><secondary>join</secondary></indexterm>
1076 <indexterm><primary>Kerberos</primary></indexterm>
1077 <indexterm><primary>Domain Member</primary><secondary>server</secondary></indexterm>
1078 One of the much-sought-after features new to Samba-3 is the ability to join an Active Directory
1079 domain using Kerberos protocols. This makes it possible to operate an entire Windows network
1080 without the need to run NetBIOS over TCP/IP and permits more secure networking in general. An
1081 exhaustively complete discussion of the protocols is not possible in this book; perhaps a
1082 later book may explore the intricacies of the NetBIOS-less operation that Samba-3 can participate
1083 in. For now, we simply focus on how a Samba-3 server can be made a domain member server.
1087 <indexterm><primary>Active Directory</primary></indexterm>
1088 <indexterm><primary>LDAP</primary></indexterm>
1089 <indexterm><primary>Identity resolution</primary></indexterm>
1090 <indexterm><primary>Kerberos</primary></indexterm>
1091 The diagram in <link linkend="ch9-adsdc"/> demonstrates how Samba-3 interfaces with
1092 Microsoft Active Directory components. It should be noted that if Microsoft Windows Services
1093 for UNIX (SFU) has been installed and correctly configured, it is possible to use client LDAP
1094 for identity resolution just as can be done with Samba-3 when using an LDAP passdb backend.
1095 The UNIX tool that you need for this, as in the case of LDAP on UNIX/Linux, is the PADL
1096 Software nss_ldap tool-set. Compared with use of winbind and Kerberos, the use of
1097 LDAP-based identity resolution is a little less secure. In view of the fact that this solution
1098 requires additional software to be installed on the Windows 200x ADS domain controllers,
1099 and that means more management overhead, it is likely that most Samba-3 ADS client sites
1100 may elect to use winbind.
1104 Do not attempt to use this procedure if you are not 100 percent certain that the build of Samba-3
1105 you are using has been compiled and linked with all the tools necessary for this to work.
1106 Given the importance of this step, you must first validate that the Samba-3 message block
1107 daemon (<command>smbd</command>) has the necessary features.
1111 The hypothetical domain you are using in this example assumes that the Abmas London office
1112 decided to take its own lead (some would say this is a typical behavior in a global
1113 corporate world; besides, a little divergence and conflict makes for an interesting life).
1114 The Windows Server 2003 ADS domain is called <constant>london.abmas.biz</constant> and the
1115 name of the server is <constant>W2K3S</constant>. In ADS realm terms, the domain controller
1116 is known as <constant>w2k3s.london.abmas.biz</constant>. In NetBIOS nomenclature, the
1117 domain name is <constant>LONDON</constant> and the server name is <constant>W2K3S</constant>.
1120 <figure id="ch9-adsdc">
1121 <title>Active Directory Domain: Samba Member Server</title>
1122 <imagefile scale="60">chap9-ADSDC</imagefile>
1126 <title>Joining a Samba Server as an ADS Domain Member</title>
1129 <indexterm><primary>smbd</primary></indexterm>
1130 Before you try to use Samba-3, you want to know for certain that your executables have
1131 support for Kerberos and for LDAP. Execute the following to identify whether or
1132 not this build is perhaps suitable for use:
1134 &rootprompt; cd /usr/sbin
1135 &rootprompt; smbd -b | grep KRB
1137 HAVE_ADDR_TYPE_IN_KRB5_ADDRESS
1139 HAVE_KRB5_AUTH_CON_SETKEY
1140 HAVE_KRB5_GET_DEFAULT_IN_TKT_ETYPES
1141 HAVE_KRB5_GET_PW_SALT
1142 HAVE_KRB5_KEYBLOCK_KEYVALUE
1143 HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK
1144 HAVE_KRB5_MK_REQ_EXTENDED
1145 HAVE_KRB5_PRINCIPAL_GET_COMP_STRING
1146 HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES
1147 HAVE_KRB5_STRING_TO_KEY
1148 HAVE_KRB5_STRING_TO_KEY_SALT
1151 This output was obtained on a SUSE Linux system and shows the output for
1152 Samba that has been compiled and linked with the Heimdal Kerberos libraries.
1153 The following is a typical output that will be found on a Red Hat Linux system that
1154 has been linked with the MIT Kerberos libraries:
1156 &rootprompt; cd /usr/sbin
1157 &rootprompt; smbd -b | grep KRB
1159 HAVE_ADDRTYPE_IN_KRB5_ADDRESS
1161 HAVE_KRB5_AUTH_CON_SETUSERUSERKEY
1162 HAVE_KRB5_ENCRYPT_DATA
1163 HAVE_KRB5_FREE_DATA_CONTENTS
1164 HAVE_KRB5_FREE_KTYPES
1165 HAVE_KRB5_GET_PERMITTED_ENCTYPES
1166 HAVE_KRB5_KEYTAB_ENTRY_KEY
1167 HAVE_KRB5_LOCATE_KDC
1168 HAVE_KRB5_MK_REQ_EXTENDED
1169 HAVE_KRB5_PRINCIPAL2SALT
1170 HAVE_KRB5_PRINC_COMPONENT
1171 HAVE_KRB5_SET_DEFAULT_TGS_KTYPES
1172 HAVE_KRB5_SET_REAL_TIME
1173 HAVE_KRB5_STRING_TO_KEY
1174 HAVE_KRB5_TKT_ENC_PART2
1175 HAVE_KRB5_USE_ENCTYPE
1179 You can validate that Samba has been compiled and linked with LDAP support
1182 &rootprompt; smbd -b | grep LDAP
1183 massive:/usr/sbin # smbd -b | grep LDAP
1186 HAVE_LDAP_DOMAIN2HOSTLIST
1188 HAVE_LDAP_INITIALIZE
1189 HAVE_LDAP_SET_REBIND_PROC
1191 LDAP_SET_REBIND_PROC_ARGS
1193 This does look promising; <command>smbd</command> has been built with Kerberos and LDAP
1194 support. You are relieved to know that it is safe to progress.
1198 <indexterm><primary>Kerberos</primary><secondary>libraries</secondary></indexterm>
1199 <indexterm><primary>MIT Kerberos</primary></indexterm>
1200 <indexterm><primary>Heimdal Kerberos</primary></indexterm>
1201 <indexterm><primary>Kerberos</primary><secondary>MIT</secondary></indexterm>
1202 <indexterm><primary>Kerberos</primary><secondary>Heimdal</secondary></indexterm>
1203 <indexterm><primary>Red Hat Linux</primary></indexterm>
1204 <indexterm><primary>SUSE Linux</primary></indexterm>
1205 <indexterm><primary>SerNet</primary></indexterm>
1206 <indexterm><primary>validated</primary></indexterm>
1207 The next step is to identify which version of the Kerberos libraries have been used.
1208 In order to permit Samba-3 to interoperate with Windows 2003 Active Directory, it is
1209 essential that it has been linked with either MIT Kerberos version 1.3.1 or later,
1210 or that it has been linked with Heimdal Kerberos 0.6 plus specific patches. You may
1211 identify what version of the MIT Kerberos libraries are installed on your system by
1212 executing (on Red Hat Linux):
1214 &rootprompt; rpm -q krb5
1216 Or on SUSE Linux, execute:
1218 &rootprompt; rpm -q heimdal
1220 Please note that the RPMs provided by the Samba-Team are known to be working and have
1221 been validated. Red Hat Linux RPMs may be obtained from the Samba FTP sites. SUSE
1222 Linux RPMs may be obtained from <ulink url="ftp://ftp.sernet.de">Sernet</ulink> in
1227 From this point on, you are certain that the Samba-3 build you are using has the
1228 necessary capabilities. You can now configure Samba-3 and the NSS.
1232 Using you favorite editor, configure the &smb.conf; file that is located in the
1233 <filename>/etc/samba</filename> directory so that it has the contents shown
1234 in <link linkend="ch9-adssdm"/>.
1238 Edit or create the NSS control file so it has the contents shown in <link linkend="ch9-sdmnss"/>.
1242 <indexterm><primary>/etc/samba/secrets.tdb</primary></indexterm>
1243 Delete the file <filename>/etc/samba/secrets.tdb</filename> if it exists. Of course, you
1244 do keep a backup, don't you?
1248 Delete the tdb files that cache Samba information. You keep a backup of the old
1249 files, of course. You also remove all files to ensure that nothing can pollute your
1250 nice, new configuration. Execute the following (example is for SUSE Linux):
1252 &rootprompt; rm /var/lib/samba/*tdb
1257 <indexterm><primary>testparm</primary></indexterm>
1258 Validate your &smb.conf; file using <command>testparm</command> (as you have
1259 done previously). Correct all errors reported before proceeding. The command you
1262 &rootprompt; testparm -s | less
1264 Now that you are satisfied that your Samba server is ready to join the Windows
1265 ADS domain, let's move on.
1269 <indexterm><primary>net</primary><secondary>ads</secondary><tertiary>join</tertiary></indexterm>
1270 <indexterm><primary>Kerberos</primary></indexterm>
1271 This is a good time to double-check everything and then execute the following
1272 command when everything you have done has checked out okay:
1274 &rootprompt; net ads join -UAdministrator%not24get
1275 Using short domain name -- LONDON
1276 Joined 'FRAN' to realm 'LONDON.ABMAS.BIZ'
1278 You have successfully made your Samba-3 server a member of the ADS domain
1279 using Kerberos protocols.
1283 <indexterm><primary>silent return</primary></indexterm>
1284 <indexterm><primary>failed join</primary></indexterm>
1285 In the event that you receive no output messages, a silent return means that the
1286 domain join failed. You should use <command>ethereal</command> to identify what
1287 may be failing. Common causes of a failed join include:
1291 <indexterm><primary>name resolution</primary><secondary>Defective</secondary></indexterm>
1292 Defective or misconfigured DNS name resolution.
1296 <indexterm><primary>Restrictive security</primary></indexterm>
1297 Restrictive security settings on the Windows 200x ADS domain controller
1298 preventing needed communications protocols. You can check this by searching
1299 the Windows Server 200x Event Viewer.
1303 Incorrectly configured &smb.conf; file settings.
1307 Lack of support of necessary Kerberos protocols because the version of MIT
1308 Kerberos (or Heimdal) in use is not up to date enough to support the necessary
1313 <indexterm><primary>net</primary><secondary>rpc</secondary><tertiary>join</tertiary></indexterm>
1314 <indexterm><primary>RPC</primary></indexterm>
1315 <indexterm><primary>mixed mode</primary></indexterm>
1316 In any case, never execute the <command>net rpc join</command> command in an attempt
1317 to join the Samba server to the domain, unless you wish not to use the Kerberos
1318 security protocols. Use of the older RPC-based domain join facility requires that
1319 Windows Server 200x ADS has been configured appropriately for mixed mode operation.
1323 <indexterm><primary>tdbdump</primary></indexterm>
1324 <indexterm><primary>/etc/samba/secrets.tdb</primary></indexterm>
1325 If the <command>tdbdump</command> is installed on your system (not essential),
1326 you can look inside the <filename>/etc/samba/secrets.tdb</filename> file. If
1327 you wish to do this, execute:
1329 &rootprompt; tdbdump secrets.tdb
1331 key = "SECRETS/SID/LONDON"
1332 data = "\01\04\00\00\00\00\00\05\15\00\00\00\EBw\86\F1\ED\BD\
1333 F6{\5C6\E5W\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\
1334 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\
1335 00\00\00\00\00\00\00\00"
1338 key = "SECRETS/MACHINE_PASSWORD/LONDON"
1339 data = "le3Q5FPnN5.ueC\00"
1342 key = "SECRETS/MACHINE_SEC_CHANNEL_TYPE/LONDON"
1343 data = "\02\00\00\00"
1346 key = "SECRETS/MACHINE_LAST_CHANGE_TIME/LONDON"
1350 This is given to demonstrate to the skeptics that this process truly does work.
1354 It is now time to start Samba in the usual way (as has been done many time before
1359 <indexterm><primary>wbinfo</primary></indexterm>
1360 This is a good time to verify that everything is working. First, check that
1361 winbind is able to obtain the list of users and groups from the ADS domain controller.
1362 Execute the following:
1364 &rootprompt; wbinfo -u
1365 LONDON+Administrator
1367 LONDON+SUPPORT_388945a0
1371 Good, the list of users was obtained. Now do likewise for group accounts:
1373 &rootprompt; wbinfo -g
1374 LONDON+Domain Computers
1375 LONDON+Domain Controllers
1376 LONDON+Schema Admins
1377 LONDON+Enterprise Admins
1378 LONDON+Domain Admins
1380 LONDON+Domain Guests
1381 LONDON+Group Policy Creator Owners
1382 LONDON+DnsUpdateProxy
1384 Excellent. That worked also, as expected.
1387 <step><para><indexterm>
1388 <primary>getent</primary>
1390 Now repeat this via NSS to validate that full identity resolution is
1391 functional as required. Execute:
1393 &rootprompt; getent passwd
1395 LONDON+Administrator:x:10000:10000:Administrator:
1396 /home/LONDON/administrator:/bin/bash
1397 LONDON+Guest:x:10001:10001:Guest:
1398 /home/LONDON/guest:/bin/bash
1399 LONDON+SUPPORT_388945a0:x:10002:10000:SUPPORT_388945a0:
1400 /home/LONDON/support_388945a0:/bin/bash
1401 LONDON+krbtgt:x:10003:10000:krbtgt:
1402 /home/LONDON/krbtgt:/bin/bash
1403 LONDON+jht:x:10004:10000:John H. Terpstra:
1404 /home/LONDON/jht:/bin/bash
1406 Okay, ADS user accounts are being resolved. Now you try group resolution:
1408 &rootprompt; getent group
1410 LONDON+Domain Computers:x:10002:
1411 LONDON+Domain Controllers:x:10003:
1412 LONDON+Schema Admins:x:10004:LONDON+Administrator
1413 LONDON+Enterprise Admins:x:10005:LONDON+Administrator
1414 LONDON+Domain Admins:x:10006:LONDON+jht,LONDON+Administrator
1415 LONDON+Domain Users:x:10000:
1416 LONDON+Domain Guests:x:10001:
1417 LONDON+Group Policy Creator Owners:x:10007:LONDON+Administrator
1418 LONDON+DnsUpdateProxy:x:10008:
1420 This is very pleasing. Everything works as expected.
1424 <indexterm><primary>net</primary><secondary>ads</secondary><tertiary>info</tertiary></indexterm>
1425 <indexterm><primary>Active Directory</primary><secondary>server</secondary></indexterm>
1426 <indexterm><primary>Kerberos</primary></indexterm>
1427 You may now perform final verification that communications between Samba-3 winbind and
1428 the Active Directory server is using Kerberos protocols. Execute the following:
1430 &rootprompt; net ads info
1431 LDAP server: 192.168.2.123
1432 LDAP server name: w2k3s
1433 Realm: LONDON.ABMAS.BIZ
1434 Bind Path: dc=LONDON,dc=ABMAS,dc=BIZ
1436 Server time: Sat, 03 Jan 2004 02:44:44 GMT
1437 KDC server: 192.168.2.123
1438 Server time offset: 2
1440 It should be noted that Kerberos protocols are time-clock critical. You should
1441 keep all server time clocks synchronized using the network time protocol (NTP).
1442 In any case, the output we obtained confirms that all systems are operational.
1446 <indexterm><primary>net</primary><secondary>ads</secondary><tertiary>status</tertiary></indexterm>
1447 There is one more action you elect to take, just because you are paranoid and disbelieving,
1448 so you execute the following command:
1450 &rootprompt; net ads status -UAdministrator%not24get
1453 objectClass: organizationalPerson
1455 objectClass: computer
1457 distinguishedName: CN=fran,CN=Computers,DC=london,DC=abmas,DC=biz
1459 whenCreated: 20040103092006.0Z
1460 whenChanged: 20040103092006.0Z
1464 objectGUID: 58f89519-c467-49b9-acb0-f099d73696e
1465 userAccountControl: 69632
1471 lastLogon: 127175965783327936
1473 pwdLastSet: 127175952062598496
1475 objectSid: S-1-5-21-4052121579-2079768045-1474639452-1109
1476 accountExpires: 9223372036854775807
1478 sAMAccountName: fran$
1479 sAMAccountType: 805306369
1480 operatingSystem: Samba
1481 operatingSystemVersion: 3.0.20-SUSE
1483 userPrincipalName: HOST/fran@LONDON.ABMAS.BIZ
1484 servicePrincipalName: CIFS/fran.london.abmas.biz
1485 servicePrincipalName: CIFS/fran
1486 servicePrincipalName: HOST/fran.london.abmas.biz
1487 servicePrincipalName: HOST/fran
1488 objectCategory: CN=Computer,CN=Schema,CN=Configuration,
1489 DC=london,DC=abmas,DC=biz
1490 isCriticalSystemObject: FALSE
1491 -------------- Security Descriptor (revision: 1, type: 0x8c14)
1492 owner SID: S-1-5-21-4052121579-2079768045-1474639452-512
1493 group SID: S-1-5-21-4052121579-2079768045-1474639452-513
1494 ------- (system) ACL (revision: 4, size: 120, number of ACEs: 2)
1495 ------- ACE (type: 0x07, flags: 0x5a, size: 0x38,
1496 mask: 0x20, object flags: 0x3)
1498 access type: AUDIT OBJECT
1500 [Write All Properties]
1501 ------- ACE (type: 0x07, flags: 0x5a, size: 0x38,
1502 mask: 0x20, object flags: 0x3)
1504 access type: AUDIT OBJECT
1506 [Write All Properties]
1507 ------- (user) ACL (revision: 4, size: 1944, number of ACEs: 40)
1508 ------- ACE (type: 0x00, flags: 0x00, size: 0x24, mask: 0xf01ff)
1509 access SID: S-1-5-21-4052121579-2079768045-1474639452-512
1510 access type: ALLOWED
1511 Permissions: [Full Control]
1512 ------- ACE (type: 0x00, flags: 0x00, size: 0x18, mask: 0xf01ff)
1513 access SID: S-1-5-32-548
1515 ------- ACE (type: 0x05, flags: 0x12, size: 0x38,
1516 mask: 0x10, object flags: 0x3)
1518 access type: ALLOWED OBJECT
1520 [Read All Properties]
1521 -------------- End Of Security Descriptor
1523 And now you have conclusive proof that your Samba-3 ADS domain member server
1524 called <constant>FRAN</constant> is able to communicate fully with the ADS
1532 Your Samba-3 ADS domain member server is ready for use. During training sessions,
1533 you may be asked what is inside the <filename>winbindd_cache.tdb and winbindd_idmap.tdb</filename>
1534 files. Since curiosity just took hold of you, execute the following:
1536 &rootprompt; tdbdump /var/lib/samba/winbindd_idmap.tdb
1538 key = "S-1-5-21-4052121579-2079768045-1474639452-501\00"
1539 data = "UID 10001\00"
1542 key = "UID 10005\00"
1543 data = "S-1-5-21-4052121579-2079768045-1474639452-1111\00"
1546 key = "GID 10004\00"
1547 data = "S-1-5-21-4052121579-2079768045-1474639452-518\00"
1550 key = "S-1-5-21-4052121579-2079768045-1474639452-502\00"
1551 data = "UID 10003\00"
1555 &rootprompt; tdbdump /var/lib/samba/winbindd_cache.tdb
1558 data = "\00\00\00\00bp\00\00\06\00\00\00\0DAdministrator\0D
1559 Administrator-S-1-5-21-4052121579-2079768045-1474639452-500-
1560 S-1-5-21-4052121579-2079768045-1474639452-513\05Guest\05
1561 Guest-S-1-5-21-4052121579-2079768045-1474639452-501-
1562 S-1-5-21-4052121579-2079768045-1474639452-514\10
1563 SUPPORT_388945a0\10SUPPORT_388945a0.
1564 S-1-5-21-4052121579-2079768045-1474639452-1001-
1565 S-1-5-21-4052121579-2079768045-1474639452-513\06krbtgt\06
1566 krbtgt-S-1-5-21-4052121579-2079768045-1474639452-502-
1567 S-1-5-21-4052121579-2079768045-1474639452-513\03jht\10
1568 John H. Terpstra.S-1-5-21-4052121579-2079768045-1474639452-1110-
1569 S-1-5-21-4052121579-2079768045-1474639452-513"
1572 key = "GM/S-1-5-21-4052121579-2079768045-1474639452-512"
1573 data = "\00\00\00\00bp\00\00\02\00\00\00.
1574 S-1-5-21-4052121579-2079768045-1474639452-1110\03
1575 jht\01\00\00\00-S-1-5-21-4052121579-2079768045-1474639452-500\0D
1576 Administrator\01\00\00\00"
1579 key = "SN/S-1-5-21-4052121579-2079768045-1474639452-513"
1580 data = "\00\00\00\00xp\00\00\02\00\00\00\0CDomain Users"
1583 key = "GM/S-1-5-21-4052121579-2079768045-1474639452-518"
1584 data = "\00\00\00\00bp\00\00\01\00\00\00-
1585 S-1-5-21-4052121579-2079768045-1474639452-500\0D
1586 Administrator\01\00\00\00"
1589 key = "SEQNUM/LONDON\00"
1590 data = "xp\00\00C\92\F6?"
1593 key = "U/S-1-5-21-4052121579-2079768045-1474639452-1110"
1594 data = "\00\00\00\00xp\00\00\03jht\10John H. Terpstra.
1595 S-1-5-21-4052121579-2079768045-1474639452-1110-
1596 S-1-5-21-4052121579-2079768045-1474639452-513"
1599 key = "NS/S-1-5-21-4052121579-2079768045-1474639452-502"
1600 data = "\00\00\00\00bp\00\00-
1601 S-1-5-21-4052121579-2079768045-1474639452-502"
1604 key = "SN/S-1-5-21-4052121579-2079768045-1474639452-1001"
1605 data = "\00\00\00\00bp\00\00\01\00\00\00\10SUPPORT_388945a0"
1608 key = "SN/S-1-5-21-4052121579-2079768045-1474639452-500"
1609 data = "\00\00\00\00bp\00\00\01\00\00\00\0DAdministrator"
1612 key = "U/S-1-5-21-4052121579-2079768045-1474639452-502"
1613 data = "\00\00\00\00bp\00\00\06krbtgt\06krbtgt-
1614 S-1-5-21-4052121579-2079768045-1474639452-502-
1615 S-1-5-21-4052121579-2079768045-1474639452-513"
1619 Now all is revealed. Your curiosity, as well as that of your team, has been put at ease.
1620 May this server serve well all who happen upon it.
1623 <example id="ch9-adssdm">
1624 <title>Samba Domain Member &smb.conf; File for Active Directory Membership</title>
1626 <smbconfcomment>Global parameters</smbconfcomment>
1627 <smbconfsection name="[global]"/>
1628 <smbconfoption name="unix charset">LOCALE</smbconfoption>
1629 <smbconfoption name="workgroup">LONDON</smbconfoption>
1630 <smbconfoption name="realm">LONDON.ABMAS.BIZ</smbconfoption>
1631 <smbconfoption name="server string">Samba 3.0.20</smbconfoption>
1632 <smbconfoption name="security">ADS</smbconfoption>
1633 <smbconfoption name="username map">/etc/samba/smbusers</smbconfoption>
1634 <smbconfoption name="log level">1</smbconfoption>
1635 <smbconfoption name="syslog">0</smbconfoption>
1636 <smbconfoption name="log file">/var/log/samba/%m</smbconfoption>
1637 <smbconfoption name="max log size">50</smbconfoption>
1638 <smbconfoption name="printcap name">CUPS</smbconfoption>
1639 <smbconfoption name="ldap ssl">no</smbconfoption>
1640 <smbconfoption name="idmap uid">10000-20000</smbconfoption>
1641 <smbconfoption name="idmap gid">10000-20000</smbconfoption>
1642 <smbconfoption name="template primary group">"Domain Users"</smbconfoption>
1643 <smbconfoption name="template shell">/bin/bash</smbconfoption>
1644 <smbconfoption name="winbind separator">+</smbconfoption>
1645 <smbconfoption name="printing">cups</smbconfoption>
1647 <smbconfsection name="[homes]"/>
1648 <smbconfoption name="comment">Home Directories</smbconfoption>
1649 <smbconfoption name="valid users">%S</smbconfoption>
1650 <smbconfoption name="read only">No</smbconfoption>
1651 <smbconfoption name="browseable">No</smbconfoption>
1653 <smbconfsection name="[printers]"/>
1654 <smbconfoption name="comment">SMB Print Spool</smbconfoption>
1655 <smbconfoption name="path">/var/spool/samba</smbconfoption>
1656 <smbconfoption name="guest ok">Yes</smbconfoption>
1657 <smbconfoption name="printable">Yes</smbconfoption>
1658 <smbconfoption name="browseable">No</smbconfoption>
1660 <smbconfsection name="[print$]"/>
1661 <smbconfoption name="comment">Printer Drivers</smbconfoption>
1662 <smbconfoption name="path">/var/lib/samba/drivers</smbconfoption>
1663 <smbconfoption name="admin users">root, Administrator</smbconfoption>
1664 <smbconfoption name="write list">root</smbconfoption>
1669 <title>IDMAP_RID with Winbind</title>
1672 <indexterm><primary>idmap_rid</primary></indexterm>
1673 <indexterm><primary>SID</primary></indexterm>
1674 <indexterm><primary>RID</primary></indexterm>
1675 <indexterm><primary>IDMAP</primary></indexterm>
1676 The <command>idmap_rid</command> facility is a new tool that, unlike native winbind, creates a
1677 predictable mapping of MS Windows SIDs to UNIX UIDs and GIDs. The key benefit of this method
1678 of implementing the Samba IDMAP facility is that it eliminates the need to store the IDMAP data
1679 in a central place. The downside is that it can be used only within a single ADS domain and
1680 is not compatible with trusted domain implementations.
1684 <indexterm><primary>SID</primary></indexterm>
1685 <indexterm><primary>allow trusted domains</primary></indexterm>
1686 <indexterm><primary>idmap uid</primary></indexterm>
1687 <indexterm><primary>idmap gid</primary></indexterm>
1688 This alternate method of SID to UID/GID mapping can be achieved with the idmap_rid
1689 plug-in. This plug-in uses the RID of the user SID to derive the UID and GID by adding the
1690 RID to a base value specified. This utility requires that the parameter
1691 <quote>allow trusted domains = No</quote> must be specified, as it is not compatible
1692 with multiple domain environments. The <parameter>idmap uid</parameter> and
1693 <parameter>idmap gid</parameter> ranges must be specified.
1697 <indexterm><primary>idmap_rid</primary></indexterm>
1698 <indexterm><primary>realm</primary></indexterm>
1699 The idmap_rid facility can be used both for NT4/Samba-style domains as well as with Active Directory.
1700 To use this with an NT4 domain, the <parameter>realm</parameter> is not used. Additionally the
1701 method used to join the domain uses the <constant>net rpc join</constant> process.
1705 An example &smb.conf; file for an ADS domain environment is shown in <link linkend="sbe-idmapridex"/>.
1708 <example id="sbe-idmapridex">
1709 <title>Example &smb.conf; File Using <constant>idmap_rid</constant></title>
1711 <smbconfcomment>Global parameters</smbconfcomment>
1712 <smbconfsection name="[global]"/>
1713 <smbconfoption name="workgroup">KPAK</smbconfoption>
1714 <smbconfoption name="netbios name">BIGJOE</smbconfoption>
1715 <smbconfoption name="realm">CORP.KPAK.COM</smbconfoption>
1716 <smbconfoption name="server string">Office Server</smbconfoption>
1717 <smbconfoption name="security">ADS</smbconfoption>
1718 <smbconfoption name="allow trusted domains">No</smbconfoption>
1719 <smbconfoption name="idmap backend">idmap_rid:KPAK=500-100000000</smbconfoption>
1720 <smbconfoption name="idmap uid">500-100000000</smbconfoption>
1721 <smbconfoption name="idmap gid">500-100000000</smbconfoption>
1722 <smbconfoption name="template shell">/bin/bash</smbconfoption>
1723 <smbconfoption name="winbind use default domain">Yes</smbconfoption>
1724 <smbconfoption name="winbind enum users">No</smbconfoption>
1725 <smbconfoption name="winbind enum groups">No</smbconfoption>
1726 <smbconfoption name="winbind nested groups">Yes</smbconfoption>
1727 <smbconfoption name="printer admin">"KPAK\Domain Admins"</smbconfoption>
1732 <indexterm><primary>large domain</primary></indexterm>
1733 <indexterm><primary>Active Directory</primary></indexterm>
1734 <indexterm><primary>response</primary></indexterm>
1735 <indexterm><primary>getent</primary></indexterm>
1736 In a large domain with many users, it is imperative to disable enumeration of users and groups.
1737 For example, at a site that has 22,000 users in Active Directory the winbind-based user and
1738 group resolution is unavailable for nearly 12 minutes following first start-up of
1739 <command>winbind</command>. Disabling of such enumeration results in instantaneous response.
1740 The disabling of user and group enumeration means that it will not be possible to list users
1741 or groups using the <command>getent passwd</command> and <command>getent group</command>
1742 commands. It will be possible to perform the lookup for individual users, as shown in the procedure
1747 <indexterm><primary>NSS</primary></indexterm>
1748 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
1749 The use of this tool requires configuration of NSS as per the native use of winbind. Edit the
1750 <filename>/etc/nsswitch.conf</filename> so it has the following parameters:
1753 passwd: files winbind
1754 shadow: files winbind
1755 group: files winbind
1763 The following procedure can be used to utilize the idmap_rid facility:
1768 Create or install and &smb.conf; file with the above configuration.
1772 Edit the <filename>/etc/nsswitch.conf</filename> file as shown above.
1778 &rootprompt; net ads join -UAdministrator%password
1779 Using short domain name -- KPAK
1780 Joined 'BIGJOE' to realm 'CORP.KPAK.COM'
1785 <indexterm><primary>failed join</primary></indexterm>
1786 An invalid or failed join can be detected by executing:
1788 &rootprompt; net ads testjoin
1789 BIGJOE$@'s password:
1790 [2004/11/05 16:53:03, 0] utils/net_ads.c:ads_startup(186)
1791 ads_connect: No results returned
1792 Join to domain is not valid
1794 The specific error message may differ from the above because it depends on the type of failure that
1795 may have occurred. Increase the <parameter>log level</parameter> to 10, repeat the above test,
1796 and then examine the log files produced to identify the nature of the failure.
1800 Start the <command>nmbd</command>, <command>winbind,</command> and <command>smbd</command> daemons in the order shown.
1804 Validate the operation of this configuration by executing:
1805 <indexterm><primary></primary></indexterm>
1807 &rootprompt; getent passwd administrator
1808 administrator:x:1000:1013:Administrator:/home/BE/administrator:/bin/bash
1816 <title>IDMAP Storage in LDAP using Winbind</title>
1819 <indexterm><primary>ADAM</primary></indexterm>
1820 <indexterm><primary>ADS</primary></indexterm>
1821 The storage of IDMAP information in LDAP can be used with both NT4/Samba-3-style domains as well as
1822 with ADS domains. OpenLDAP is a commonly used LDAP server for this purpose, although any standards-compliant
1823 LDAP server can be used. It is therefore possible to deploy this IDMAP configuration using
1824 the Sun iPlanet LDAP server, Novell eDirectory, Microsoft ADS plus ADAM, and so on.
1828 The example in <link linkend="sbeunxa"/> is for an ADS-style domain.
1831 <example id="sbeunxa">
1832 <title>Typical ADS Style Domain &smb.conf; File</title>
1834 <smbconfcomment>Global parameters</smbconfcomment>
1835 <smbconfsection name="[global]"/>
1836 <smbconfoption name="workgroup">SNOWSHOW</smbconfoption>
1837 <smbconfoption name="netbios name">GOODELF</smbconfoption>
1838 <smbconfoption name="realm">SNOWSHOW.COM</smbconfoption>
1839 <smbconfoption name="server string">Samba Server</smbconfoption>
1840 <smbconfoption name="security">ADS</smbconfoption>
1841 <smbconfoption name="log level">1 ads:10 auth:10 sam:10 rpc:10</smbconfoption>
1842 <smbconfoption name="ldap admin dn">cn=Manager,dc=SNOWSHOW,dc=COM</smbconfoption>
1843 <smbconfoption name="ldap idmap suffix">ou=Idmap</smbconfoption>
1844 <smbconfoption name="ldap suffix">dc=SNOWSHOW,dc=COM</smbconfoption>
1845 <smbconfoption name="idmap backend">ldap:ldap://ldap.snowshow.com</smbconfoption>
1846 <smbconfoption name="idmap uid">150000-550000</smbconfoption>
1847 <smbconfoption name="idmap gid">150000-550000</smbconfoption>
1848 <smbconfoption name="template shell">/bin/bash</smbconfoption>
1849 <smbconfoption name="winbind use default domain">Yes</smbconfoption>
1854 <indexterm><primary>realm</primary></indexterm>
1855 In the case of an NT4 or Samba-3-style domain the <parameter>realm</parameter> is not used, and the
1856 command used to join the domain is <command>net rpc join</command>. The above example also demonstrates
1857 advanced error reporting techniques that are documented in the chapter called "Reporting Bugs" in
1858 <quote>The Official Samba-3 HOWTO and Reference Guide, Second Edition</quote> (TOSHARG2).
1862 <indexterm><primary>MIT kerberos</primary></indexterm>
1863 <indexterm><primary>Heimdal kerberos</primary></indexterm>
1864 <indexterm><primary>/etc/krb5.conf</primary></indexterm>
1865 Where MIT kerberos is installed (version 1.3.4 or later), edit the <filename>/etc/krb5.conf</filename>
1866 file so it has the following contents:
1869 default = FILE:/var/log/krb5libs.log
1870 kdc = FILE:/var/log/krb5kdc.log
1871 admin_server = FILE:/var/log/kadmind.log
1874 default_realm = SNOWSHOW.COM
1875 dns_lookup_realm = false
1876 dns_lookup_kdc = true
1881 ticket_lifetime = 36000
1882 renew_lifetime = 36000
1884 krb4_convert = false
1890 Where Heimdal kerberos is installed, edit the <filename>/etc/krb5.conf</filename>
1891 file so it is either empty (i.e., no contents) or it has the following contents:
1894 default_realm = SNOWSHOW.COM
1899 kdc = ADSDC.SHOWSHOW.COM
1903 .snowshow.com = SNOWSHOW.COM
1908 Samba cannot use the Heimdal libraries if there is no <filename>/etc/krb5.conf</filename> file.
1909 So long as there is an empty file, the Heimdal kerberos libraries will be usable. There is no
1910 need to specify any settings because Samba, using the Heimdal libraries, can figure this out automatically.
1913 Edit the NSS control file <filename>/etc/nsswitch.conf</filename> so it has the following entries:
1926 <indexterm><primary>PADL</primary></indexterm>
1927 <indexterm><primary>/etc/ldap.conf</primary></indexterm>
1928 You will need the <ulink url="http://www.padl.com">PADL</ulink> <command>nss_ldap</command>
1929 tool set for this solution. Configure the <filename>/etc/ldap.conf</filename> file so it has
1930 the information needed. The following is an example of a working file:
1933 base dc=snowshow,dc=com
1934 binddn cn=Manager,dc=snowshow,dc=com
1939 nss_base_passwd ou=People,dc=snowshow,dc=com?one
1940 nss_base_shadow ou=People,dc=snowshow,dc=com?one
1941 nss_base_group ou=Groups,dc=snowshow,dc=com?one
1947 The following procedure may be followed to affect a working configuration:
1951 Configure the &smb.conf; file as shown above.
1955 Create the <filename>/etc/krb5.conf</filename> file following the indications above.
1959 Configure the <filename>/etc/nsswitch.conf</filename> file as shown above.
1963 Download, build, and install the PADL nss_ldap tool set. Configure the
1964 <filename>/etc/ldap.conf</filename> file as shown above.
1968 Configure an LDAP server and initialize the directory with the top-level entries needed by IDMAP
1969 as shown in the following LDIF file:
1971 dn: dc=snowshow,dc=com
1972 objectClass: dcObject
1973 objectClass: organization
1975 o: The Greatest Snow Show in Singapore.
1976 description: Posix and Samba LDAP Identity Database
1978 dn: cn=Manager,dc=snowshow,dc=com
1979 objectClass: organizationalRole
1981 description: Directory Manager
1983 dn: ou=Idmap,dc=snowshow,dc=com
1984 objectClass: organizationalUnit
1990 Execute the command to join the Samba domain member server to the ADS domain as shown here:
1992 &rootprompt; net ads testjoin
1993 Using short domain name -- SNOWSHOW
1994 Joined 'GOODELF' to realm 'SNOWSHOW.COM'
1999 Store the LDAP server access password in the Samba <filename>secrets.tdb</filename> file as follows:
2001 &rootprompt; smbpasswd -w not24get
2006 Start the <command>nmbd</command>, <command>winbind</command>, and <command>smbd</command> daemons in the order shown.
2012 <indexterm><primary>diagnostic</primary></indexterm>
2013 Follow the diagnostic procedures shown earlier in this chapter to identify success or failure of the join.
2014 In many cases a failure is indicated by a silent return to the command prompt with no indication of the
2021 <title>IDMAP and NSS Using LDAP from ADS with RFC2307bis Schema Extension</title>
2024 <indexterm><primary>rfc2307bis</primary></indexterm>
2025 <indexterm><primary>schema</primary></indexterm>
2026 The use of this method is messy. The information provided in this section is for guidance only
2027 and is very definitely not complete. This method does work; it is used in a number of large sites
2028 and has an acceptable level of performance.
2032 An example &smb.conf; file is shown in <link linkend="sbewinbindex"/>.
2035 <example id="sbewinbindex">
2036 <title>ADS Membership Using RFC2307bis Identity Resolution &smb.conf; File</title>
2038 <smbconfcomment>Global parameters</smbconfcomment>
2039 <smbconfsection name="[global]"/>
2040 <smbconfoption name="workgroup">BUBBAH</smbconfoption>
2041 <smbconfoption name="netbios name">MADMAX</smbconfoption>
2042 <smbconfoption name="realm">BUBBAH.COM</smbconfoption>
2043 <smbconfoption name="server string">Samba Server</smbconfoption>
2044 <smbconfoption name="security">ADS</smbconfoption>
2045 <smbconfoption name="idmap uid">150000-550000</smbconfoption>
2046 <smbconfoption name="idmap gid">150000-550000</smbconfoption>
2047 <smbconfoption name="template shell">/bin/bash</smbconfoption>
2048 <smbconfoption name="winbind use default domain">Yes</smbconfoption>
2049 <smbconfoption name="winbind trusted domains only">Yes</smbconfoption>
2050 <smbconfoption name="winbind nested groups">Yes</smbconfoption>
2055 <indexterm><primary>nss_ldap</primary></indexterm>
2056 The DMS must be joined to the domain using the usual procedure. Additionally, it is necessary
2057 to build and install the PADL nss_ldap tool set. Be sure to build this tool set with the
2060 ./configure --enable-rfc2307bis --enable-schema-mapping
2066 <indexterm><primary>/etc/nsswitch.conf</primary></indexterm>
2067 The following <filename>/etc/nsswitch.conf</filename> file contents are required:
2080 <indexterm><primary>/etc/ldap.conf</primary></indexterm>
2081 <indexterm><primary>nss_ldap</primary></indexterm>
2082 The <filename>/etc/ldap.conf</filename> file must be configured also. Refer to the PADL documentation
2083 and source code for nss_ldap instructions.
2087 The next step involves preparation on the ADS schema. This is briefly discussed in the remaining
2088 part of this chapter.
2092 <title>IDMAP, Active Directory, and MS Services for UNIX 3.5</title>
2095 <indexterm><primary>SFU</primary></indexterm>
2096 The Microsoft Windows Service for UNIX version 3.5 is available for free
2097 <ulink url="http://www.microsoft.com/windows/sfu/">download</ulink>
2098 from the Microsoft Web site. You will need to download this tool and install it following
2099 Microsoft instructions.
2105 <title>IDMAP, Active Directory, and AD4UNIX</title>
2108 Instructions for obtaining and installing the AD4UNIX tool set can be found from the
2109 <ulink url="http://www.geekcomix.com/cgi-bin/classnotes/wiki.pl?LDAP01/An_Alternative_Approach">
2110 Geekcomix</ulink> Web site.
2121 <title>UNIX/Linux Client Domain Member</title>
2124 <primary>user credentials</primary>
2126 So far this chapter has been mainly concerned with the provision of file and print
2127 services for domain member servers. However, an increasing number of UNIX/Linux
2128 workstations are being installed that do not act as file or print servers to anyone
2129 other than a single desktop user. The key demand for desktop systems is to be able
2130 to log onto any UNIX/Linux or Windows desktop using the same network user credentials.
2134 <primary>Single Sign-On</primary>
2137 The ability to use a common set of user credential across a variety of network systems
2138 is generally regarded as a single sign-on (SSO) solution. SSO systems are sold by a
2139 large number of vendors and include a range of technologies such as:
2148 Federated directory provisioning
2152 Metadirectory server solutions
2156 Replacement authentication systems
2161 <primary>Identity management</primary>
2163 There are really only three solutions that provide integrated authentication and
2164 user identity management facilities:
2169 Samba winbind (free)
2173 <ulink url="http://www.padl.com">PADL</ulink> PAM and LDAP tools (free)
2177 <ulink url="http://www.vintela.com">Vintela</ulink> Authentication Services (commercial)
2182 The following guidelines are pertinent to the deployment of winbind-based authentication
2183 and identity resolution with the express purpose of allowing users to log on to UNIX/Linux desktops
2184 using Windows network domain user credentials (username and password).
2188 You should note that it is possible to use LDAP-based PAM and NSS tools to permit distributed
2189 systems logons (SSO), providing user and group accounts are stored in an LDAP directory. This
2190 provides logon services for UNIX/Linux users, while Windows users obtain their sign-on
2191 support via Samba-3.
2195 <indexterm><primary>Windows Services for UNIX</primary><see>SUS</see></indexterm>
2196 On the other hand, if the authentication and identity resolution backend must be provided by
2197 a Windows NT4-style domain or from an Active Directory Domain that does not have the Microsoft
2198 Windows Services for UNIX installed, winbind is your best friend. Specific guidance for these
2199 situations now follows.
2203 <indexterm><primary>PAM</primary></indexterm>
2204 <indexterm><primary>Identity resolution</primary></indexterm>
2205 <indexterm><primary>NSS</primary></indexterm>
2206 To permit users to log on to a Linux system using Windows network credentials, you need to
2207 configure identity resolution (NSS) and PAM. This means that the basic steps include those
2208 outlined above with the addition of PAM configuration. Given that most workstations (desktop/client)
2209 usually do not need to provide file and print services to a group of users, the configuration
2210 of shares and printers is generally less important. Often this allows the share specifications
2211 to be entirely removed from the &smb.conf; file. That is obviously an administrator decision.
2215 <title>NT4 Domain Member</title>
2218 The following steps provide a Linux system that users can log onto using
2219 Windows NT4 (or Samba-3) domain network credentials:
2224 Follow the steps outlined in <link linkend="wdcsdm"/> and ensure that
2225 all validation tests function as shown.
2229 Identify what services users must log on to. On Red Hat Linux, if it is
2230 intended that the user shall be given access to all services, it may be
2231 most expeditious to simply configure the file
2232 <filename>/etc/pam.d/system-auth</filename>.
2236 Carefully make a backup copy of all PAM configuration files before you
2237 begin making changes. If you break the PAM configuration, please note
2238 that you may need to use an emergency boot process to recover your Linux
2239 system. It is possible to break the ability to log into the system if
2240 PAM files are incorrectly configured. The entire directory
2241 <filename>/etc/pam.d</filename> should be backed up to a safe location.
2245 If you require only console login support, edit the <filename>/etc/pam.d/login</filename>
2246 so it matches <link linkend="ch9-pamwnbdlogin"/>.
2250 To provide the ability to log onto the graphical desktop interface, you must edit
2251 the files <filename>gdm</filename> and <filename>xdm</filename> in the
2252 <filename>/etc/pam.d</filename> directory.
2256 Edit only one file at a time. Carefully validate its operation before attempting
2257 to reboot the machine.
2264 <title>ADS Domain Member</title>
2267 This procedure should be followed to permit a Linux network client (workstation/desktop)
2268 to permit users to log on using Microsoft Active Directory-based user credentials.
2273 Follow the steps outlined in <link linkend="adssdm"/> and ensure that
2274 all validation tests function as shown.
2278 Identify what services users must log on to. On Red Hat Linux, if it is
2279 intended that the user shall be given access to all services, it may be
2280 most expeditious to simply configure the file
2281 <filename>/etc/pam.d/system-auth</filename> as shown in <link linkend="ch9-rhsysauth"/>.
2285 Carefully make a backup copy of all PAM configuration files before you
2286 begin making changes. If you break the PAM configuration, please note
2287 that you may need to use an emergency boot process to recover your Linux
2288 system. It is possible to break the ability to log into the system if
2289 PAM files are incorrectly configured. The entire directory
2290 <filename>/etc/pam.d</filename> should be backed up to a safe location.
2294 If you require only console login support, edit the <filename>/etc/pam.d/login</filename>
2295 so it matches <link linkend="ch9-pamwnbdlogin"/>.
2299 To provide the ability to log onto the graphical desktop interface, you must edit
2300 the files <filename>gdm</filename> and <filename>xdm</filename> in the
2301 <filename>/etc/pam.d</filename> directory.
2305 Edit only one file at a time. Carefully validate its operation before attempting
2306 to reboot the machine.
2312 <example id="ch9-pamwnbdlogin">
2313 <title>SUSE: PAM <filename>login</filename> Module Using Winbind</title>
2318 auth sufficient pam_unix2.so nullok
2319 auth sufficient pam_winbind.so use_first_pass use_authtok
2320 auth required pam_securetty.so
2321 auth required pam_nologin.so
2322 auth required pam_env.so
2323 auth required pam_mail.so
2324 account sufficient pam_unix2.so
2325 account sufficient pam_winbind.so user_first_pass use_authtok
2326 password required pam_pwcheck.so nullok
2327 password sufficient pam_unix2.so nullok use_first_pass use_authtok
2328 password sufficient pam_winbind.so use_first_pass use_authtok
2329 session sufficient pam_unix2.so none
2330 session sufficient pam_winbind.so use_first_pass use_authtok
2331 session required pam_limits.so
2335 <example id="ch9-pamwbndxdm">
2336 <title>SUSE: PAM <filename>xdm</filename> Module Using Winbind</title>
2338 # /etc/pam.d/gdm (/etc/pam.d/xdm)
2341 auth sufficient pam_unix2.so nullok
2342 auth sufficient pam_winbind.so use_first_pass use_authtok
2343 account sufficient pam_unix2.so
2344 account sufficient pam_winbind.so use_first_pass use_authtok
2345 password sufficient pam_unix2.so
2346 password sufficient pam_winbind.so use_first_pass use_authtok
2347 session sufficient pam_unix2.so
2348 session sufficient pam_winbind.so use_first_pass use_authtok
2349 session required pam_dev perm.so
2350 session required pam_resmgr.so
2354 <example id="ch9-rhsysauth">
2355 <title>Red Hat 9: PAM System Authentication File: <filename>/etc/pam.d/system-auth</filename> Module Using Winbind</title>
2358 auth required /lib/security/$ISA/pam_env.so
2359 auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok
2360 auth sufficient /lib/security/$ISA/pam_winbind.so use_first_pass
2361 auth required /lib/security/$ISA/pam_deny.so
2363 account required /lib/security/$ISA/pam_unix.so
2364 account sufficient /lib/security/$ISA/pam_winbind.so use_first_pass
2366 password required /lib/security/$ISA/pam_cracklib.so retry=3 type=
2367 # Note: The above line is complete. There is nothing following the '='
2368 password sufficient /lib/security/$ISA/pam_unix.so \
2369 nullok use_authtok md5 shadow
2370 password sufficient /lib/security/$ISA/pam_winbind.so use_first_pass
2371 password required /lib/security/$ISA/pam_deny.so
2373 session required /lib/security/$ISA/pam_limits.so
2374 session sufficient /lib/security/$ISA/pam_unix.so
2375 session sufficient /lib/security/$ISA/pam_winbind.so use_first_pass
2382 <title>Key Points Learned</title>
2385 The addition of UNIX/Linux Samba servers and clients is a common requirement. In this chapter, you
2386 learned how to integrate such servers so that the UID/GID mappings they use can be consistent
2387 across all domain member servers. You also discovered how to implement the ability to use Samba
2388 or Windows domain account credentials to log on to a UNIX/Linux client.
2392 The following are key points made in this chapter:
2397 Domain controllers are always authoritative for the domain.
2401 Domain members may have local accounts and must be able to resolve the identity of
2402 domain user accounts. Domain user account identity must map to a local UID/GID. That
2403 local UID/GID can be stored in LDAP. This way, it is possible to share the IDMAP data
2404 across all domain member machines.
2408 Resolution of user and group identities on domain member machines may be implemented
2409 using direct LDAP services or using winbind.
2413 On NSS/PAM enabled UNIX/Linux systems, NSS is responsible for identity management
2414 and PAM is responsible for authentication of logon credentials (username and password).
2423 <title>Questions and Answers</title>
2426 The following questions were obtained from the mailing list and also from private discussions
2427 with Windows network administrators.
2430 <qandaset defaultlabel="chap09qa" type="number">
2435 We use NIS for all UNIX accounts. Why do we need winbind?
2442 <indexterm><primary>NIS</primary></indexterm>
2443 <indexterm><primary>encrypted passwords</primary></indexterm>
2444 <indexterm><primary>smbpasswd</primary></indexterm>
2445 <indexterm><primary>tdbsam</primary></indexterm>
2446 <indexterm><primary>passdb backend</primary></indexterm>
2447 <indexterm><primary>Winbind</primary></indexterm>
2448 You can use NIS for your UNIX accounts. NIS does not store the Windows encrypted
2449 passwords that need to be stored in one of the acceptable passdb backends.
2450 Your choice of backend is limited to <parameter>smbpasswd</parameter> or
2451 <parameter>tdbsam</parameter>. Winbind is needed to handle the resolution of
2452 SIDs from trusted domains to local UID/GID values.
2456 <indexterm><primary>winbind trusted domains only</primary></indexterm>
2457 <indexterm><primary>getpwnam()</primary></indexterm>
2458 On a domain member server, you effectively map Windows domain users to local users
2459 that are in your NIS database by specifying the <parameter>winbind trusted domains
2460 only</parameter>. This causes user and group account lookups to be routed via
2461 the <command>getpwnam()</command> family of systems calls. On an NIS-enabled client,
2462 this pushes the resolution of users and groups out through NIS.
2466 As a general rule, it is always a good idea to run winbind on all Samba servers.
2476 Our IT management people do not like LDAP but are looking at Microsoft Active Directory.
2477 Which is better?<indexterm>
2478 <primary>Active Directory</primary>
2486 <primary>LDAP</primary>
2487 <secondary>server</secondary>
2488 </indexterm><indexterm>
2489 <primary>Kerberos</primary>
2490 </indexterm><indexterm>
2491 <primary>schema</primary>
2493 Microsoft Active Directory is an LDAP server that is intricately tied to a Kerberos
2494 infrastructure. Most IT managers who object to LDAP do so because
2495 an LDAP server is most often supplied as a raw tool that needs to be configured and
2496 for which the administrator must create the schema, create the administration tools, and
2497 devise the backup and recovery facilities in a site-dependent manner. LDAP servers
2498 in general are seen as a high-energy, high-risk facility.
2502 <primary>management</primary>
2504 Microsoft Active Directory by comparison is easy to install and configure and
2505 is supplied with all tools necessary to implement and manage the directory. For sites
2506 that lack a lot of technical competence, Active Directory is a good choice. For sites
2507 that have the technical competence to handle Active Directory well, LDAP is a good
2508 alternative. The real issue is, What type of solution does
2509 the site want? If management wants a choice to use an alternative, they may want to
2510 consider the options. On the other hand, if management just wants a solution that works,
2511 Microsoft Active Directory is a good solution.
2521 We want to implement a Samba PDC, four Samba BDCs, and 10 Samba servers. Is it possible
2522 to use NIS in place of LDAP?
2529 <primary>NIS</primary>
2530 </indexterm><indexterm>
2531 <primary>LDAP</primary>
2532 </indexterm><indexterm>
2533 <primary>encrypted passwords</primary>
2534 </indexterm><indexterm>
2535 <primary>synchronized</primary>
2536 </indexterm><indexterm>
2537 <primary>secure account password</primary>
2538 </indexterm><indexterm>
2539 <primary>PDC</primary>
2540 </indexterm><indexterm>
2541 <primary>BDC</primary>
2543 Yes, it is possible to use NIS in place of LDAP, but there may be problems with keeping
2544 the Windows (SMB) encrypted passwords database correctly synchronized across the entire
2545 network. Workstations (Windows client machines) periodically change their domain
2546 membership secure account password. How can you keep changes that are on remote BDCs
2547 synchronized on the PDC?
2551 <primary>centralized storage</primary>
2552 </indexterm><indexterm>
2553 <primary>management</primary>
2554 </indexterm><indexterm>
2555 <primary>network Identities</primary>
2557 LDAP is a more elegant solution because it permits centralized storage and management
2558 of all network identities (user, group, and machine accounts) together with all information
2559 Samba needs to provide to network clients and their users.
2569 Are you suggesting that users should not log on to a domain member server? If so, why?
2576 <primary>security</primary>
2577 </indexterm><indexterm>
2578 <primary>data</primary>
2579 <secondary>integrity</secondary>
2580 </indexterm><indexterm>
2581 <primary>mapped drives</primary>
2583 Many UNIX administrators mock the model that the personal computer industry has adopted
2584 as normative since the early days of Novell NetWare. The old
2585 perception of the necessity to keep users off file and print servers was a result of
2586 fears concerning the security and integrity of data. It was a simple and generally
2587 effective measure to keep users away from servers, except through mapped drives.
2591 <primary>user logins</primary>
2592 </indexterm><indexterm>
2593 <primary>risk</primary>
2594 </indexterm><indexterm>
2595 <primary>user errors</primary>
2596 </indexterm><indexterm>
2597 <primary>strategy</primary>
2598 </indexterm><indexterm>
2599 <primary>policy</primary>
2601 UNIX administrators are fully correct in asserting that UNIX servers and workstations
2602 are identical in terms of the software that is installed. They correctly assert that
2603 in a well-secured environment it is safe to store files on a system that has hundreds
2604 of users. But all network administrators must factor into the decision to allow or
2605 reject general user logins to a UNIX system that is principally a file and print
2606 server the risk to operations through simple user errors.
2607 Only then can one begin to appraise the best strategy and adopt a site-specific
2608 policy that best protects the needs of users and of the organization alike.
2612 <primary>system level logins</primary>
2614 From experience, it is my recommendation to keep general system-level logins to a
2615 practical minimum and to eliminate them if possible. This should not be taken as a
2616 hard rule, though. The better question is, what works best for the site?
2626 <primary>winbind enable local accounts</primary>
2627 </indexterm><indexterm>
2628 <primary>/etc/passwd</primary>
2629 </indexterm><indexterm>
2630 <primary>options list</primary>
2631 </indexterm><indexterm>
2632 <primary>ACL</primary>
2633 </indexterm><indexterm>
2634 <primary>share</primary>
2636 In my &smb.conf; file, I enabled the parameter <parameter>winbind enable local accounts
2637 </parameter> on all domain member servers, but it does not work. The accounts I put in
2638 <filename>/etc/passwd</filename> do not show up in the options list when I try to set an
2639 ACL on a share. What have I done wrong?
2646 <primary>local users</primary>
2647 </indexterm><indexterm>
2648 <primary>local groups</primary>
2649 </indexterm><indexterm>
2650 <primary>UNIX account</primary>
2651 </indexterm><indexterm>
2652 <primary>getpwnam()</primary>
2653 </indexterm><indexterm>
2654 <primary>getgrgid()</primary>
2655 </indexterm><indexterm>
2656 <primary>Identity resolution</primary>
2657 </indexterm><indexterm>
2658 <primary>failure</primary>
2659 </indexterm><indexterm>
2660 <primary>Domain</primary>
2662 The manual page for this &smb.conf; file parameter clearly says, <quote>This parameter
2663 controls whether or not winbindd will act as a stand-in replacement for the various
2664 account management hooks in smb.conf (for example, add user script). If enabled, winbindd
2665 will support the creation of local users and groups as another source of UNIX account
2666 information available via getpwnam() or getgrgid(), etc....</quote> By default this
2667 parameter is already enabled; therefore, the action you are seeing is a result of a failure
2668 of identity resolution in the domain.
2672 <primary>Domain logons</primary>
2673 </indexterm><indexterm>
2674 <primary>Identity resolution</primary>
2675 </indexterm><indexterm>
2676 <primary>Domain</primary>
2677 <secondary>user</secondary>
2678 </indexterm><indexterm>
2679 <primary>Domain</primary>
2680 <secondary>group</secondary>
2681 </indexterm><indexterm>
2682 <primary>UID</primary>
2683 </indexterm><indexterm>
2684 <primary>GID</primary>
2686 These are the accounts that are available for Windows network domain logons. Providing
2687 identity resolution has been correctly configured on the domain controllers as well as
2688 on domain member servers. The domain user and group identities automatically map
2689 to a valid local UID and GID pair.
2699 <primary>trusted domains</primary>
2700 </indexterm><indexterm>
2701 <primary>domain</primary>
2702 <secondary>trusted</secondary>
2703 </indexterm><indexterm>
2704 <primary>winbind trusted domains only</primary>
2705 </indexterm><indexterm>
2706 <primary>domain members</primary>
2708 We want to ensure that only users from our own domain plus from trusted domains can use our
2709 Samba servers. In the &smb.conf; file on all servers, we have enabled the <parameter>winbind
2710 trusted domains only</parameter> parameter. We now find that users from trusted domains
2711 cannot access our servers, and users from Windows clients that are not domain members
2712 can also access our servers. Is this a Samba bug?
2719 <primary>distributed</primary>
2720 </indexterm><indexterm>
2721 <primary>NIS</primary>
2722 </indexterm><indexterm>
2723 <primary>rsync</primary>
2724 </indexterm><indexterm>
2725 <primary>LDAP</primary>
2726 </indexterm><indexterm>
2727 <primary>winbindd</primary>
2728 </indexterm><indexterm>
2729 <primary>/etc/passwd</primary>
2731 The manual page for this <parameter>winbind trusted domains only</parameter> parameter says,
2732 <quote>This parameter is designed to allow Samba servers that are members of a Samba-controlled
2733 domain to use UNIX accounts distributed vi NIS, rsync, or LDAP as the UIDs for winbindd users
2734 in the hosts primary domain. Therefore, the user <constant>SAMBA\user1</constant> would be
2735 mapped to the account <constant>user1</constant> in <filename>/etc/passwd</filename> instead
2736 of allocating a new UID for him or her.</quote> This clearly suggests that you are trying
2737 to use this parameter inappropriately.
2741 <primary>valid users</primary>
2743 A far better solution is to use the <parameter>valid users</parameter> by specifying
2744 precisely the domain users and groups that should be permitted access to the shares. You could,
2745 for example, set the following parameters:
2748 path = /export/demodata
2749 valid users = @"Domain Users", @"OTHERDOMAIN\Domain Users"
2761 What are the benefits of using LDAP for my domain member servers?
2768 <primary>LDAP</primary>
2769 </indexterm><indexterm>
2770 <primary>benefit</primary>
2771 </indexterm><indexterm>
2772 <primary>UID</primary>
2773 </indexterm><indexterm>
2774 <primary>GID</primary>
2775 </indexterm><indexterm>
2776 <primary>Domain Controllers</primary>
2777 </indexterm><indexterm>
2778 <primary>Domain Member servers</primary>
2779 </indexterm><indexterm>
2780 <primary>copy</primary>
2781 </indexterm><indexterm>
2782 <primary>replicate</primary>
2783 </indexterm><indexterm>
2784 <primary>identity</primary>
2786 The key benefit of using LDAP is that the UID of all users and the GID of all groups
2787 are globally consistent on domain controllers as well as on domain member servers.
2788 This means that it is possible to copy/replicate files across servers without
2793 <primary>Identity resolution</primary>
2794 </indexterm><indexterm>
2795 <primary>winbind</primary>
2796 </indexterm><indexterm>
2797 <primary>IDMAP backend</primary>
2798 </indexterm><indexterm>
2799 <primary>LDAP</primary>
2800 </indexterm><indexterm>
2801 <primary>Domain Controllers</primary>
2802 </indexterm><indexterm>
2803 <primary>Domain Member</primary>
2804 <secondary>servers</secondary>
2805 </indexterm><indexterm>
2806 <primary>Posix</primary>
2807 </indexterm><indexterm>
2808 <primary>account information</primary>
2810 When use is made of account identity resolution via winbind, even when an IDMAP backend
2811 is stored in LDAP, the UID/GID on domain member servers is consistent, but differs
2812 from the ID that the user/group has on domain controllers. The winbind allocated UID/GID
2813 that is stored in LDAP (or locally) will be in the numeric range specified in the <parameter>
2814 idmap uid/gid</parameter> in the &smb.conf; file. On domain controllers, the UID/GID is
2815 that of the POSIX value assigned in the LDAP directory as part of the POSIX account information.
2825 Is proper DNS operation necessary for Samba-3 plus LDAP? If so, what must I put into
2826 my DNS configuration?
2833 <primary>DNS</primary>
2834 <secondary>configuration</secondary>
2835 </indexterm><indexterm>
2836 <primary>DNS</primary>
2837 <secondary>lookup</secondary>
2838 </indexterm><indexterm>
2839 <primary>hosts</primary>
2840 </indexterm><indexterm>
2841 <primary>/etc/nsswitch.conf</primary>
2842 </indexterm><indexterm>
2843 <primary>NSS</primary>
2844 </indexterm><indexterm>
2845 <primary>/etc/hosts</primary>
2846 </indexterm><indexterm>
2847 <primary>WINS</primary>
2848 <secondary>lookup</secondary>
2850 Samba depends on correctly functioning resolution of hostnames to their IP address. Samba
2851 makes no direct DNS lookup calls, but rather redirects all name-to-address calls via the
2852 <command>getXXXbyXXX()</command> function calls. The configuration of the <constant>hosts</constant>
2853 entry in the NSS <filename>/etc/nsswitch.conf</filename> file determines how the underlying
2854 resolution process is implemented. If the <constant>hosts</constant> entry in your NSS
2857 hosts: files dns wins
2859 this means that a hostname lookup first tries the <filename>/etc/hosts</filename>.
2860 If this fails to resolve, it attempts a DNS lookup, and if that fails, it tries a
2865 <primary>NetBIOS</primary>
2866 </indexterm><indexterm>
2867 <primary>TCP/IP</primary>
2868 </indexterm><indexterm>
2869 <primary>name resolution</primary>
2871 The addition of the WINS-based name lookup makes sense only if NetBIOS over TCP/IP has
2872 been enabled on all Windows clients. Where NetBIOS over TCP/IP has been disabled, DNS
2873 is the preferred name resolution technology. This usually makes most sense when Samba
2874 is a client of an Active Directory domain, where NetBIOS use has been disabled. In this
2875 case, the Windows 200x autoregisters all locator records it needs with its own DNS
2886 Our Windows 2003 Server Active Directory domain runs with NetBIOS disabled. Can we
2887 use Samba-3 with that configuration?
2904 <primary>net</primary>
2905 <secondary>ads</secondary>
2906 <tertiary>join</tertiary>
2907 </indexterm><indexterm>
2908 <primary>net</primary>
2909 <secondary>rpc</secondary>
2910 <tertiary>join</tertiary>
2912 When I tried to execute net ads join, I got no output. It did not work, so
2913 I think that it failed. I then executed net rpc join and that worked fine.
2914 That is okay, isn't it?
2921 <primary>Kerberos</primary>
2922 </indexterm><indexterm>
2923 <primary>authentication</primary>
2925 No. This is not okay. It means that your Samba-3 client has joined the ADS domain as
2926 a Windows NT4 client, and Samba-3 will not be using Kerberos-based authentication.