1. Lock the user password
# usermod -L username
2. Force password change upon initial login.
# chage -d 0 username
3. Unlock the account
There are two common approaches to this step.
The administrator can assign an initial password or assign a null password.
Note: passwd disables the immediate password expiration just configured.
a. Assign a null password instead of an initial password.
# usermod -p "" username
b. Using Python interpreter with the python command and usermod.
# python
at the prompt, type the following commands. Replace
# import crypt; print crypt.crypt("
The output is the encrypted password, similar to '12CsGd8FRcMSM'.
Press Ctrl-D to exit the Python interpreter.
At the shell, enter the following command (replacing
# usermod -p "
4. Adding a new user account
# useradd myuser
# passwd myuser
source:redhat
No comments:
Post a Comment