LinuxForum.Fans
Тема

Ошибки в связке openLDAP+samba

Автор: ap0st0l 26 сообщений 11882 просмотров
#2684

Всем привет,

со вчерашнего дня посыпались ошибки в /var/log/syslog такого характера:

text
Feb 25 20:23:53 dc02 slapd[5677]: <= bdb_equality_candidates: (gidNumber) not indexed
Feb 25 20:23:53 dc02 slapd[5677]: <= bdb_equality_candidates: (sambaSID) not indexed
Feb 25 20:23:53 dc02 slapd[5677]: <= bdb_equality_candidates: (sambaSID) not indexed
Feb 25 20:23:55 dc02 slapd[5677]: <= bdb_equality_candidates: (uid) not indexed
Feb 25 20:23:55 dc02 slapd[5677]: <= bdb_equality_candidates: (uid) not indexed

И все время повторяются. Хотя ldapserch просматривает БД без ошибок, к серверу подключаюсь, так же без ошибок могу создать пользователя, но когда пытаюсь под этим пользователем зайти, пишет что домена не существует.

Не могу понять в чем причина.
Есть мнения?

Заранее спасибо :)

#2691

Покажите конфиги самбы с лдапом, а также какие права на файлы в директории /var/lib/ldap/

#2692

При запуске сервиса:

text
Feb 25 20:37:56 dc02 slapd[12165]: @(#) $OpenLDAP: slapd 2.4.9 (Mar 31 2009 07:12:16) $ ^Ibuildd@rothera:/build/buildd/openldap2.3-2.4.9/debian/build/servers/slapd
Feb 25 20:37:56 dc02 slapd[12166]: slapd starting
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (gidNumber) not indexed
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSID) not indexed
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaGroupType) not indexed
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSIDList) not indexed
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaGroupType) not indexed
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSIDList) not indexed
Feb 25 20:37:56 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSID) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaGroupType) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSIDList) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaGroupType) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSIDList) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (sambaSID) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (uid) not indexed
Feb 25 20:37:57 dc02 slapd[12166]: <= bdb_equality_candidates: (uid) not indexed
Feb 25 20:38:02 dc02 slapd[12166]: <= bdb_equality_candidates: (uid) not indexed
Feb 25 20:38:02 dc02 slapd[12166]: <= bdb_equality_candidates: (uid) not indexed

но сервис все равно стартанул:

text
root@dc02:/var/log# ps ax | grep slapd
12166 ?        Ssl    0:00 /usr/sbin/slapd -g openldap -u openldap -f /etc/ldap/slapd.conf
12379 pts/1    S+     0:00 grep slapd
root@dc02:/var/log# ps ax | grep smb
 5663 ?        Ss     0:00 /usr/sbin/smbd -D
 5666 ?        S      0:00 /usr/sbin/smbd -D
12384 ?        S      0:00 /usr/sbin/smbd -D
12386 pts/1    S+     0:00 grep smb
#2702
Hrafn написал:
Покажите конфиги самбы с лдапом, а также какие права на файлы в директории /var/lib/ldap/

Все же хотелось бы увидеть. Пока в основном второе интересует

Посмотрите также тут: http://ubuntuforums.org/showthread.php?t=1196622

#2709

Права впорядке:

text
root@dc02:~# ls -l /var/lib/ldap
total 1164
-rw-r--r-- 1 openldap openldap    2048 2010-02-25 20:37 alock
-rw------- 1 openldap openldap    8192 2010-02-25 21:01 __db.001
-rw------- 1 openldap openldap 2629632 2010-02-25 21:01 __db.002
-rw------- 1 openldap openldap   98304 2010-02-25 20:37 __db.003
-rw------- 1 openldap openldap  565248 2010-02-25 21:01 __db.004
-rw------- 1 openldap openldap   24576 2010-02-25 20:37 __db.005
-rw-r--r-- 1 openldap openldap      96 2010-01-20 16:30 DB_CONFIG
-rw------- 1 openldap openldap   20480 2010-02-25 17:38 dn2id.bdb
-rw------- 1 openldap openldap   98304 2010-02-25 17:38 id2entry.bdb
-rw------- 1 openldap openldap  442977 2010-02-25 20:37 log.0000000001
-rw------- 1 openldap openldap    8192 2010-02-25 17:38 objectClass.bdb
#2716

Попробуйте исправить ситуацию как описано по ссылке, которую я последней указал

#2719

