PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Samba/OpenLDAP Integration ohne smbldap-tools nach ix 05/08



Jorge
24.04.08, 12:37
Hallo zusammen,

bin gerade dabei mich näher mit Samba bzw. der Integration von LDAP zu befassen und betrete damit Neuland. Da in nächster Zeit unser bestehender Samba PDC (ebenfalls mit LDAP integration) durch eine neue Maschine ersetzt werden soll, und in der aktuellen iX ein passender Artikel ist, habe ich mich daran versucht - leider bisher mit mäßigem Erfolg.

Als System dient mir eine openSuSE 10.3 mit Samba 3.026a.

Meine smb.conf:



[global]
workgroup = ES-TEST
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
usershare allow guests = Yes

#PDC Konfiguration
domain master = yes
domain logons = yes
logon path = \\%N\profiles\%U\%a
logon drive = U:

# Winbind Konfiguration
workgroup = ES-TEST
idmap domains = ES-TEST
idmap alloc backend = ldap
idmap alloc config:ldap_base_dn = ou=idmap,dc=element-system,dc=de
idmap alloc config:ldap_user_dn = cn=samba,dc=element-system,dc=de
idmap alloc config:ldap_url = ldap://localhost
idmap alloc config:range = 50000-500000

# LDAP Konfiguration

passdb backend = ldapsam
ldap admin dn = cn=samba,dc=element-system,dc=de
ldap suffix = dc=element-system,dc=de
ldap user suffix = ou=users
ldap group suffix = ou=groups
ldap machine suffix = ou=computers
ldap idmap suffix = ou=idmap
ldapsam:trusted = yes
ldapsam:editposix = yes


Der User "samba" wurde mittels "smbpasswd -W" erfolgreich mit dem entsprechenden Passwort versehen.

Meine slapd.conf:


#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/rfc2307bis.schema
include /etc/openldap/schema/yast.schema
include /etc/openldap/schema/samba3.schema
# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile /var/run/slapd/slapd.pid
argsfile /var/run/slapd/slapd.args

# Load dynamic backend modules:
modulepath /usr/lib/openldap/modules
# moduleload back_ldap.la
# moduleload back_meta.la
# moduleload back_monitor.la
# moduleload back_perl.la

# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access to user password
# Allow anonymous users to authenticate
# Allow read access to everything else
# Directives needed to implement policy:
access to dn.base=""
by dn="cn=samba,dc=element-system,dc=de" write
by * read

access to dn.base="cn=Subschema"
by * read

access to attrs=userPassword,userPKCS12
by self write
by * auth

access to attrs=shadowLastChange
by self write
by * read

access to *
by dn="cn=samba,dc=element-system,dc=de" write
by * read

# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!

################################################## #####################
# BDB database definitions
################################################## #####################
database bdb
suffix "dc=element-system,dc=de"
checkpoint 1024 5
cachesize 10000
rootdn "cn=Manager,dc=element-system,dc=de"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap
# Indices to maintain
index objectClass eq
index uidNumber eq
index gidNumber eq
index memberUid eq
index sambaSID eq
index sambaPrimaryGroupSID eq
index sambaDomainName eq
index default sub
loglevel 0


Der LDAP ist mit folgenden Daten grundbefüllt:



dn: dc=element-system,dc=de
objectClass: top
objectClass: dcObject
objectClass: organization
o: element-system.de
dc: element-system

dn: cn=Manager,dc=element-system,dc=de
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: Manager
description: LDAP administrator
userPassword: secret

dn: cn=samba,dc=element-system,dc=de
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: samba
description: Samba user to connect to LDAP
userPassword: secret

dn: ou=users,dc=element-system,dc=de
objectClass: top
objectClass: organizationalUnit
ou: users

dn: ou=groups,dc=element-system,dc=de
objectClass: top
objectClass: organizationalUnit
ou: groups

dn: ou=idmap,dc=element-system,dc=de
objectClass: top
objectClass: organizationalUnit
ou: idmap

dn: ou=computers,dc=element-system,dc=de
objectClass: top
objectClass: organizationalUnit
ou: computers


Die /etc/ldap.conf:


host 127.0.0.1
base dc=element-system,dc=de
pam_lookup_policy yes
pam_password exop
nss_initgroups_ignoreusers root,ldap
nss_schema rfc2307bis
nss_map_attribute uniqueMember member
ssl off
ldap_version 3
pam_filter objectclass=posixAccount
nss_base_passwd ou=users,dc=element-system,dc=de
nss_base_shadow ou=users,dc=element-system,dc=de
nss_base_group ou=groups,dc=element-system,dc=de
tls_checkpeer no


Warum gibt es eigentlich und /etc/openldap/ nochmals eine ldap.conf? Aber das nur am Rande.


Folgender Status:

- winbind läuft
- slapd läuft

Wenn ich nun mittels "net sam provision" die Grundversorgung durchführen will, geschieht folgendes:



smbdc:/etc/openldap # net sam provision
Checking for Domain Users group.
Adding the Domain Users group.
Unable to allocate a new gid to create Domain Users group!
Checking for Domain Admins group.
Adding the Domain Admins group.
Unable to allocate a new gid to create Domain Admins group!
Check for Administrator account.
Adding the Administrator user.
Can't create Administrator user, Domain Admins group not available!


Der winbind loggt folgendes:



Apr 24 13:18:19 smbdc winbindd[12672]: [2008/04/24 13:18:19, 0] nsswitch/idmap_ldap.c:get_credentials(100)
Apr 24 13:18:19 smbdc winbindd[12672]: get_credentials: Unable to fetch auth credentials for cn=samba,dc=element-system,dc=de in ALLOC
Apr 24 13:18:19 smbdc winbindd[12672]: [2008/04/24 13:18:19, 0] nsswitch/idmap.c:idmap_alloc_init(735)
Apr 24 13:18:19 smbdc winbindd[12672]: ERROR: Initialization failed for alloc backend, deferred!
Apr 24 13:18:19 smbdc winbindd[12672]: [2008/04/24 13:18:19, 0] nsswitch/idmap_ldap.c:get_credentials(100)
Apr 24 13:18:19 smbdc winbindd[12672]: get_credentials: Unable to fetch auth credentials for cn=samba,dc=element-system,dc=de in ALLOC
Apr 24 13:18:19 smbdc winbindd[12672]: [2008/04/24 13:18:19, 0] nsswitch/idmap.c:idmap_alloc_init(735)
Apr 24 13:18:19 smbdc winbindd[12672]: ERROR: Initialization failed for alloc backend, deferred!


Es sieht also so aus als könnte der winbind sich nicht als Benutzer "samba" beim LDAP Server anmelden. Allerdings funktioniert "ldapsearch -x -D "cn=samba,dc=element-system,dc=de" -W -b "dc=element-system,dc=de" ohne Probleme.

Ich vermute fast, dass das Passwort von Samba irgendwie falsch (unterschiedliche Verschlüsselung des Samba und des LDAP PWs?) ist...

Hat mir hier jemand einen Tipp?

emba
13.05.08, 15:42
kannst du es bitte mal mit verschlüsselten PWs im DIT versuchen?
die zwei ldap.conf dateien sind für unterschiedliche zwecke. die eine (/etc) ist für libnss_ldap, die andere (/etc/ldap) für den openldap client

gruesse