使用openldap下的rwm属性映射功能

来源:互联网 发布:带点小黄的网络电影 编辑:程序博客网 时间:2024/05/17 01:33

openldap版本:2.4.29

使用rwm功能,一般需要在安装openldap时,有开启overlay选项的rwm功能才行。如果是RHEL系列的RPM包里是没有提供相关openldap的rwm包,所以最好手动编译安装openldap,并指定相关参数--enable-rwm,如:

 ./configure --prefix=/opt/openldap  --enable-rewrite   --enable-rwm 
而rwm参数支持后端数据库为 ldap 和relay,在本地则使用relay类型的数据库

配置文件 slapd.conf 部分说明:

database        bdbsuffix          "dc=sample,dc=cn"rootdn          "uid=admin,dc=sample,dc=cn"rootpw          123# The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools.# Mode 700 recommended.directory       /opt/openldap/var/openldap-data....
添加多一个relay后端数据库,如:让 dc=virtual_sample,dc=cn 关联到 dc=sample,dc=cn,并创建一个虚拟属性myuid映射到uid
database                relaysuffix                  "dc=virtual_sample,dc=cn"relay                   "dc=sample,dc=cn"overlay                 rwmrwm-suffixmassage       "dc=sample,dc=cn"rwm-map attribute       myuid uidrwm-normalize-mapped-attrs yes

其中rwm-normalize-mapped-attrs yes 是为了防止虚拟属性myuid未在schema中定义,或者dc=sample,dc=cn下也存在myuid时一起冲突,这样会导致openldap崩溃而自动关闭。


原创粉丝点击