As Linux system administrators, we must be clear about what tools are ideal for centralized administration and one of the most practical ways is to use the integrated distribution commands ..
Among the frequent tasks that we must carry out as IT support, is the administration of user accounts, both in their creation and editing , as well as establishing or changing the expiration and expiration of user passwords which is a Security policy every certain frequency modify said password.
For this, the chage command is useful which is used to modify the expiration information of the password of a specific user, allows us to see the age information of a user's account or change the number of days between password changes and the date of the last password..
Today in TechnoWikis we will see how to manage these details at the user level on Linux systems.
Once the password expiration and its expiration information have been configured, the system will use this information to determine when a user must change their password and thus indicate that they must make this change or else they will not be able to access To the system..
How to change the expiration date and expiration of passwords in Linux
Step 1
To see the age information of a user's account, we must use the
-l parameter like this:
sudo chage -l "user"
Step 2
To set the date or number of days (since January 1, 1970) when this password was last modified, we need to use the -d parameter like this:
sudo chage -d 2018-02-28 “userâ€
Step 3
Thus, we have established that the next date of change will be on February 28, 2018. Now, thanks to the chage command it will also be possible to set the date or number of days (from January 1, 1970) in which it is no longer Access to the selected user's account will be possible using the
-E parameter as follows:
sudo chage -E 2018-03-05 “userâ€
Step 4
In this case, when the user's account is locked, he must contact the system administrator to proceed with the unlocking of the system.
Step 5
If the matter is to set a password limit, we have the opportunity to send a warning message or information to it using the -W parameter which allows us to set the number of warning days before the password change is required:
sudo chage -W 15 “userâ€
Step 6
In addition to this, it will be possible to set the number of days of inactivity after a password has expired before your account is locked, for this we execute the following:
sudo chage -I 3 “user†(The number 3 can be defined as necessary)
Step 7
To check the edited information, we can execute the following command again:
sudo chage -l "users"
Step 8
Finally, to obtain general help we will use the following command:
man chage
In this way, we can see how simple it is to manage user passwords in Linux distributions.