OpenLdap如何新增.schema文件

1.新增上传.schema文件之前,需要先新增.ldif文件,定义好根路径名称如wanda.ldif,并上传到/openldap/openldap2.3.43/libexec下

这个网上方式很多,也可以通过客户端直接创建。

2.进入正题,本机创建一个.schema文件,并编辑内容。

# inetstaff.schema -- InetOrgPerson (RFC2798)
# $OpenLDAP: pkg/ldap/servers/slapd/schema/inetorgperson.schema,v 1.16.2.4 2008/02/11 23:24:26 kurt Exp $
## This work is part of OpenLDAP Software .
##
## Copyright 1998-2008 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## .
#
# Inetstaff (RFC2798)
#
# Depends upon
#   Definition of an X.500 Attribute Type and an Object Class to Hold
#   Uniform Resource Identifiers (URIs) [RFC2079]
#    (core.schema)
#
#   A Summary of the X.500(96) User Schema for use with LDAPv3 [RFC2256]
#    (core.schema)
#
#   The COSINE and Internet X.500 Schema [RFC1274] (cosine.schema)

# carLicense
# This multivalued field is used to record the values of the license or
# registration plate associated with an individual.

#custom add start
#staff   1.3.6.1.4.1.4203.666.1.990 唯一即可,每个定义(staffAccount\staffId\staffName)的字段,都排序下来991,992.....
attributetype ( 1.3.6.1.4.1.4203.666.1.90
        NAME 'staffAccount'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024}  )
attributetype ( 1.3.6.1.4.1.4203.666.1.91
        NAME 'staffId'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024}  )
attributetype ( 1.3.6.1.4.1.4203.666.1.93
        NAME 'staffName'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024}  )
#staff
#custom add end

# inetStaff
# The inetOrgPerson represents people who are associated with an
# organization in some way.  It is a structural class and is derived
# from the organizationalPerson which is defined in X.521 [X521].

#staff   2.16.840.1.113730.3.2.301该编码301不能跟其他schema文件一样即可
objectclass    ( 2.16.840.1.113730.3.2.201
    NAME 'inetStaff'
    DESC 'RFC2798: Internet Organizational Person'
    SUP organizationalPerson
    STRUCTURAL
    MAY ( 
        audio $ businessCategory 
        $ staffAccount 
        $ staffId 
       $ staffName)
    )

3.创建好集合文件后,导入/openldap/openldap2.3.43/etc/openldap/schema下。这

4.这个步骤就相当于oracle创建新表的过程。

你可能感兴趣的:(LDAP)