ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] настройка openldap
@ 2005-02-18  7:31 max
  2005-02-18  8:36 ` Eugene Grudina
  2005-02-23 15:42 ` Michael Shigorin
  0 siblings, 2 replies; 7+ messages in thread
From: max @ 2005-02-18  7:31 UTC (permalink / raw)
  To: Alt Alt

При настройке пользовался пакетом документации из дистр-а Мастер 2.4, система  
таже.

Цитирую:

"Для начала настроим сервер:

include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema

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

loglevel 512

database       ldbm
directory      /var/lib/ldap/base/example.com
password-hash  {MD5}

suffix         "dc=example,dc=com"
#rootdn         "cn=admin,dc=example,dc=com"
#rootpw         secret

access to attr=userPassword
  by dn=".*,ou=Admins,dc=example,dc=com"
  by anonymous auth
  by self write
  by * none
access to * by * read

index objectClass,uid,uidNumber,gidNumber     eq
index cn,mail,surname,givenname               eq,sub


После этого создадим пользователя ldap, от имени которого будет работать наш 
сервер и запустим процесс slapd следующей командой:



# slapd -u ldap -h 'ldap://127.0.0.1/ ldap//ldap.example.com/ 
ldaps://ldap.example.com'

Теперь можно создать базу данных — например, с помощью утилиты ldapadd или 
slapadd:

