Reporting and Disabling Expired OS User Accounts

This section describes the procedure to report and disable expired user accounts.

Perform the following steps to report and disable expired user accounts:
  1. Log in as admusr on the source server.
    login: admusr
    Password: <current admin user password>
  2. Run the following command to run the report of expired users:
    $ sudo lastlog -b <N>

    Note:

    This command displays the users who have not logged in over N number of days. It also shows the users that have never logged in. To filter those users out of the display use the following command:
    $ sudo lastlog -b <N> | grep -v Never
  3. Run the following commnd to disable the user accounts identified by the lastlog report:
    $ sudo passwd -l <user acct>

    Note:

    Repeat this step for each user account you want to disable.
  4. Run the following commnd to re-enable an account:
    $ sudo passwd -u <user acct>

    Note:

    Repeat this step for each user account you want to re-enable.