안녕하세요.
>>심도선 님께서 쓰시길<<
:: [root@deepway bin]# ldapadd -D "dc=my-domain, dc=com" << EOF
:: > dn: dc=my-domain,dc=com
:: > cn:my-domain
:: > objectclass:mynewobject
:: > EOF
:: adding new entry "dc=my-domain,dc=com"
:: ldap_add: Object class violation
:: additional info: attribute not allowed
::
OpenLDAP 2.0.x버전의 경우에...
최상위 dn의 경우 suffix를 만일 dc=mydomain,dc=com형태로 설정하셨다면
dcObject라는 objectclass가 core.schema파일에 정의되어 있으므로
기존에 존재하는 dcObject objectclass를 사용하시기 바랍니다.
그럴경우 위의 입력은 다음과 같이 바뀔수 있습니다.
> dn: dc=my-domain,dc=com
> dc: my-domain
> objectclass: dcObject
core.schema 파일을 보시면서 MAY,MUST attribute들을 주의해서 보세요. MUST항목은
꼭 있어야만 하는 attribute를 뜻합니다.
:: 위와 같이 했습니다. attribute not allowed 라고 나오는게 아무래도 objectclass
::
:: 의 속성이 정의되지 않은 것 같은데요.. 어디서 해야하지요??
::
:: openLDAP 2.0.7 깔았구요..
::
:: slapd.conf 파일의 내용은 아래와 같습니다 .
:: # $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.8.8.4 2000/08/26 17:06:18 kur
:: t Exp $
:: #
:: # See slapd.conf(5) for details on configuration options.
:: # This file should NOT be world readable.
:: #
:: include /usr/local/LDAP/etc/openldap/schema/core.schema
:: include /usr/local/LDAP/etc/openldap/local.oc.conf
::
:: # Define global ACLs to disable default read access.
::
:: # Do not enable referrals until AFTER you have a working directory
:: # service AND an understanding of referrals.
:: #referral ldap://root.openldap.org
::
:: pidfile /usr/local/LDAP/var/slapd.pid
:: argsfile /usr/local/LDAP/var/slapd.args
::
:: # Load dynamic backend modules:
:: # modulepath /usr/local/LDAP/libexec/openldap
:: # moduleload back_ldap.la
:: # moduleload back_ldbm.la
:: # moduleload back_passwd.la
:: # moduleload back_shell.la
::
:: #######################################################################
:: # ldbm database definitions
:: #######################################################################
::
:: database ldbm
:: suffix "dc=my-domain, dc=com"
:: #suffix "o=My Organization Name, c=US"
:: #suffix "c=kr"
:: rootdn "cn=Manager, dc=my-domain, dc=com"
:: #rootdn "cn=Manager, c=kr"
:: # Cleartext passwords, especially for the rootdn, should
:: # be avoid. See slappasswd(8) and slapd.conf(5) for details.
:: # Use of strong authentication encouraged.
:: rootpw secret
:: # The database directory MUST exist prior to running slapd AND
:: # should only be accessable by the slapd/tools. Mode 700 recommended.
:: directory /usr/local/LDAP/var/openldap-ldbm
:: # Indices to maintain
:: index objectClass,o,cn eq
:: #index { <attrlist> | default } [pres,eq,approx,sub,none]
:: #index o eq
:: #index cn eq
:: #index mail eq
::
:: 제가 이것저것 삽질한다고 군더더기들이 많습니다..
::
:: 아 그리고 include 되어있는 local.oc.conf 라는 파일은 제가 만든건데여..
::
:: 역시 좀 봐주세요.
::
:: vi local.oc.conf
::
:: objectclass mynewobject
:: requires
:: cn
:: allows
:: mail,
:: telephone
::
:: 뭐가뭔지 모르겠어요.. 엉엉..
::
:: 그리고 박근오님이 추천해주신 문서보고 많은 도움을 받았습니다
OpenLDAP 2.0.x버전과 1.2.x버전의 objectclass정의방식은 많이 다릅니다.
심도선님께서 정의하신 방법의 objectclass정의는 1.2.x에서 사용하는 방식입니다.
그러므로 에러가 나는 것은 당연합니다. OpenLDAP 1.2.x를 사용하여 테스트를 해보
시길 바랍니다. OpenLDAP 2.0.x를 사용하여 테스트를 해보고 싶으시면
OpenLDAP사이트의 2.0.x 관리자 가이드를 보시면 테스트과정까지 나와 있으니
해보실수 있을겁니다.
그럼 즐거운 하루보내세요.
|