There are two steps to creating a user with the command line tools included with Red Hat Linux:
1. Issue the useradd command to create a locked user account.
2. Unlock the account by issuing the passwd command to assign a password and set password aging guidelines.
To configure a user account in this manner, follow these steps:
1. Create the user account using the useradd command. — At this point the account is created, but locked.
2. Force immediate password expiration — To do this. type the following command:
chage -d 0
This sets the value for the date the password was last changed to the epoch (January 1, 1970). This value forces immediate password expiration no matter what password aging policy, if any, is in place.
3. Unlock the account — There are two common approaches to this. The administrator can assign an initial password:
/usr/sbin/usermod -p "<password>"
In the above command, replace <password> with the initial password.
Or, the administrator can assign a null password:
/usr/sbin/usermod -p ""