This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
хранение_адресной_книги_в_ldap [2010/09/30 10:21] val created |
хранение_адресной_книги_в_ldap [2017/02/02 12:59] (current) val [Хранение адресной книги в LDAP] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Хранение адресной книги в LDAP ====== | ====== Хранение адресной книги в LDAP ====== | ||
| + | |||
| + | **!!!! Устарело !!!!** | ||
| + | |||
| + | Объект inetOrgPerson и его атрибут mail не удается использовать из-за конфликта между классами предками (invalid structural object class chain (account/person)) | ||
| + | [[http://www.openldap.org/lists/openldap-software/200307/msg00267.html]] | ||
| ===== Расширение схемы ===== | ===== Расширение схемы ===== | ||
| Line 152: | Line 157: | ||
| <code> | <code> | ||
| [server:~] # cat /usr/local/etc/openldap/slapd.conf | [server:~] # cat /usr/local/etc/openldap/slapd.conf | ||
| + | </code><code> | ||
| ... | ... | ||
| include /usr/local/etc/openldap/schema/core.schema | include /usr/local/etc/openldap/schema/core.schema | ||
| Line 159: | Line 165: | ||
| include /root/mozillaorgperson.schema | include /root/mozillaorgperson.schema | ||
| ... | ... | ||
| + | </code><code> | ||
| + | [server:~] # /usr/local/etc/rc.d/slapd restart | ||
| </code> | </code> | ||
| Line 172: | Line 180: | ||
| </code><code> | </code><code> | ||
| root@server:~# slapcat -f mozillaorgperson.conf -F /tmp/ -n0 -s "cn={4}mozillaorgperson,cn=schema,cn=config" > /tmp/cn=mozillaorgperson.ldif | root@server:~# slapcat -f mozillaorgperson.conf -F /tmp/ -n0 -s "cn={4}mozillaorgperson,cn=schema,cn=config" > /tmp/cn=mozillaorgperson.ldif | ||
| + | |||
| + | root@server:~# vim /tmp/cn=mozillaorgperson.ldif | ||
| !!! remove 5-7 last lines !!! | !!! remove 5-7 last lines !!! | ||
| + | root@server:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif # No need in ubuntu 12.04 | ||
| - | root@server:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif | ||
| root@server:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /tmp/cn=mozillaorgperson.ldif | root@server:~# ldapadd -Y EXTERNAL -H ldapi:/// -f /tmp/cn=mozillaorgperson.ldif | ||
| </code> | </code> | ||
| Line 181: | Line 191: | ||
| ===== Заполнение адресной книги ===== | ===== Заполнение адресной книги ===== | ||
| <code> | <code> | ||
| - | server# ldapmodify -x -D "cn=admin,dc=corpX,dc=un" -w secret | + | server:~# cat addmail.ldif |
| + | </code><code> | ||
| dn: uid=user1,ou=users,dc=corpX,dc=un | dn: uid=user1,ou=users,dc=corpX,dc=un | ||
| changetype: modify | changetype: modify | ||
| add: objectClass | add: objectClass | ||
| objectClass: mozillaOrgPerson | objectClass: mozillaOrgPerson | ||
| - | <ENTER> | ||
| - | modifying entry "uid=user1,ou=users,dc=corpX,dc=un" | ||
| dn: uid=user1,ou=users,dc=corpX,dc=un | dn: uid=user1,ou=users,dc=corpX,dc=un | ||
| Line 193: | Line 202: | ||
| add: mail | add: mail | ||
| mail: user1@gate.corpX.un | mail: user1@gate.corpX.un | ||
| - | <ENTER> | ||
| - | modifying entry "uid=user1,ou=users,dc=corpX,dc=un" | ||
| - | <Ctrl>-d | + | dn: uid=user2,ou=users,dc=corpX,dc=un |
| + | changetype: modify | ||
| + | add: objectClass | ||
| + | objectClass: mozillaOrgPerson | ||
| + | |||
| + | dn: uid=user2,ou=users,dc=corpX,dc=un | ||
| + | changetype: modify | ||
| + | add: mail | ||
| + | mail: user2@gate.corpX.un | ||
| + | </code><code> | ||
| + | server# ldapmodify -x -D "cn=admin,dc=corpX,dc=un" -w secret -f addmail.ldif | ||
| + | |||
| + | server# ldapsearch -x -b"dc=corpX,dc=un" -h server "uid=user1" | ||
| </code> | </code> | ||