上一页      目录      索引      文档主页      下一页     
iPlanet Directory Server 5.1 管理员指南



第 16 章   使用传递验证插件


传递验证 (PTA) 机制就是一个目录服务器向另一个目录服务器进行查询,从而验证绑定请求。PTA 插件可提供该功能。对于未在本地数据库中存储的条目而言,该功能允许目录服务器接受其简单的绑定操作(基于口令)。

利用 PTA,iPlanet Directory Server 5.1 允许在独立的 iPlanet Directory Server 实例上管理用户目录及配置目录。

本章将在以下各节中介绍 PTA 插件:



Directory Server 5.1 如何使用 PTA

如果在独立的 iPlanet Directory Server 实例上安装配置目录和用户目录,安装程序就会自动将 PTA 设置为允许配置管理员用户(通常为 admin)执行管理任务。

这种情况下将需要用到 PTA,因为 admin 用户项存储在配置目录的 o=NetscapeRoot 下。因此,试图作为 admin 绑定到用户目录时通常会失败。PTA 允许用户目录将凭证传递给对其进行验证的配置目录。用户目录随即将 admin 用户绑定。

本例中的用户目录充当 PTA 目录服务器,也就是将绑定请求传递给另一个目录服务器的服务器。配置目录则充当验证目录,也就是包含条目并验证请求客户机之绑定凭证的服务器。

本章中还用到传递子树一词。传递子树就是 PTA 目录中出现的子树。当用户的绑定 DN 包含该子树时,用户凭证就会被传递给验证目录。



注意 当用户目录和配置目录使用同一服务器时,PTA 插件将不在 iPlanet Directory Server Console 中列出。



下面是传递验证的工作原理:

  1. 假定在计算机 A 中安装配置目录服务器(验证目录)。

    • 服务器名:configdir.siroe.com

    • 后缀:o=NetscapeRoot

  2. 而在计算机 B 中安装用户目录服务器(PTA 目录)。

    • 服务器名:userdir.siroe.com

    • 后缀:dc=siroe,dc=com

  3. 在计算机 B 上安装用户目录时,系统将提示提供 LDAP URL。该 URL 指向计算机 A 的配置目录。

  4. 安装程序将向启用 PTA 插件的用户目录中的 dse.ldif 文件添加条目。

    该条目中包含所提供的 LDAP URL。例如:

    dn: cn=Pass Through Authentication,cn=plugins,cn=config
    objectClass: top
    objectClass: nsSlapdPlugin
    objectClass: extensibleObject
    cn: Pass Through Authentication
    nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
    nsslapd-pluginInitfunc: passthruauth_init
    nsslapd-pluginType: preoperation
    nsslapd-pluginEnabled: on
    nsslapd-pluginarg0: ldap://config.siroe.com/ou=NetscapeRoot
    nsslapd-plugin-depends-on-type: database
    nsslapd-pluginId: passthruauth
    nsslapd-pluginVersion: 5.0
    nsslapd-pluginVendor: Sun | Netscape Alliance
    nsslapd-pluginDescription: pass through authentication plugin

    用户目录现在即配置为将 DN 中包含 o=NetscapeRoot 的条目请求发送给配置目录 configdir.siroe.com

  5. 安装过程结束后,admin 用户将试图连接用户目录以开始添加用户。

  6. 安装程序将把 admin 用户的条目作为 uid=admin, ou=TopologyManagement,o=NetscapeRoot 添加到目录中。因此,正如 PTA 插件配置所定义的那样,用户目录将把绑定请求传递给配置目录。

  7. 配置目录将验证用户的凭证,然后将信息发送回用户目录。

  8. 用户目录即允许 admin 用户进行绑定。



PTA 插件的语法

PTA 插件的配置信息是在
cn=Pass Through Authentication,cn=plugins,cn=config 条目(位于 PTA 目录的 dse.ldif 文件中,其中 PTA 目录 就是配置为将绑定请求传递给验证目录的用户目录)中指定的,使用的是本部分所述的语法。

