本程序經由套用角色與服務類別 (CoS),指定現有的專用密碼策略給一組使用者。如需角色與 CoS 的詳細資訊,請參閱第 9 章, 目錄伺服器群組、角色與 CoS。
若要完成此程序,必須有可指定的專用密碼策略。請參閱建立密碼策略。
您可以使用 DSCC 執行此作業。如需相關資訊,請參閱目錄服務控制中心介面與 DSCC 線上說明。
除非另外指定,否則此處顯示的資料範例來自於 Example.ldif。
建立要由密碼策略所決定的項目角色。
例如,下列指令會為 Example.com 的臨時員工建立篩選的角色:
$ cat tmp.ldif dn: cn=TempFilter,ou=people,dc=example,dc=com objectclass: top objectclass: LDAPsubentry objectclass: nsRoleDefinition objectclass: nsComplexRoleDefinition objectclass: nsFilteredRoleDefinition cn: TempFilter nsRoleFilter: (&(objectclass=person)(status=contractor)) description: filtered role for temporary employees $ ldapmodify -a -D uid=kvaughan,ou=people,dc=example,dc=com -w - -f tmp.ldif Enter bind password: modifying entry cn=TempFilter,ou=people,dc=example,dc=com $ |
如 Example.ldif 中所示,kvaughan 是人力資源部門的經理,具有修改 dc=example,dc=com 項目的存取權。Vaughan 的連結密碼如 Example.ldif 中所示,為 bribery。
建立服務類別以產生密碼策略項目的 DN。
DN 為具有您所建立的角色之使用者的 pwdPolicySubentry 屬性值。
例如,下列指令會為 Example.com 的臨時員工建立篩選的角色。這些指令會為擁有該角色的使用者指定 cn=TempPolicy,dc=example,dc=com。
$ cat cos.ldif dn: cn=PolTempl,dc=example,dc=com objectclass: top objectclass: nsContainer dn: cn="cn=TempFilter,ou=people,dc=example,dc=com", cn=PolTempl,dc=example,dc=com objectclass: top objectclass: extensibleObject objectclass: LDAPsubentry objectclass: costemplate cosPriority: 1 pwdPolicySubentry: cn=TempPolicy,dc=example,dc=com dn: cn=PolCoS,dc=example,dc=com objectclass: top objectclass: LDAPsubentry objectclass: cosSuperDefinition objectclass: cosClassicDefinition cosTemplateDN: cn=PolTempl,dc=example,dc=com cosSpecifier: nsRole cosAttribute: pwdPolicySubentry operational $ ldapmodify -a -D uid=kvaughan,ou=people,dc=example,dc=com -w - -f cos.ldif Enter bind password: modifying entry cn=TempFilter,ou=people,dc=example,dc=com $ |
狀態為 contractor 的使用者現在變成遵循密碼策略 cn=TempPolicy,dc=example,dc=com。