17.3. パスワードの有効期限が切れてから一定時間アカウントを自動的に無効にする


この手順に従って、28 日を超えてパスワードを変更しない dc=example,dc=com エントリーの下のユーザーを非アクティブ化する時間ベースのロックアウトポリシーを設定します。

前提条件

  • ユーザーは、エントリーに passwordExpirationTime 属性を設定する必要があります。

手順

  1. パスワードの有効期限機能を有効にします。

    Copy to Clipboard Toggle word wrap
    # dsconf -D "cn=Directory Manager" ldap://server.example.com config replace passwordExp=on
  2. アカウントポリシープラグインを有効にします。

    Copy to Clipboard Toggle word wrap
    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin account-policy enable
  3. プラグイン設定エントリーを設定します。

    Copy to Clipboard Toggle word wrap
    # dsconf -D "cn=Directory Manager" ldap://server.example.com plugin account-policy config-entry set "cn=config,cn=Account Policy Plugin,cn=plugins,cn=config" --always-record-login yes --always-record-login-attr lastLoginTime --state-attr non_existent_attribute --alt-state-attr passwordExpirationTime --spec-attr acctPolicySubentry --limit-attr accountInactivityLimit

    コマンドは、以下のオプションを使用します。

    • --always-record-login yes: ログイン時間のログを有効にします。これは、acctPolicySubentry 属性が設定されていない場合でも、サービスクラス (CoS) またはアカウントポリシーを持つロールを使用するために必要です。
    • --always-record-login-attr lastLoginTime: アカウントポリシープラグインがユーザーの lastLoginTime 属性に最終ログイン時刻を保存するように設定します。
    • --state-attr non_existent_attribute: アカウントポリシーの評価に使用されるプライマリー時間属性を、存在しないダミー属性名に設定します。
    • --alt-state-attr `passwordExpirationTime: チェックする代替属性として passwordExpirationTime 属性を使用するようにプラグインを設定します。
    • --spec-attr acctPolicySubentry: acctPolicySubentry 属性が設定されているエントリーにポリシーを適用するように Directory Server を設定します。この属性は、CoS エントリーで設定します。
    • --limit-attr accountInactivityLimit: アカウントポリシーエントリーの accountInactivityLimit 属性に、最後にパスワードを変更した後にアカウントが非アクティブ化された時刻を保存するように設定します。
  4. インスタンスを再起動します。

    Copy to Clipboard Toggle word wrap
    # dsctl instance_name restart
  5. アカウント非アクティブ化ポリシーエントリーを作成します。

    Copy to Clipboard Toggle word wrap
    # ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x
    
    dn: cn=Account Inactivation Policy,dc=example,dc=com
    objectClass: top
    objectClass: ldapsubentry
    objectClass: extensibleObject
    objectClass: accountpolicy
    accountInactivityLimit: 2419200
    cn: Account Inactivation Policy

    accountInactivityLimit 属性の値は、パスワードが変更されてから 2419200 秒 (28 日) 後に Directory Server がアカウントを非アクティブ化するように設定します。

  6. CoS テンプレートエントリーを作成します。

    Copy to Clipboard Toggle word wrap
    # ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x
    
    dn: cn=TemplateCoS,dc=example,dc=com
    objectClass: top
    objectClass: ldapsubentry
    objectClass: extensibleObject
    objectClass: cosTemplate
    acctPolicySubentry: cn=Account Inactivation Policy,dc=example,dc=com

    このテンプレートエントリーは、アカウントの非アクティブ化ポリシーを参照します。

  7. CoS 定義エントリーを作成します。

    Copy to Clipboard Toggle word wrap
    # ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x
    
    dn: cn=DefinitionCoS,dc=example,dc=com
    objectClass: top
    objectClass: ldapsubentry
    objectclass: cosSuperDefinition
    objectclass: cosPointerDefinition
    cosTemplateDn: cn=TemplateCoS,dc=example,dc=com
    cosAttribute: acctPolicySubentry default operational-default

    この定義エントリーは CoS テンプレートエントリーを参照し、acctPolicySubentry 属性が各ユーザーエントリーに表示され、値が cn=Account Inactivation Policy,dc=example,dc=com 設定されます。

検証

  1. ユーザーの passwordExpirationTime 属性を、設定した非アクティブ時間よりも古い値に設定します。

    Copy to Clipboard Toggle word wrap
    # ldapmodify -H ldap://server.example.com -x -D "cn=Directory Manager" -W
    
    dn: uid=example,ou=People,dc=example,dc=com
    changetype: modify
    replace: passwordExpirationTime
    passwordExpirationTime: 20210101000000Z
  2. このユーザーとしてディレクトリーに接続してみてください。

    Copy to Clipboard Toggle word wrap
    # ldapsearch -H ldap://server.example.com -x -D "uid=example,ou=People,dc=example,dc=com" -W -b "dc=example,dc=com"
    ldap_bind: Constraint violation (19)
    	additional info: Account inactivity limit exceeded. Contact system administrator to reset.

    Directory Server がアクセスを拒否してこのエラーを返した場合、アカウントの非アクティブが機能します。

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat, Inc.