dn: cn=Pass Through Authentication,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Pass Through Authentication
nsslapd-pluginPath: /usr/iplanet/ds5lib/passthru-plugin.extension
nsslapd-pluginInitfunc: passthruauth_init
nsslapd-pluginType: preoperation
nsslapd-pluginEnabled: state
nsslapd-pluginarg0: ldap|ldaps://authDS/subtree [maxconns,maxops,timeout,ldver,connlifetime]

有关 PTA 插件语法之变量组件的说明,请参阅表 16-1



注意
  • LDAP URL (ldap|ldaps://authDS/subtree) 必须用空格与可选参数(maxconnsmaxopstimeoutldverconnlifetime)分隔。

  • 如果明确定义某些可选参数,则必须全部进行定义,即使是仅指定默认值。

  • 通过每次使 nsslapd-pluginarg 属性后缀增 1,可以指定几个验证目录或子树。图示见“指定多个验证目录服务器”



可选参数的说明见下表,取其在语法中的顺序。


表 16-1    PTA 插件参数

变量

定义

state  

定义是否启用该插件。可接受的值为 onoff。有关详细信息,请参阅“打开或关闭插件”  

extension  

插件的文件扩展名。扩展名为 .so  

ldap|ldaps  

定义 SSL 是否用于两个目录服务器之间的通讯。有关详细信息,请参阅“将服务器配置为使用安全连接”  

authDS  

验证目录的主机名。添加冒号,后跟端口号,即可指定目录服务器的端口号。例如:

ldap://dirserver.siroe.com:390/

如果不指定端口号。PTA 服务器将尝试用下列端口进行连接:

  • 如果 URL 中指定 ldap://,则为 389。

  • 如果 URL 中指定 ldaps://,则为 636。

有关详细信息,请参阅“指定验证目录服务器”  

subtree  

传递子树。对于该子树中含有其 DN 的客户机,PTA 目录服务器将把其中的绑定请求传递给验证目录服务器。

有关详细信息,请参阅“指定传递子树”  

maxconns  

可选。PTA 目录可同时打开的指向验证目录的最大连接数。默认值为 3。

有关详细信息,请参阅“配置可选参数”  

maxops  

可选。在单个连接中,PTA 目录可发送给验证目录的最大并行操作数(通常为绑定请求)。默认值为 5。

有关详细信息,请参阅“配置可选参数”  

timeout  

可选。PTA 目录等待验证目录服务器进行响应时的时间限制(秒)。如果超出该超时设置,服务器就会向客户机返回错误。

默认值为 300 秒(5 分钟)。指定 0 时,指示没有强制的时间限制。

有关详细信息,请参阅“配置可选参数”  

ldver  

可选。用于连接验证目录的 LDAP 协议的版本。iPlanet Directory Server 支持 LDAP 版本 2 和 3。默认值为版本 3。

有关详细信息,请参阅“配置可选参数”  

connlifetime  

可选。可以使用连接的时间限制(秒)。如果绑定请求是在超出该时间限制后由客户机启动的,服务器就会关闭连接,然后打开到验证目录的新连接。除非已启动绑定请求且目录判定已超出连接的使用期,否则服务器将不会关闭该连接。

如果不指定该选项,或者仅列出一个主机,就不会有强制的连接使用期。如果列出了多个主机,则默认值为 300 秒(5 分钟)。

有关详细信息,请参阅“配置可选参数”  



配置 PTA 插件



配置 PTA 插件的唯一方法是修改条目
cn=Pass Through Authentication,cn=plugins,cn=config(位于 dse.ldif 文件中)。要修改 dse.ldif 文件,则必须进行如下操作:

  1. 使用 ldapmodify 命令修改 cn=Pass Through Authentication,cn=plugins,cn=config

  2. 重新启动 iPlanet Directory Server。

配置本部分所述的参数之前,dse.ldif 文件中必须存在 PTA 插件条目。如果该条目不存在,则必须用相应的语法予以创建,说明见“PTA 插件的语法”



注意 如果已在不同的目录实例上分别安装用户目录和配置目录,PTA 插件条目就会自动添加到用户目录的 dse.ldif 文件中。如果是在同一目录实例上安装的用户目录和配置目录,则不会自动添加该语法。此时必须进行手动添加。



本部分将提供有关配置该插件的信息:


打开或关闭插件

要从命令行上打开 PTA 插件:

  1. 创建包含下列 LDIF 更新语句的 LDIF 文件:

    dn: cn=Pass Through Authentication,cn=plugins,cn=config
    cn: Pass Through Authentication
    changetype: modify
    replace: nsslapd-pluginenabled
    nsslapd-pluginenabled: on

  2. 使用 ldapmodify 命令可以将 LDIF 文件导入到目录中。

  3. 启用插件时,还必须检查是否已正确定义插件的初始化功能。

    条目 cn=Pass Through Authentication,cn=plugins,cn=config 中应包含下列属性-值对:

    nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
    nsslapd-pluginInitfunc: passthruauth_init

  4. 重新启动服务器。

    有关重新启动服务器的信息,请参阅“启动和停止 iPlanet Directory Server”

要禁用插件,请更改 LDIF 更新语句以删除 nsslapd-pluginenabled: on 语句,然后添加 nsslapd-pluginenabled: off 语句。从命令行上启用或禁用 PTA 插件时,必须重新启动服务器。


将服务器配置为使用安全连接

可以对 PTA 目录进行配置,使之通过 SSL 与验证目录进行通讯。为此,可指定 LDAPS(PTA 目录中的 LDAP URL)。

要将 PTA 目录和验证目录配置为使用 SSL:

  1. 创建包含下列 LDIF 更新语句的 LDIF 文件:

    dn: cn=Pass Through Authentication,cn=plugins,cn=config
    cn: Pass Through Authentication
    changetype: modify
    replace: nsslapd-pluginarg0
    nsslapd-pluginarg0: ldaps://authDS/subtree [optional_parameters]

    有关该语法中变量组件的信息,请参阅“PTA 插件参数”

  2. 使用 ldapmodify 命令可以将 LDIF 文件导入到目录中。

  3. 重新启动服务器。

    有关重新启动服务器的信息,请参阅“启动和停止 iPlanet Directory Server”


指定验证目录服务器

验证目录中包含客户机所要绑定的条目的绑定凭证。PTA 目录将绑定请求传递给定义为验证目录的主机。您可以按下列方式指定验证目录服务器:用验证目录的主机名替换 PTA 目录之 LDAP URL 中的 authDS

要指定 PTA 的验证目录:

  1. 创建包含下列 LDIF 更新语句的 LDIF 文件:

    dn: cn=Pass Through Authentication,cn=plugins,cn=config
    cn: Pass Through Authentication
    changetype: add
    add: nsslapd-pluginarg0
    nsslapd-pluginarg0: ldap://authDS/subtree [optional_parameters]

    也可以包含冒号,后面跟端口号。如果不指定端口号,PTA 目录服务器将尝试使用下列端口号进行连接:

    • 如果 URL 中指定 ldap://,则为 389。

    • 如果 URL 中指定 ldaps://,则为 636。

    例如,可以将 nsslapd-pluginarg0 属性的值更改为:

    "ldap://dirserver.siroe.com:389/subtree [Parameters]"

    有关该语法中变量组件的信息,请参阅“PTA 插件参数”

  2. 使用 ldapmodify 命令可以将 LDIF 文件导入到目录中。

  3. 重新启动服务器。

    有关重新启动服务器的信息,请参阅“启动和停止 iPlanet Directory Server”


指定传递子树

对于其 DN 已在传递子树中定义的客户机而言,PTA 目录将从中将绑定请求传递给验证目录。指定子树时,应替换 PTA 目录之 LDAP URL 中的 subtree 参数。

传递子树不得在 PTA 目录中存在。如果存在传递子树,PTA 目录就会尝试使用自己的目录内容来解析请求,从而导致绑定操作失败。

要指定传递子树:

  1. 创建包含下列 LDIF 更新语句的 LDIF 文件:

    dn: cn=Pass Through Authentication,cn=plugins,cn=config
    cn: Pass Through Authentication
    changetype: add
    add: nsslapd-pluginarg0
    nsslapd-pluginarg0: ldap://authDS/subtree [optional_parameters]

    例如,可以将 nsslapd-pluginarg0 属性的值更改为:

    "ldap://dirserver.siroe.com/o=NetscapeRoot [Parameters]"

    有关该语法中变量组件的信息,请参阅“PTA 插件参数”

  2. 使用 ldapmodify 命令可以将 LDIF 文件导入到目录中。

  3. 重新启动服务器。

    有关重新启动服务器的信息,请参阅“启动和停止 iPlanet Directory Server”


配置可选参数

您可以对下列 PTA 插件的可选参数进行配置:

  • PTA 目录服务器可同时打开的指向验证目录的最大连接数,在 PTA 语法中用 maxconns 表示。默认值为 3

  • 单个连接中,PTA 目录服务器可向验证目录服务器同时发送的最大绑定请求数。在 PTA 语法中,该参数表示为 maxops。默认值为 5

  • PTA 目录服务器等待验证目录服务器进行响应时的时间限制(秒)。在 PTA 语法中,该参数表示为 timeout。默认值为 300 秒(5 分钟)。

  • 希望 PTA 目录服务器用于连接验证目录服务器的 LDAP 协议的版本。在 PTA 语法中,该参数表示为 ldver。默认值为 LDAPv3

  • 可以使用连接的时间限制(秒)。如果绑定请求是在超出该时间限制后由客户机启动的,服务器就会关闭连接,然后打开到验证目录服务器的新连接。除非已启动绑定请求且服务器判定已超出超时设置,否则服务器将不会关闭该连接。如果不指定该选项,或者 authDS 参数中只列出了一个验证目录服务器,则不会有强制的时间限制。如果列出了多个主机,则默认值为 300 秒(5 分钟)。在 PTA 语法中,该参数表示为 connlifetime。



    注意 尽管这些参数为可选项,但如果指定其中的某个参数,则需要予以全部指定,即使使用的是默认值。



  • 创建包含下列 LDIF 更新语句的 LDIF 文件:

    dn: cn=Pass Through Authentication,cn=plugins,cn=config
    cn: Pass Through Authentication
    changetype: add
    add: nsslapd-pluginarg0
    nsslapd-pluginarg0: ldap://authDS/subtree [maxconns,maxops,timeout,ldver,connlifetime]

    确保 subtree 参数和可选参数之前有一个空格。

    例如,可以将 nsslapd-pluginarg0 属性的值更改为:

    "ldap://dirserver.siroe.com/o=NetscapeRoot 3,5,300,3,300"

    本例中,每个可选参数均被设为其默认值。

  • 使用 ldapmodify 命令可以将 LDIF 文件导入到目录中。

  • 重新启动服务器。

    有关重新启动服务器的信息,请参阅“启动和停止 iPlanet Directory Server”



PTA 插件语法示例

本部分在 dse.ldif 文件中提供 PTA 插件语法的以下示例:


指定一个验证目录服务器和一个子树
本例将对 PTA 插件进行配置,使之接受可选变量的所有默认值。对于 o=NetscapeRoot 子树的绑定请求而言,该配置将导致 PTA 目录服务器连接到验证目录服务器。验证目录服务器的主机名为 config-dir.siroe.com

dn: cn=Pass Through Authentication,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Pass Through Authentication
nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
nsslapd-pluginInitfunc: passthruauth_init
nsslapd-pluginType: preoperation
nsslapd-pluginEnabled: on
nsslapd-pluginarg0: ldap://config-dir.siroe.com/ou=NetscapeRoot
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: passthruauth
nsslapd-pluginVersion: 5.0
nsslapd-pluginVendor: Sun | Netscape Alliance
nsslapd-pluginDescription: pass through authentication plugin


指定多个验证目录服务器
如果 PTA 目录服务器与验证目录服务器之间的连接被断开或无法打开,PTA 目录服务器就会将请求发送给所指定的下一服务器(如果有)。可以根据需要指定任意多个验证目录服务器。

dn: cn=Pass Through Authentication,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Pass Through Authentication
nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
nsslapd-pluginInitfunc: passthruauth_init
nsslapd-pluginType: preoperation
nsslapd-pluginEnabled: on
nsslapd-pluginarg0: ldap://config-dir.siroe.com/ou=NetscapeRoot
nsslapd-pluginarg1: ldap://config2-dir.siroe.com/ou=NetscapeRoot
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: passthruauth
nsslapd-pluginVersion: 5.0
nsslapd-pluginVendor: Sun | Netscape Alliance
nsslapd-pluginDescription: pass through authentication plugin


指定一个验证目录服务器和多个子树
下例将对 PTA 目录服务器进行配置,使之传递多个子树的绑定请求(使用参数的默认值):

dn: cn=Pass Through Authentication,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Pass Through Authentication
nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
nsslapd-pluginInitfunc: passthruauth_init
nsslapd-pluginType: preoperation
nsslapd-pluginEnabled: on
nsslapd-pluginarg0: ldap://config-dir.siroe.com/ou=NetscapeRoot
nsslapd-pluginarg1: ldap://config-dir.siroe.com/dc=siroe,dc=com
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: passthruauth
nsslapd-pluginVersion: 5.0
nsslapd-pluginVendor: Sun | Netscape Alliance
nsslapd-pluginDescription: pass through authentication plugin


使用非默认参数值
本例仅对最大连接数参数 maxconns 使用非默认值 (10)。其它各个参数均设为其默认值。但由于已指定了一个参数,因此在语法中必须对所有参数进行明确定义。

dn: cn=Pass Through Authentication,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Pass Through Authentication
nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
nsslapd-pluginInitfunc: passthruauth_init
nsslapd-pluginType: preoperation
nsslapd-pluginEnabled: on
nsslapd-pluginarg0: ldap://config-dir.siroe.com/ou=NetscapeRoot 10,5,300,3,300
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: passthruauth
nsslapd-pluginVersion: 5.0
nsslapd-pluginVendor: Sun | Netscape Alliance
nsslapd-pluginDescription: pass through authentication plugin


为不同的验证目录服务器指定不同的可选参数和子树
如果想为各个验证目录服务器指定不同的传递子树和可选参数,则必须指定多个 LDAP URL/可选参数对。如下所示,LDAP URL/可选参数对之间应使用单个空格进行分隔。

dn: cn=Pass Through Authentication,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Pass Through Authentication
nsslapd-pluginPath: /usr/iplanet/ds5/lib/passthru-plugin.so
nsslapd-pluginInitfunc: passthruauth_init
nsslapd-pluginType: preoperation
nsslapd-pluginEnabled: on
nsslapd-pluginarg0: ldap://config-dir.siroe.com/ou=NetscapeRoot 7,7,300,3,300
nsslapd-pluginarg1: ldap://config2-dir.siroe.com/dc=siroe,dc=com 7,7,300,3,300
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: passthruauth
nsslapd-pluginVersion: 5.0
nsslapd-pluginVendor: Sun | Netscape Alliance
nsslapd-pluginDescription: pass through authentication plugin


上一页      目录      索引      文档主页      下一页     
版权所有 © 2001 Sun Microsystems, Inc.。部分版权所有 © 2001 Netscape Communications Corp.。保留所有权利。

最近更新时间 2002 年 2 月 15 日