# ldapadd -xWD cn=admin,ou=Admins,dc=example,dc=com -H 
ldaps://ldap.altlinux.ru -f initial.ldif
или, если сервер не запущен: # slapadd -b dc=example,dc=com -l initial.ldif # 
chown ldap:ldap /var/lib/ldap/bases/example.com/*

Содержимое файла initial.ldif будет такое:

dn: dc=example,dc=com
objectClass: top
objectClass: organization
o: Exapmle Inc.
o: exapmle.com

dn: ou=Admins,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: Admins
description: Administrators

dn: cn=admin,ou=Admins,dc=exapmle,dc=com
objectClass: top
objectClass: person
cn: admin
sn: Bender
givenName: Ostap
userPassword: secret
description: Our smart admin

dn: ou=People,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: People
description: Stuff area

dn: uid=obender,ou=People,dc=example,dc=com
objectClass: top
objectClass: account
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
cn: Ostap Bender
sn: Bender
givenName: Ostap
uid: obender
uidNumber: 1000
gidNumber: 1000
homeDirectory: /home/obender
loginShell: /bin/bash
userPassword: {md5}$1$ION4SIII$EYyGEeYt4g2hEe9tjICac.
mail: obender@example.com
mail: obender@attiresandtoes.com

....

dn: ou=Groups,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: Groups
description: Groups of users

dn: cn=obender,ou=Groups,dc=example,dc=com
objectClass: top
objectClass: posixGroup
cn: luser
gidNumber: 1000
description: Default group for users presented by LDAP"


Всё зделал как написано, только в конфиг пришлось добавить:
modulepath      /usr/lib/openldap
moduleload      back_ldbm.la
Иначе была ругань на неизветный ldbm.

При старте через service, slapd стартует только на ldap://127.0.0.1
запускал так:
slapd -u ldap -h 'ldap://127.0.0.1/ ldap//ldap.example.com/  
ldaps://127.0.0.1'

При выполнении
# ldapadd -xWD cn=admin,ou=Admins,dc=example,dc=com -H ldap://127.0.0.1 -f 
initial.ldif
спрашивает пароль, и какие бы я пароли туда не вводил ответ один:

ldap_bind: Invalid credentials (49)

при обращении к ldapS вылезает ошибка 
ldap_bind: Can't contact LDAP server (81)
        additional info: error:14077410:SSL 
routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

Если идти вторым путём, то после
slapadd -b dc=example,dc=com -l initial.ldif
получаю slapadd: could not open database

Как вылечить можно?
-- 
MaX

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Comm] настройка openldap
  2005-02-18  7:31 [Comm] настройка openldap max
@ 2005-02-18  8:36 ` Eugene Grudina
  2005-02-24  6:56   ` [Comm] " max
  2005-02-23 15:42 ` Michael Shigorin
  1 sibling, 1 reply; 7+ messages in thread
From: Eugene Grudina @ 2005-02-18  8:36 UTC (permalink / raw)
  To: community

max пишет:

>При настройке пользовался пакетом документации из дистр-а Мастер 2.4, система  
>таже.
>
Для начала....

в конфиге ldap'a...
раскоментируйте эти строки:

#rootdn         "cn=admin,dc=example,dc=com"
#rootpw         secret

поменяйте example.com на имя ващего домена

здесь тоже:
suffix         "dc=example,dc=com"


Дальше при добавлении (ldapadd):
cn=admin,ou=Admins,dc=example,dc=com - эта строка должна быть такая же как и в конфиге ldap'a rootdn.

-- 
ICQ: 8801777
jabber: sirex@jabber.ru
http://grudina.info




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Comm] Re: настройка openldap
  2005-02-18  7:31 [Comm] настройка openldap max
  2005-02-18  8:36 ` Eugene Grudina
@ 2005-02-23 15:42 ` Michael Shigorin
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Shigorin @ 2005-02-23 15:42 UTC (permalink / raw)
  To: community

On Fri, Feb 18, 2005 at 12:31:52PM +0500, max wrote:
> При настройке пользовался пакетом документации из дистр-а
> Мастер 2.4, система  таже.

Есть http://lists.osdn.org.ua/wws/info/openldap (jfyi)

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Comm] Re: настройка openldap
  2005-02-18  8:36 ` Eugene Grudina
@ 2005-02-24  6:56   ` max
  2005-02-26 20:13     ` Pavel Usischev
  0 siblings, 1 reply; 7+ messages in thread
From: max @ 2005-02-24  6:56 UTC (permalink / raw)
  To: community

В сообщении от 18 Февраль 2005 13:36 Eugene Grudina написал(a):
> max пишет:
> >При настройке пользовался пакетом документации из дистр-а Мастер 2.4,
> > система таже.
>
> Для начала....
>
> в конфиге ldap'a...
> раскоментируйте эти строки:
>
> #rootdn         "cn=admin,dc=example,dc=com"
> #rootpw         secret
>
> поменяйте example.com на имя ващего домена
>
> здесь тоже:
> suffix         "dc=example,dc=com"
>
>
> Дальше при добавлении (ldapadd):
> cn=admin,ou=Admins,dc=example,dc=com - эта строка должна быть такая же как
> и в конфиге ldap'a rootdn.

Это помогло, спасибо.
Теперь другая напасть:

#ldapadd -xD cn=admin,dc=example,dc=com -H ldap://127.0.0.1 -f initial.ldif -w 
secret

adding new entry "dc=example,dc=com"
ldapadd: update failed: dc=example,dc=com
ldap_add: Naming violation (64)
        additional info: naming attribute 'dc' is not present in entry

Всё файлы конфигурации из пакета документации Мастер 2.4

-- 
MaX

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Comm] Re: настройка openldap
  2005-02-24  6:56   ` [Comm] " max
@ 2005-02-26 20:13     ` Pavel Usischev
  2005-02-27  6:26       ` max
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Usischev @ 2005-02-26 20:13 UTC (permalink / raw)
  To: community

max пишет:
> Теперь другая напасть:
> 
> #ldapadd -xD cn=admin,dc=example,dc=com -H ldap://127.0.0.1 -f initial.ldif -w 
> secret
> 
> adding new entry "dc=example,dc=com"
> ldapadd: update failed: dc=example,dc=com
> ldap_add: Naming violation (64)
>         additional info: naming attribute 'dc' is not present in entry
> 
> Всё файлы конфигурации из пакета документации Мастер 2.4

К сожалению, по документации к Мастеру 2.4 сделать не получится. Вот 
часть initial.ldif, которая работает:

dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
o: Example Company
dc: example

Возможно, здесь есть лишнее, но точно нужна последняя строка. Именно на 
её отсутствие и ругается у вас ldap_add.

-- 
С уважением,
Павел Усищев


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Comm] Re: настройка openldap
  2005-02-26 20:13     ` Pavel Usischev
@ 2005-02-27  6:26       ` max
  2005-02-27 16:38         ` Michael Shigorin
  0 siblings, 1 reply; 7+ messages in thread
From: max @ 2005-02-27  6:26 UTC (permalink / raw)
  To: community

В сообщении от 27 Февраль 2005 01:13 Pavel Usischev написал(a):
> max пишет:
> > Теперь другая напасть:
> >
> > #ldapadd -xD cn=admin,dc=example,dc=com -H ldap://127.0.0.1 -f
> > initial.ldif -w secret
> >
> > adding new entry "dc=example,dc=com"
> > ldapadd: update failed: dc=example,dc=com
> > ldap_add: Naming violation (64)
> >         additional info: naming attribute 'dc' is not present in entry
> >
> > Всё файлы конфигурации из пакета документации Мастер 2.4
>
> К сожалению, по документации к Мастеру 2.4 сделать не получится. Вот
> часть initial.ldif, которая работает:
>
> dn: dc=example,dc=com
> objectClass: dcObject
> objectClass: organization
> o: Example Company
> dc: example
>
> Возможно, здесь есть лишнее, но точно нужна последняя строка. Именно на
> её отсутствие и ругается у вас ldap_add.

Спасибо, уже разобрался.
Жалко что документация устаревшая или не доработанная.
И ещё одна важная деталь, с которой тоже пришлось разбираться самому:
При добавлении следующих объектов их objectClass должен совпадать с 
родительским! Иначе опять получим ругань.
А в примерах чего только не увидишь...

-- 
MaX

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Comm] Re: настройка openldap
  2005-02-27  6:26       ` max
@ 2005-02-27 16:38         ` Michael Shigorin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Shigorin @ 2005-02-27 16:38 UTC (permalink / raw)
  To: community

On Sun, Feb 27, 2005 at 11:26:21AM +0500, max wrote:
> Жалко что документация устаревшая или не доработанная.

Мужики, сделайте статью для FAQ и пришлите.  В docs@ тоже
проброшу.

PS: ну и напоминаю про openldap@ :)

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-02-27 16:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-18  7:31 [Comm] настройка openldap max
2005-02-18  8:36 ` Eugene Grudina
2005-02-24  6:56   ` [Comm] " max
2005-02-26 20:13     ` Pavel Usischev
2005-02-27  6:26       ` max
2005-02-27 16:38         ` Michael Shigorin
2005-02-23 15:42 ` Michael Shigorin

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git