Q. How can I force my Linux users to change their passwords upon the first login under CentOS / Debian Linux?
A. You can use any one of the following command to change user passwords upon the first login:
[a] usermod command - Modify various user account properties including user password expiry information.
Where,
[b] chage command - Change user password expiry information
Task: Use chage command to force users to chage their password upon first login
Use the following syntax:
chage -d 0 {user-name}
# chage -d 0 tom
- -d 0 : Set the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD. By setting it to zero, you are going to force user to change password upon first login.
Further readings:
- man pages usermod and chage
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 09/11/08



{ 3 comments… read them below or add one }
Very useful tip!
I’ll use it.
Excellent tip for livecds… Thanks!!
Great …….. Very Useful