Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Enable Password Expiration for a User  (Read 2304 times)

0 Members and 1 Guest are viewing this topic.

Vinil

  • Guest
Enable Password Expiration for a User
« on: January 13, 2014, 10:09:20 am »
As we know, user’s passwords are stored in '/etc/shadow' file in encrypted format. To check password expiration of user’s, you need to use 'chage' command. It displays information of password expiration details along with last password change date.

To view any existing user’s aging information such as expiry date and time, use the following command.

# chage -l username

Code: [Select]
root@server.com [~]# chage -l vinzabb
Last password change                                    : Jan 01, 2014
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7


To change password aging of any user, use the following command.

Quote
#chage -M 60 username
#chage -M 60 -m 7 -W 7 userName


Parameters

    -M Set maximum number of days
    -m Set minimum number of days
    -W Set the number of days of warning