* [Comm] Подключение к OpenLDAP и добавление данных
@ 2004-03-30 12:22 Eugene Prokopiev
2004-03-30 11:44 ` Nick S. Grechukh
0 siblings, 1 reply; 5+ messages in thread
From: Eugene Prokopiev @ 2004-03-30 12:22 UTC (permalink / raw)
To: Community
Здравствуйте!
Задача: добавить в дерево OpenLDAP некие данные (пользователя и его
подразделение), затем получить эти даные оттуда :)
www.ldapzone.spb.ru читал, но ясности это не добавило.
Конфиг - /etc/openldap/slapd.conf:
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
include /etc/openldap/schema/dhcp.schema
pidfile /var/run/slapd.pid
argsfile /var/run/slapd.args
TLSCertificateFile /etc/openldap/ldap.pem
TLSCertificateKeyFile /etc/openldap/ldap.pem
TLSCACertificateFile /etc/openldap/ldap.pem
database ldbm
suffix "dc=test,dc=ru"
rootdn "cn=manager,dc=test,dc=ru"
rootpw secret
directory /var/lib/ldap/bases
loglevel -1
index objectClass,uid,uidNumber,gidNumber eq
index cn,mail,surname,givenname eq,subinitial
index dhcpHWAddress eq
index dhcpClassData eq
service ldap start отработал успешно.
Добавляю следующий файл:
dn: cn=dhcp,dc=test,dc=ru
objectClass: top
objectClass: person
sn: DHCP Administrator
cn: dhcp
dn: ou=dhcp,dc=test,dc=ru
objectClass: top
objectClass: organizationalUnit
ou: dhcp
Получаю:
# ldapadd -W -x -D "cn=manager,dc=test,dc=ru" -f data.ldif
Enter LDAP Password:
adding new entry "cn=dhcp,dc=test,dc=ru"
ldap_add: No such object
additional info: parent does not exist
ldif_record() = 32
А при поиске:
$ ldapsearch -LL -H ldap://localhost -b "dc=test,dc=ru"
version: 1
No such object (32)
Что я делаю неправильно?
--
С уважением, Прокопьев Евгений
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Comm] Подключение к OpenLDAP и добавление данных
2004-03-30 12:22 [Comm] Подключение к OpenLDAP и добавление данных Eugene Prokopiev
@ 2004-03-30 11:44 ` Nick S. Grechukh
2004-03-30 13:02 ` Eugene Prokopiev
2004-03-31 3:06 ` BSW
0 siblings, 2 replies; 5+ messages in thread
From: Nick S. Grechukh @ 2004-03-30 11:44 UTC (permalink / raw)
To: community
В сообщении от Вторник 30 Март 2004 15:22 Eugene Prokopiev написал(a):
> Здравствуйте!
>
> Задача: добавить в дерево OpenLDAP некие данные (пользователя и его
> подразделение), затем получить эти даные оттуда :)
>
> www.ldapzone.spb.ru читал, но ясности это не добавило.
>
> Конфиг - /etc/openldap/slapd.conf:
>
> 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
> include /etc/openldap/schema/dhcp.schema
> pidfile /var/run/slapd.pid
> argsfile /var/run/slapd.args
> TLSCertificateFile /etc/openldap/ldap.pem
> TLSCertificateKeyFile /etc/openldap/ldap.pem
> TLSCACertificateFile /etc/openldap/ldap.pem
> database ldbm
> suffix "dc=test,dc=ru"
> rootdn "cn=manager,dc=test,dc=ru"
> rootpw secret
> directory /var/lib/ldap/bases
> loglevel -1
> index objectClass,uid,uidNumber,gidNumber eq
> index cn,mail,surname,givenname eq,subinitial
> index dhcpHWAddress eq
> index dhcpClassData eq
>
> service ldap start отработал успешно.
>
> Добавляю следующий файл:
>
> dn: cn=dhcp,dc=test,dc=ru
> objectClass: top
> objectClass: person
> sn: DHCP Administrator
> cn: dhcp
>
> dn: ou=dhcp,dc=test,dc=ru
> objectClass: top
> objectClass: organizationalUnit
> ou: dhcp
>
> Получаю:
>
> # ldapadd -W -x -D "cn=manager,dc=test,dc=ru" -f data.ldif
> Enter LDAP Password:
> adding new entry "cn=dhcp,dc=test,dc=ru"
> ldap_add: No such object
> additional info: parent does not exist
>
> ldif_record() = 32
>
> А при поиске:
>
> $ ldapsearch -LL -H ldap://localhost -b "dc=test,dc=ru"
> version: 1
>
> No such object (32)
>
> Что я делаю неправильно?
afaik надо вначале добавить сам
dn: ou=dhcp,dc=test,dc=ru
objectClass: top
objectClass: organizationalUnit
и т.д.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Comm] Подключение к OpenLDAP и добавление данных
2004-03-30 11:44 ` Nick S. Grechukh
@ 2004-03-30 13:02 ` Eugene Prokopiev
2004-03-30 13:46 ` Michael Bochkaryov
2004-03-31 3:06 ` BSW
1 sibling, 1 reply; 5+ messages in thread
From: Eugene Prokopiev @ 2004-03-30 13:02 UTC (permalink / raw)
To: community
> afaik надо вначале добавить сам
> dn: ou=dhcp,dc=test,dc=ru
> objectClass: top
> objectClass: organizationalUnit
> и т.д.
Т.е. добавить файл вида:
dn: ou=dhcp,dc=test,dc=ru
objectClass: top
objectClass: organizationalUnit
dn: cn=dhcp,dc=test,dc=ru
objectClass: top
objectClass: person
sn: DHCP Administrator
cn: dhcp
dn: ou=dhcp,dc=test,dc=ru
objectClass: top
objectClass: organizationalUnit
ou: dhcp
Тогда вот что получается:
# ldapadd -W -x -D "cn=manager,dc=test,dc=ru" -f data.ldif
Enter LDAP Password:
adding new entry "ou=dhcp,dc=test,dc=ru"
ldap_add: Object class violation
additional info: object class 'organizationalUnit' requires
attribute 'ou'
ldif_record() = 65
--
С уважением, Прокопьев Евгений
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Comm] Подключение к OpenLDAP и добавление данных
2004-03-30 13:02 ` Eugene Prokopiev
@ 2004-03-30 13:46 ` Michael Bochkaryov
0 siblings, 0 replies; 5+ messages in thread
From: Michael Bochkaryov @ 2004-03-30 13:46 UTC (permalink / raw)
To: community
Eugene Prokopiev пишет:
>> afaik надо вначале добавить сам dn: ou=dhcp,dc=test,dc=ru
>> objectClass: top
>> objectClass: organizationalUnit
>> и т.д.
>
>
> Т.е. добавить файл вида:
>
> dn: ou=dhcp,dc=test,dc=ru
> objectClass: top
> objectClass: organizationalUnit
>
Здесть еще надо добавить:
ou: dhcp
[skip]
> # ldapadd -W -x -D "cn=manager,dc=test,dc=ru" -f data.ldif
> Enter LDAP Password:
> adding new entry "ou=dhcp,dc=test,dc=ru"
> ldap_add: Object class violation
> additional info: object class 'organizationalUnit' requires
> attribute 'ou'
>
> ldif_record() = 65
>
>
А вобще, советую почитать описания классов в /etc/openldap/schema/*
Сразу становится понятно, в какой класс какие аттрибуты писать :)
--
Michael Bochkaryov
Kyivstar GSM
Phone: +380 67 2206770
--
This message was scanned for viruses and it's not infected.
Kyivstar GSM.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Comm] Подключение к OpenLDAP и добавление данных
2004-03-30 11:44 ` Nick S. Grechukh
2004-03-30 13:02 ` Eugene Prokopiev
@ 2004-03-31 3:06 ` BSW
1 sibling, 0 replies; 5+ messages in thread
From: BSW @ 2004-03-31 3:06 UTC (permalink / raw)
To: community
Nick S. Grechukh wrote:
>>suffix "dc=test,dc=ru"
> afaik надо вначале добавить сам
> dn: ou=dhcp,dc=test,dc=ru
> objectClass: top
> objectClass: organizationalUnit
> и т.д.
Только без "ou=dhcp". Сначала надо приделать то, что написано в suffix.
И не забыть прописать все обязательные атрибуты для всех objectClass.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-03-31 3:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-30 12:22 [Comm] Подключение к OpenLDAP и добавление данных Eugene Prokopiev
2004-03-30 11:44 ` Nick S. Grechukh
2004-03-30 13:02 ` Eugene Prokopiev
2004-03-30 13:46 ` Michael Bochkaryov
2004-03-31 3:06 ` BSW
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