Запустился без ошибок, хмм...не понял что было :(

#2723

Просто запустился сам и все? :)
Ну вот и славно

#2725

Спустя 3 минуты в syslog`е сново:

text
Feb 25 21:11:34 dc02 slapd[12839]: slapd starting
Feb 25 21:14:40 dc02 slapd[12839]: <= bdb_equality_candidates: (uid) not indexed
Feb 25 21:14:40 dc02 slapd[12839]: <= bdb_equality_candidates: (uid) not indexed
Feb 25 21:14:40 dc02 slapd[12839]: <= bdb_equality_candidates: (gidNumber) not indexed
Feb 25 21:14:40 dc02 slapd[12839]: <= bdb_equality_candidates: (sambaSID) not indexed
Feb 25 21:14:40 dc02 slapd[12839]: <= bdb_equality_candidates: (sambaSID) not indexed
#2726

Значит не славно :(
Попробуйте все же:
остановите slapd
запустите slapindex
затем chown openldap:openldap /var/lib/ldap/*
и запускайте slapd

#2732

Странно, говорит нет прав:

text
root@dc02:/var/log# slapindex

WARNING! Runnig as root! There's a fair chance slapd will fail to start. Check file permissions!

#2738

во, а теперь:

text
chown openldap:openldap /var/lib/ldap/*

и запустить slapd

#2739

Мда... :(

text
root@dc02:/var/log# chown openldap:openldap /var/lib/ldap/*
root@dc02:/var/log# ps ax | grep slap
12976 pts/3    S+     0:00 grep slap
root@dc02:/var/log# slapindex

WARNING! Runnig as root! There's a fair chance slapd will fail to start. Check file permissions!

root@dc02:/var/log# chown openldap:openldap /var/lib/ldap/* root@dc02:/var/log# /etc/init.d/slapd start Starting OpenLDAP: slapd. root@dc02:/var/log# ps ax | grep slap 12983 ? Ssl 0:00 /usr/sbin/slapd -g openldap -u openldap -f /etc/ldap/slapd.conf 12987 pts/3 S+ 0:00 grep slap root@dc02:/var/log# cat syslog Feb 25 21:38:47 dc02 slapd[12983]: slapd starting Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSID) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaGroupType) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSIDList) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaGroupType) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSIDList) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSID) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaGroupType) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSIDList) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaGroupType) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSIDList) not indexed Feb 25 21:38:48 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSID) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (gidNumber) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSID) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaGroupType) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSIDList) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaGroupType) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSIDList) not indexed Feb 25 21:39:33 dc02 slapd[12983]: <= bdb_equality_candidates: (sambaSID) not indexed

не могу даже представить, почему могли права сбиться?

#2746

Покажите все же конфиг самбы
Похоже, решения знаю, но надо проверить конфиг

#2749

/etc/samba/smb.conf

text
[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of workgroup = GSP

# server string is the equivalent of the NT Description field server string = gsp server netbios name = dc02

# Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server ; wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS. dns proxy = no

# What naming service and in what order should we use to resolve host names # to IP addresses ; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to # This can be either the interface name or an IP address/netmask; # interface names are normally preferred ; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the # 'interfaces' option above to use this. # It is recommended that you enable this feature if your Samba machine is # not protected by a firewall or is a firewall itself. However, this # option cannot handle dynamic or non-broadcast interfaces correctly. ; bind interfaces only = true

#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine # that connects log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB). max log size = 0

# If you want Samba to only log through syslog then set the following # parameter to 'yes'. ; syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log # through syslog you should set the following parameter to something higher. syslog = 0 log level = 0 vfs:2

# Do something sensible when Samba crashes: mail the admin a backtrace panic action = /usr/share/samba/panic-action %d

####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user

# You may wish to use password encryption. See the section on # 'encrypt passwords' in the smb.conf(5) manpage before enabling. encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what # password database type you are using. # passdb backend = tdbsam passdb backend = ldapsam:ldap://localhost/

obey pam restrictions = no

####################################################################### #COPY AND PASTE THE FOLLOWING UNDERNEATH "OBEY PAM RESTRICTIONS = NO" ####################################################################### # # Begin: Custom LDAP Entries # ldap admin dn = cn=admin,dc=gsp,dc=local ldap suffix = dc=gsp, dc=local ldap group suffix = ou=Groups ldap user suffix = ou=Users ldap machine suffix = ou=Computers ldap idmap suffix = ou=Users ; Do ldap passwd sync ldap passwd sync = Yes passwd program = /usr/sbin/smbldap-passwd %u passwd chat = *New*password* %n\n *Retype*new*password* %n\n *all*authentication*tokens*updated* add user script = /usr/sbin/smbldap-useradd -m "%u" ldap delete dn = Yes delete user script = /usr/sbin/smbldap-userdel "%u" add machine script = /usr/sbin/smbldap-useradd -w "%u" add group script = /usr/sbin/smbldap-groupadd -p "%g" delete group script = /usr/sbin/smbldap-groupdel "%g" add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g" delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g" set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u" domain logons = yes # # End: Custom LDAP Entries # ##################################################### #STOP COPYING HERE! #####################################################

; guest account = nobody ; invalid users = root

# This boolean parameter controls whether Samba attempts to sync the Unix # password with the SMB password when the encrypted SMB password in the # passdb is changed. unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following # parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for # sending the correct chat script for the passwd program in Debian Sarge). # passwd program = /usr/bin/passwd %u # passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes # when requested by an SMB client instead of the program listed in # 'passwd program'. The default is 'no'. pam password change = yes

# This option controls how nsuccessful authentication attempts are mapped # to anonymous connections map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC # must have this setting enabled. If you are the BDC you must # change the 'domain master' setting to no # ; domain logons = yes # # The following setting only takes effect if 'domain logons' is set # It specifies the location of the user's profile directory # from the client point of view) # The following required a [profiles] share to be setup on the # samba server (see below) logon path = # Another common choice is storing the profile in the user's home directory logon path =

# The following setting only takes effect if 'domain logons' is set # It specifies the location of a user's home directory (from the client # point of view) logon drive = logon home =

# The following setting only takes effect if 'domain logons' is set # It specifies the script to run during logon. The script must be stored # in the [netlogon] share # NOTE: Must be store in 'DOS' file format convention logon script = logon.vbs

# This allows Unix users to be created on the domain controller via the SAMR # RPC pipe. The example command creates a user account with a disabled Unix # password; please adapt to your needs ; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather # than setting them up individually then you'll need this ; load printers = yes

# lpr(ng) printing. You may wish to override the location of the # printcap file ; printing = bsd ; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the # cupsys-client package. ; printing = cups ; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration # on a per machine basis. The %m gets replaced with the netbios name # of the machine that is connecting ; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance. # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html # for details # You may want to add the following on a Linux system: # SO_RCVBUF=8192 SO_SNDBUF=8192 socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package # installed. The samba maintainer and the linpopup maintainer are # working to ease installation and configuration of linpopup and samba. ; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this # machine will be configured as a BDC (a secondary logon server), you # must set this to 'no'; otherwise, the default behavior is recommended. domain master = yes local master = yes os level = 33

# Some defaults for winbind (make sure you're not using the ranges # for something else.) ; idmap uid = 10000-20000 ; idmap gid = 10000-20000 ; template shell = /bin/bash

# The following was the default behaviour in sarge, # but samba upstream reverted the default because it might induce # performance issues in large organizations. # See Debian bug #368251 for some of the consequences of *not* # having this setting and smb.conf(5) for details. ; winbind enum groups = yes ; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders # with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled. ; usershare max shares = 100

# Allow users who've been granted usershare privileges to create # public shares, not just authenticated ones usershare allow guests = yes

/etc/ldap/slapd.conf

text
#######################################################################
# Global Directives:

# Features to permit #allow bind_v2

# Schema and objectClass definitions include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/nis.schema include /etc/ldap/schema/inetorgperson.schema include /etc/ldap/schema/samba.schema include /etc/ldap/schema/misc.schema

# Where the pid file is put. The init.d script # will not stop the server if you change this. pidfile /var/run/slapd/slapd.pid

# List of arguments that were passed to the server argsfile /var/run/slapd/slapd.args

# Read slapd.conf(5) for possible values loglevel none

# Where the dynamically loaded modules are stored modulepath /usr/lib/ldap moduleload back_bdb

# The maximum number of entries that is returned for a search operation sizelimit 500

# The tool-threads parameter sets the actual amount of cpu's that is used # for indexing. tool-threads 1

####################################################################### # Specific Backend Directives for bdb: # Backend specific directives apply to this backend until another # 'backend' directive occurs backend bdb

####################################################################### # Specific Backend Directives for 'other': # Backend specific directives apply to this backend until another # 'backend' directive occurs #backend <other>

####################################################################### # Specific Directives for database #1, of type bdb: # Database specific directives apply to this databasse until another # 'database' directive occurs database bdb

# The base of your directory in database #1 suffix "dc=gsp,dc=local"

# rootdn directive for specifying a superuser on the database. This is needed # for syncrepl. # rootdn "cn=admin,dc=gsp,dc=local"

# Where the database file are physically stored for database #1 directory "/var/lib/ldap" #directory "/ldap_data"

# The dbconfig settings are used to generate a DB_CONFIG file the first # time slapd starts. They do NOT override existing an existing DB_CONFIG # file. You should therefore change these settings in DB_CONFIG directly # or remove DB_CONFIG and restart slapd for changes to take effect.

# For the Debian package we use 2MB as default but be sure to update this # value if you have plenty of RAM dbconfig set_cachesize 0 2097152 0

# Sven Hartge reported that he had to set this value incredibly high # to get slapd running at all. See http://bugs.debian.org/303057 for more # information.

# Number of objects that can be locked at the same time. dbconfig set_lk_max_objects 1500 # Number of locks (both requested and granted) dbconfig set_lk_max_locks 1500 # Number of lockers dbconfig set_lk_max_lockers 1500

# Indexing options for database #1 index objectClass eq

# Save the time that the entry gets modified, for database #1 lastmod on

# Checkpoint the BerkeleyDB database periodically in case of system # failure and to speed slapd shutdown. checkpoint 512 30

# Where to store the replica logs for database #1 # replogfile /var/lib/ldap/replog

# The userPassword by default can be changed # by the entry owning it if they are authenticated. # Others should not be able to see it, except the # admin entry below # These access lines apply to database #1 only access to attrs=userPassword,shadowLastChange,sambaNTPassword,sambaLMPassword by dn="cn=admin,dc=gsp,dc=local" write by anonymous auth by self write by * none

# Ensure read access to the base for things like # supportedSASLMechanisms. Without this you may # have problems with SASL not knowing what # mechanisms are available and the like. # Note that this is covered by the 'access to *' # ACL below too but if you change that as people # are wont to do you'll still need this if you # want SASL (and possible other things) to work # happily. access to dn.base="" by * read

# The admin dn has full write access, everyone else # can read everything. access to * by dn="cn=admin,dc=gsp,dc=local" write by * read

# For Netscape Roaming support, each user gets a roaming # profile for which they have write access to #access to dn=".*,ou=Roaming,o=morsnet" # by dn="cn=admin,dc=gsp,dc=local" write # by dnattr=owner write

####################################################################### # Specific Directives for database #2, of type 'other' (can be bdb too): # Database specific directives apply to this databasse until another # 'database' directive occurs #database <other>

# The base of your directory for database #2 #suffix "dc=debian,dc=org"

#2753

Так, или проверьте самостоятельно вот что:
есть ли в slapd.conf в секции database следующие строки:

text
# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,sn,mail,givenname           eq,pres,sub
index uidNumber,gidNumber,memberUid     eq,pres
index loginShell                        eq,pres
# I also added this line to stop warning in syslog ..
index uniqueMember                      eq,pres
## required to support pdb_getsampwnam
index uid                               pres,sub,eq
## required to support pdb_getsambapwrid()
index displayName                       pres,sub,eq
# These attributes don't exist in this database ..
#index nisMapName,nisMapEntry            eq,pres,sub
index sambaSID                          eq
index sambaPrimaryGroupSID              eq
index sambaDomainName                   eq
index default                           sub

если нет - добавьте
а далее снова остановка slapd, slapindex, выставление прав на каталог и запуск slapd

Пробуйте, должно помочь

#2768

Добавил, проверил...все тоже самое

#2773

Добавили, остановили, вновь создали индексные файлы, дали на них права, запустили?
Я извиняюсь, что переспрашиваю постоянно. Просто чтобы быть полностью уверенным.

#2776

Совершенно верно, остановил сервис slapd, добавил в файл /etc/ldap/slapd.conf то что вы написали, запустил команду slapindex, дал права на базу и запустил

Ошибки:

text
Feb 25 22:23:12 dc02 slapd[13284]: <= bdb_equality_candidates: (sambaGroupType) not indexed
Feb 25 22:23:12 dc02 slapd[13284]: <= bdb_equality_candidates: (sambaSIDList) not indexed

Может быть еще добавить в /etc/ldap/slapd.conf:

text
index sambaGroupType                   eq
index sambaSIDList                   eq

?

#2784

Да

Войдите или зарегистрируйтесь, чтобы ответить.