From 28a4f3926c597927c02d999b61c24694c59eded2 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 2 Feb 2002 04:58:57 +0000 Subject: merge from 2.2 (This used to be commit a60be0216eb3d0c76f93ec3a3edd861861cb1a4e) --- docs/docbook/projdoc/Samba-LDAP-HOWTO.sgml | 225 +++++++++++++++++++++++------ 1 file changed, 179 insertions(+), 46 deletions(-) (limited to 'docs/docbook') diff --git a/docs/docbook/projdoc/Samba-LDAP-HOWTO.sgml b/docs/docbook/projdoc/Samba-LDAP-HOWTO.sgml index 802585d4f2..aabc052055 100644 --- a/docs/docbook/projdoc/Samba-LDAP-HOWTO.sgml +++ b/docs/docbook/projdoc/Samba-LDAP-HOWTO.sgml @@ -2,15 +2,20 @@ - Gerald (Jerry)>Carter> + Gerald (Jerry)>Carter Samba Team
jerry@samba.org
+ Olivier (lem)>Lemaire + + IDEALX +
olem@IDEALX.org
+
- (29 Dec 2001) + (13 Jan 2002)
Storing Samba's User/Machine Account information in an LDAP Directory @@ -20,7 +25,7 @@ This document describes how to use an LDAP directory for storing Samba user -account information normally stored in the smbpasswd(5) file. It is +account information traditionally stored in the smbpasswd(5) file. It is assumed that the reader already has a basic understanding of LDAP concepts and has a working directory server already installed. For more information on LDAP architectures and Directories, please refer to the following sites. @@ -37,11 +42,19 @@ a guide to LDAP for System Administrators which has a planned release date of early summer, 2002. -It may also be helpful to supplement the reading of the HOWTO with -the Samba-PDC-LDAP-HOWTO -maintained by Ignacio Coupeau. + +Two additional Samba resources which may prove to be helpful are + + The Samba-PDC-LDAP-HOWTO + maintained by Ignacio Coupeau. + + The NT migration scripts from IDEALX that are + geared to manage users and group in such a Samba-LDAP Domain Controller configuration. + + + @@ -57,32 +70,34 @@ disadvantages to this approach for sites with very large numbers of users (count in the thousands). - + + The first is that all lookups must be performed sequentially. Given that there are approximately two lookups per domain logon (one for a normal session connection such as when mapping a network drive or printer), this -is non-optimal. What is needed is an indexed approach such as is used in -databases. - +is a performance bottleneck for lareg sites. What is needed is an indexed approach +such as is used in databases. + - + The second problem is that administrators who desired to replicate a smbpasswd file to more than one Samba server were left to use external tools such as rsync(1) and ssh(1) and wrote custom, in-house scripts. - + - + And finally, the amount of information which is stored in an smbpasswd entry leaves no room for additional attributes such as a home directory, password expiration time, or even a Relative Identified (RID). - + + As a result of these defeciencies, a more robust means of storing user attributes used by smbd was developed. The API which defines access to user accounts -is referred to as the samdb interface (previously this was called the passdb +is commonly referred to as the samdb interface (previously this was called the passdb API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support for a samdb backend (e.g. --with-ldapsam or --with-tdbsam) requires compile time support. @@ -153,7 +168,7 @@ objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $ logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $ displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $ - description $ userWorkstations $ primaryGroupID )) + description $ userWorkstations $ primaryGroupID $ domain )) @@ -173,6 +188,9 @@ in the directory. However, there are several fields (e.g. uid) which overlap with the posixAccount objectclass outlined in RFC2307. This is by design. + + In order to store all user account information (UNIX and Samba) in the directory, it is necessary to use the sambaAccount and posixAccount objectclasses in @@ -183,6 +201,14 @@ and functioning correctly. This division of information makes it possible to store all Samba account information in LDAP, but still maintain UNIX account information in NIS while the network is transitioning to a full LDAP infrastructure. + + + +Configuring Samba with LDAP + + + +OpenLDAP configuration To include support for the sambaAccount object in an OpenLDAP directory @@ -218,14 +244,34 @@ include /etc/openldap/schema/samba.schema .... + +It is recommended that you maintain some indices on some of the most usefull attributes, +like in the following example, to speed up searches made on sambaAccount objectclasses +(and possibly posixAccount and posixGroup as well). + + +# Indices to maintain +## required by OpenLDAP 2.0 +index objectclass eq + +## support pb_getsampwnam() +index uid pres,eq +## support pdb_getsambapwrid() +index rid eq + +## uncomment these if you are storing posixAccount and +## posixGroup entries in the directory as well +##index uidNumber eq +##index gidNumber eq +##index cn eq +##index memberUid eq + + - - - - - -smb.conf LDAP parameters + +Configuring Samba + The following parameters are available in smb.conf only with --with-ldapsam @@ -263,7 +309,7 @@ use with an LDAP directory could appear as # must be set by using 'smbpasswd -w secretpw' to store the # passphrase in the secrets.tdb file. If the "ldap admin dn" values # changes, this password will need to be reset. - ldap admin dn = "cn=Manager,dc=samba,dc=org" + ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org" # specify the LDAP server's hostname (defaults to locahost) ldap server = ahab.samba.org @@ -284,11 +330,36 @@ use with an LDAP directory could appear as - + + +Accounts and Groups management + + +As users accounts are managed thru the sambaAccount objectclass, you should +modify you existing administration tools to deal with sambaAccount attributes. + + + +Machines accounts are managed with the sambaAccount objectclass, just +like users accounts. However, it's up to you to stored thoses accounts +in a different tree of you LDAP namespace: you should use +"ou=Groups,dc=plainjoe,dc=org" to store groups and +"ou=People,dc=plainjoe,dc=org" to store users. Just configure your +NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration +file). + + + +In Samba release 2.2.3, the group management system is based on posix +groups. This meand that Samba make usage of the posixGroup objectclass. +For now, there is no NT-like group system management (global and local +groups). + + Security and sambaAccount @@ -308,7 +379,9 @@ of sambaAccount entries in the directory. These password hashes are clear text equivalents and can be used to impersonate -the user without deriving the original clear text strings. +the user without deriving the original clear text strings. For more information +on the details of LM/NT password hashes, refer to the ENCRYPTION chapter of the Samba-HOWTO-Collection. @@ -321,6 +394,12 @@ LDAPS. In either case, you are strongly discouraged to disable this security (ldap ssl = off). + +Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS +extended operation. However, the OpenLDAP library still provides support for +the older method of securing communication between clients and servers. + + The second security precaution is to prevent non-administrative users from harvesting password hashes from the directory. This can be done using the @@ -328,48 +407,102 @@ following ACL in slapd.conf: -## allow users to update their own password, but not to browse others -access to attrs=userPassword,lmPassword,ntPassword - by self write - by * auth +## allow the "ldap admin dn" access, but deny everyone else +access to attrs=lmPassword,ntPassword + by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write + by * none - -You may of course, add in write access to administrative DN's as necessary. - - +LDAP specials attributes for sambaAccounts + + +The sambaAccount objectclass is composed of the following attributes: + + + + + lmPassword: the LANMAN password 16-byte hash stored as a character + representation of a hexidecimal string. + + ntPassword: the NT password hash 16-byte stored as a character + representation of a hexidecimal string. + pwdLastSet: The integer time in seconds since 1970 when the + lmPassword and ntPassword attributes were last set. + + + acctFlags: string of 11 characters surrounded by square brackets [] + representing account flags such as U (user), W(workstation), X(no password expiration), and + D(disabled). + + logonTime: Integer value currently unused + + logoffTime: Integer value currently unused + + kickoffTime: Integer value currently unused + + pwdCanChange: Integer value currently unused + + pwdMustChange: Integer value currently unused + + homeDrive: specifies the drive letter to which to map the + UNC path specified by homeDirectory. The drive letter must be specified in the form "X:" + where X is the letter of the drive to map. Refer to the "logon drive" parameter in the + smb.conf(5) man page for more information. + + scriptPath: The scriptPath property specifies the path of + the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path + is relative to the netlogon share. Refer to the "logon script" parameter in the + smb.conf(5) man page for more information. + + profilePath: specifies a path to the user's profile. + This value can be a null string, a local absolute path, or a UNC path. Refer to the + "logon path" parameter in the smb.conf(5) man page for more information. + + smbHome: The homeDirectory property specifies the path of + the home directory for the user. The string can be null. If homeDrive is set and specifies + a drive letter, homeDirectory should be a UNC path. The path must be a network + UNC path of the form \\server\share\directory. This value can be a null string. + Refer to the "logon home" parameter in the smb.conf(5) man page for more information. + + + userWorkstation: character string value currently unused. + + + rid: the integer representation of the user's relative identifier + (RID). + + primaryGroupID: the relative identifier (RID) of the primary group + of the user. + + -There are currently four sambaAccount attributes which map directly onto -smb.conf parameters. +The majority of these parameters are only used when Samba is acting as a PDC of +a domain (refer to the Samba-PDC-HOWTO for details on +how to configure Samba as a Primary Domain Controller). The following four attributes +are only stored with the sambaAccount entry if the values are non-default values: - smbHome -> "logon home" - profilePath -> "logon path" - homeDrive -> "logon drive" - scriptPath -> "logon script" + smbHome + scriptPath + logonPath + homeDrive -First of all, these parameters are only used when Samba is acting as a -PDC or a domain (refer to the Samba-PDC-HOWTO -for details on how to configure Samba as a Primary Domain Controller). -Furthermore, these attributes are only stored with the sambaAccount entry if +These attributes are only stored with the sambaAccount entry if the values are non-default values. For example, assume TASHTEGO has now been configured as a PDC and that logon home = \\%L\%u was defined in its smb.conf file. When a user named "becky" logons to the domain, the logon home string is expanded to \\TASHTEGO\becky. - - - If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org", this value is used. However, if this attribute does not exist, then the value of the logon home parameter is used in its place. Samba -- cgit