From 8cb4e23ffc77a9842e1304f3de20af5861982746 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 2 Feb 2002 06:08:43 +0000 Subject: merge from 2.2 and regen (This used to be commit 7b7e4190739bd7df422e3f239fd89373edb97ee5) --- docs/htmldocs/Samba-LDAP-HOWTO.html | 335 +++++++++++++++++++++++++++++++----- 1 file changed, 288 insertions(+), 47 deletions(-) (limited to 'docs/htmldocs/Samba-LDAP-HOWTO.html') diff --git a/docs/htmldocs/Samba-LDAP-HOWTO.html b/docs/htmldocs/Samba-LDAP-HOWTO.html index 9d87144c88..30bd21520a 100644 --- a/docs/htmldocs/Samba-LDAP-HOWTO.html +++ b/docs/htmldocs/Samba-LDAP-HOWTO.html @@ -33,7 +33,7 @@ NAME="AEN3" >

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.

It may also be helpful to supplement the reading of the HOWTO with -the Two additional Samba resources which may prove to be helpful are


Introduction

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.


Supported LDAP Servers


Schema and Relationship to the RFC 2307 posixAccount

The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are @@ -264,6 +291,23 @@ This means that the Samba server must also have the LDAP NSS library installed 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 server, first copy the samba.schema file to slapd's configuration directory.

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 ' 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 @@ -434,12 +501,38 @@ CLASS="REPLACEABLE" # ldap filter = "(&(uid=%u)(objectclass=sambaAccount))"


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

These password hashes are clear text equivalents and can be used to impersonate -the user without deriving the original clear text strings.

ENCRYPTION chapter of the Samba-HOWTO-Collection.

To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults to require an encrypted session (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 following ACL in

## 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

There are currently four sambaAccount attributes which map directly onto -smb.conf parameters.

The sambaAccount objectclass is composed of the following attributes:

  • smbHome -> "logon home"

    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.

  • profilePath -> "logon path"

    pwdLastSet: The integer time in seconds since 1970 when the + lmPassword and ntPassword attributes were last set. +

  • homeDrive -> "logon drive"

    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).

  • scriptPath -> "logon script"

    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.

First of all, these parameters are only used when Samba is acting as a -PDC or a domain (refer to the 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). -Furthermore, these attributes are only stored with the sambaAccount entry if +> 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

  • scriptPath

  • logonPath

  • homeDrive

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 string is expanded to \\TASHTEGO\becky.

If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org", +> 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


Example LDIF Entries for a sambaAccount


Comments