7.2. Inactivating Users and Roles
A single user account or set of accounts can be temporarily inactivated. Once an account is inactivated, a user cannot bind to the directory. The authentication operation will fail.
Users and roles are inactivated using the operational attribute nsAccountLock. When an entry contains the nsAccountLock attribute with a value of true, the server rejects the bind.
The same procedures are used to inactivate users and roles. However, when a role is inactivated, the members of the role are inactivated, not the role entry itself. For more information about roles in general and how roles interact with access control in particular, see Chapter 5, Managing Entries with Roles, Class of Service, and Views.
The root entry (the entry corresponding to the root or sub suffix) on a database cannot be inactivated. Chapter 2, Creating Directory Entries has information on creating the entry for a root or sub suffix, and Chapter 3, Configuring Directory Databases has information on creating root and sub suffixes.
The following procedure describes inactivating a user or a role using the Console:
Select the Directory tab.
Browse the navigation tree in the left navigation pane, and double-click the user or role to inactivate.
The Edit Entry dialog box appears.
Alterntatively, select Inactivate from the Object menu.
Click Account in the left pane. The right pane states that the role or user is activate. Click the Inactivate to inactivate the user or role.
Click OK.
Once inactivated, the state of the object can be viewed by selecting Inactivation State from the View > Display menu. The icon of the object then appears in the right pane of the Console with a red slash through it.
To inactivate a user account, use the ns-inactivate.pl script. The following example describes using the ns-inactivate.pl script to inactivate Joe Frasier's user account:
ns-inactivate.pl -D Directory Manager -w secretpwd -p 389 -h example.com
-I "uid=jfrasier,ou=people,dc=example,dc=com"
The following table describes the ns-inactivate.pl options used in the example:
| Option Name | Description |
|---|---|
| -D | The DN of the directory administrator. |
| -w | The password of the directory administrator. |
| -p | Port used by the server. |
| -h | Name of the server on which the directory resides. |
| -I | DN of the user account or role to inactivate. |
For more information about running the ns-inactivate.pl script, refer to the Directory Server Configuration, Command, and File Reference.
The following procedure describes activating a user or a role using the Console:
Select the Directory tab.
Browse the navigation tree in the left navigation pane, and double-click the user or role to activate.
Alternatively, select Activate from the Object menu.
The Edit Entry dialog box appears.
Click Account in the left pane. The right pane states that the role or user is inactivated. Click the Activate to activate the user or role.
If the user or role is a member of another inactivated role, the Console displays an option for viewing the inactivated roles. Click Show Inactivated Roles to view the list of roles to which the user or role belongs.
Click OK.
Once reactivated, the state of the object can be viewed by selecting Inactivation State from the View menu. The icon of the role or user in the right pane of the Console appears as normal. The red slash through the icon indicating it was inactive disappears.
To activate a user account, use the ns-activate.pl script. The following example describes using the ns-activate.pl script to activate Joe Frasier's user account:
ns-activate.pl -D Directory Manager -w secretpwd -p 389 -h example.com
-I "uid=jfrasier,ou=people,dc=example,dc=com"
The following table describes the ns-inactivate.pl options used in the example:
| Option Name | Description |
|---|---|
| -D | The DN of the directory administrator. |
| -w | The password of the directory administrator. |
| -p | Port used by the server. |
| -h | Name of the server on which the directory resides. |
| -I | DN of the user account or role to activate. |
For more information about running the ns-activate.pl script, refer to the Directory Server Configuration, Command, and File Reference.