跳过导航链接 | |
退出打印视图 | |
系统管理指南:命名和目录服务(DNS、NIS 和 LDAP) Oracle Solaris 10 8/11 Information Library (简体中文) |
4. 网络信息服务 (Network Information Service, NIS)(概述)
11. 为使用 LDAP 客户机设置 Sun Java System Directory Server(任务)
使用 idsconfig 配置 Sun Java System Directory Server
如何使用 idsconfig 配置 Sun Java System Directory Server
如何使用 ldapaddent 向 Sun Java System Directory Server 置备用户口令数据
如何使用 ldapclient 向目录服务器置备其他配置文件
迁移 Sun Java System Directory Server
从 Solaris 10 10/09 发行版开始,可以为使用 pam_ldap 和 pam_unix 的客户机实现帐户管理。
注意 - 不要在同一 LDAP 命名域中同时使用 pam_ldap 和 pam_unix。所有客户机要么都使用 pam_ldap,要么都使用 pam_unix。因为存在这种限制,您可能需要专用的 LDAP 服务器。 |
为了让 pam_ldap 能够正常工作,必须在服务器上正确配置口令和帐户锁定策略。您可以使用 Directory Server Console 或 ldapmodify 为 LDAP 目录配置帐户管理策略。有关过程和更多信息,请参见所用的 Sun Java System Directory Server 版本的管理指南中的“用户帐户管理”一章。
注 - 以前,如果启用了 pam_ldap 帐户管理,所有用户在每次登录系统时都必须提供登录口令以进行验证。因此,使用 rsh、rlogin 或 ssh 等工具进行的不基于口令的登录将会失败。
但是现在,pam_ldap(5) 与 Sun Java System Directory Servers DS5.2p4 及更高发行版配合使用时,用户可以使用 rsh、rlogin、rcp 和 ssh 登录,而不需要提供口令。
pam_ldap(5) 现已修改为执行帐户管理和检索用户帐户状态,而不需要用户在登录时向目录服务器进行身份验证。目录服务器上对这一操作的新的控制为 1.3.6.1.4.1.42.2.27.9.5.8,它在缺省情况下是启用的。
要将此控制从缺省状态修改为其他状态,请在目录服务器上添加访问控制指令 (Access Control Instructions, ACI):
dn: oid=1.3.6.1.4.1.42.2.27.9.5.8,cn=features,cn=config objectClass: top objectClass: directoryServerFeature oid:1.3.6.1.4.1.42.2.27.9.5.8 cn:Password Policy Account Usable Request Control aci: (targetattr != "aci")(version 3.0; acl "Account Usable"; allow (read, search, compare, proxy) (groupdn = "ldap:///cn=Administrators,cn=config");) creatorsName: cn=server,cn=plugins,cn=config modifiersName: cn=server,cn=plugins,cn=config
绝不应当允许 proxy 用户的口令过期。如果代理口令过期,使用 proxy 凭证级别的客户机将无法从服务器检索命名服务信息。为了确保代理用户的口令不过期,请使用以下脚本修改代理帐户:
# ldapmodify -h ldapserver -D administrator DN \ -w administrator password <<EOF dn: proxy user DN DNchangetype: modify replace: passwordexpirationtime passwordexpirationtime: 20380119031407Z EOF
注 - pam_ldap 帐户管理依赖 Sun Java System Directory Server 为用户维护和提供口令生命期和帐户过期信息。目录服务器不会解释 shadow 项中的对应数据来验证用户帐户。但是,pam_unix 会检查阴影数据以确定帐户是否处于锁定状态或者口令是否已失效。由于 LDAP 命名服务或目录服务器不会使阴影数据保持最新,因此 pam_unix 不应当基于阴影数据授予访问权限。阴影数据是通过 proxy 标识检索的。因此,请不要允许 proxy 用户对 userPassword 属性具有读取访问权限。拒绝 proxy 用户对 userPassword 的读取访问权限可防止 pam_unix 进行无效的帐户验证。
要使 Solaris LDAP 客户机能够使用 pam_unix 进行帐户管理,服务器必须设置为启用阴影数据更新。从 Solaris 10 10/09 发行版开始,该项功能可用。与 pam_ldap 帐户管理不同,pam_unix 不需要额外的配置步骤。所有配置均可运行 idsconfig 实用程序来执行。对于基本的 idsconfig 运行,请参见示例 11-1。
下面显示了两个 idsconfig 运行的输出。
第一个 idsconfig 运行使用现有的客户机配置文件。
# /usr/lib/ldap/idsconfig It is strongly recommended that you BACKUP the directory server before running idsconfig. Hit Ctrl-C at any time before the final confirmation to exit. Do you wish to continue with server setup (y/n/h)? [n] y Enter the JES Directory Server's hostname to setup: myserver Enter the port number for iDS (h=help): [389] Enter the directory manager DN: [cn=Directory Manager] Enter passwd for cn=Directory Manager : Enter the domainname to be served (h=help): [west.example.com] Enter LDAP Base DN (h=help): [dc=west,dc=example,dc=com] Checking LDAP Base DN ... Validating LDAP Base DN and Suffix ... sasl/GSSAPI is not supported by this LDAP server Enter the profile name (h=help): [default] WestUserProfile Profile 'WestUserProfile' already exists, it is possible to enable shadow update now. idsconfig will exit after shadow update is enabled. You can also continue to overwrite the profile or create a new one and be given the chance to enable shadow update later.
Just enable shadow update (y/n/h)? [n] y Add the administrator identity (y/n/h)? [y] Enter DN for the administrator: [cn=admin,ou=profile,dc=west,dc=example,dc=com] Enter passwd for the administrator: Re-enter passwd: ADDED: Administrator identity cn=admin,ou=profile,dc=west,dc=example,dc=com. Proxy ACI LDAP_Naming_Services_proxy_password_read does not exist for dc=west,dc=example,dc=com. ACI SET: Give cn=admin,ou=profile,dc=west,dc=example,dc=com read/write access to shadow data. ACI SET: Non-Admin access to shadow data denied. Shadow update has been enabled.
第二个 idsconfig 运行创建了新的配置文件供以后使用。这里显示的只是部分输出。
# /usr/lib/ldap/idsconfig It is strongly recommended that you BACKUP the directory server before running idsconfig. Hit Ctrl-C at any time before the final confirmation to exit. Do you wish to continue with server setup (y/n/h)? [n] y Enter the JES Directory Server's hostname to setup: myserver Enter the port number for iDS (h=help): [389] Enter the directory manager DN: [cn=Directory Manager] Enter passwd for cn=Directory Manager : Enter the domainname to be served (h=help): [west.example.com] Enter LDAP Base DN (h=help): [dc=west,dc=example,dc=com] Checking LDAP Base DN ... Validating LDAP Base DN and Suffix ... sasl/GSSAPI is not supported by this LDAP server Enter the profile name (h=help): [default] WestUserProfile-new Default server list (h=help): [192.168.0.1] . . . Do you want to enable shadow update (y/n/h)? [n] y
Summary of Configuration 1 Domain to serve : west.example.com 2 Base DN to setup : dc=west,dc=example,dc=com Suffix to create : dc=west,dc=example,dc=com 3 Profile name to create : WestUserProfile-new . . . 19 Enable shadow update : TRUE . . . Enter DN for the administrator: [cn=admin,ou=profile,dc=west,dc=example,dc=com] Enter passwd for the administrator: Re-enter passwd: WARNING: About to start committing changes. (y=continue, n=EXIT) y 1. Changed timelimit to -1 in cn=config. 2. Changed sizelimit to -1 in cn=config. . . . 11. ACI for dc=test1,dc=mpklab,dc=sfbay,dc=sun,dc=com modified to disable self modify. . . . 15. Give cn=admin,ou=profile,dc=west,dc=example,dc=com write permission for shadow. ...