LDAP (Нет коннекта с сервером)

Для новичков как вообще в Linux, так и в конкретной теме, к которой относится вопрос.

Модератор: Bizdelnick

Аватара пользователя
Corsair
Сообщения: 842
Статус: Местный "тролль"
ОС: Fedora

LDAP

Сообщение Corsair »

Поставил OpenLDAP-сервер на седьмую Федору, настроит в соответствии с мануалом с офсайта.
Потом поставил phpldapadmin и настроил в нем домен. все прекрасно работает, никаких ошибок вроде нет, НО клиенты не коннектятся к серверу.
IPTables отключен.
SELinux тоже.
В /etc/hosts.allow: slapd: 192.168.160.0/24 127.0.0.1

Причем, с помощью утилиты ldapsearch с клиента нахожу пользовательские бюджеты на лдап-сервере
Но когда хочу узнать инфо об учетной записи тестового пользователя, который не существует локально, но есть в лдап-сервере, с помощью getent passwd | grep ^buster, утилита примерно с минуту просто висит в форграунде (видимо долбится на сервер), а потом завершается и шелл выдает приглашение для дальнейших команд. Ума не приложу в чем дело...

Настройка сервера. Файл 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/nis.schema
include        /etc/openldap/schema/misc.schema

# Allow LDAPv2 client connections.  This is NOT the default.
allow bind_v2

# 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/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args

# Load dynamic backend modules:
# modulepath    /usr/lib/openldap
# moduleload accesslog.la
# moduleload auditlog.la
# moduleload back_sql.la
# moduleload denyop.la
# moduleload dyngroup.la
# moduleload dynlist.la
# moduleload lastmod.la
# moduleload pcache.la
# moduleload ppolicy.la
# moduleload refint.la
# moduleload retcode.la
# moduleload rwm.la
# moduleload syncprov.la
# moduleload translucent.la
# moduleload unique.la
# moduleload valsort.la

# The next three lines allow use of TLS for encrypting connections using a
# dummy test certificate which you can generate by changing to
# /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it.  Your client software
# may balk at self-signed certificates, however.
# TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
# TLSCertificateFile /etc/pki/tls/certs/slapd.pem
# TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem

# 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
#        Allow authenticated users read access
#        Allow anonymous users to authenticate
#    Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
#access to *
#    by self write
#    by users read
#    by anonymous auth
#
# 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!

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database    bdb
suffix        "dc=stud,dc=rosnou,dc=ru"
rootdn        "cn=sa,dc=stud,dc=rosnou,dc=ru"
# Cleartext passwords, especially for the rootdn, should
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw        secret
# rootpw        {crypt}ijFYNcSNctBYg

# 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 for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
#     bindmethod=sasl saslmech=GSSAPI
#     authcId=host/ldap-master.example.com@EXAMPLE.COM


Настройка клиента. Файл nsswitch.conf

Код: Выделить всё

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#    nisplus or nis+        Use NIS+ (NIS version 3)
#    nis or yp        Use NIS (NIS version 2), also called YP
#    dns            Use DNS (Domain Name Service)
#    files            Use the local files
#    db            Use the local database (.db) files
#    compat            Use NIS on compat mode
#    hesiod            Use Hesiod for user lookups
#    [NOTFOUND=return]    Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files ldap
shadow:     files ldap
group:      files ldap

#hosts:     db files nisplus nis dns
hosts:      files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus


Файл ldap.conf

Код: Выделить всё

#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.
HOST    192.168.160.160
BASE    dc=stud,dc=rosnou,dc=ru
#URI    ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT    12
#TIMELIMIT    15
#DEREF        never


Файл /etc/pam.d/system-auth

Код: Выделить всё

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient      pam_ldap.so nullok
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

account        sufficient    pam_ldap.so
account     required      pam_unix.so
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so

password    sufficient    pamldap.so nullok try_first_pass use_authtok
password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    required      pam_deny.so

account     sufficient    pam_ldap.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so


PS: после перезагрузки очередь системных сообщений тоже оочень долго запускается.
slapd порт слушает.
клиентский nmap видит открытый порт на сервере
Помогите разобраться :wacko:
Жестокий стоячий админ (с) коллега
Спасибо сказали:
Аватара пользователя
Goodvin
Ведущий рубрики
Сообщения: 4333
Статус: ⚝⚠⚒⚑⚖☭☞☣☤&

Re: LDAP

Сообщение Goodvin »

Corsair писал(а):
26.09.2007 19:28
Поставил OpenLDAP-сервер на седьмую Федору, настроит в соответствии с мануалом с офсайта.
Потом поставил phpldapadmin и настроил в нем домен.
В каком смысле "домен" ? Виндовый ?
Спасибо сказали:
Аватара пользователя
Corsair
Сообщения: 842
Статус: Местный "тролль"
ОС: Fedora

Re: LDAP

Сообщение Corsair »

Ну я имею в виду, создал организацию, в пей подразделения, группы и пользователей.
А домен виндовый параллельно существует, если это имеет значение
Жестокий стоячий админ (с) коллега
Спасибо сказали:
Аватара пользователя
Corsair
Сообщения: 842
Статус: Местный "тролль"
ОС: Fedora

Re: LDAP

Сообщение Corsair »

Может хоть кто-нибудь предположение сделает о причинах таймаута соединения с ЛДАП-сервером?=) Я уже голову сломал.
Если это не фаервол и не tcp wrappers, то что еще?
А то меня уже начинают пилить на работе, не позвольте мне погибнуть =)
Жестокий стоячий админ (с) коллега
Спасибо сказали: