Linux user account password expire and Force password reset on first login

 check the password aging and expire details

#chage -l BOOBI

Last password change                                    : Oct 14, 2020

Password expires                                        : Nov 28, 2020

Password inactive                                       : never

Account expires                                         : never

Minimum number of days between password change          : 1

Maximum number of days between password change          : 45

Number of days of warning before password expires       : 14


//how to set the same password again in linux

#passwd -d boobi
//it will delete the old password log

#passwd boobi
//here you can set your old password again

# passwd -x -1 boobi
//it will adjust you password aging

# chage -l boobi
Last password change                                    : Oct 14, 2020
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 1
Maximum number of days between password change          : -1
Number of days of warning before password expires       : 14

#passwd boobi

//manually set password expire date using chage

# chage -l bvocdev
Last password change                                    : Mar 18, 2021
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

# chage -M 90 -m 7 -W 7 bvocdev

# chage -l bvocdev
Last password change                                    : Mar 18, 2021
Password expires                                        : Jun 16, 2021
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 7
Maximum number of days between password change          : 90
Number of days of warning before password expires       : 7


//user forced to reset the password on their first login

# passwd boobi
//prompt th epassword 

#passwd -e boobi
//it expires the password

//so whenever the user login the user account with the password which we created it will ask you to rest on it's first login.


Post a Comment

0 Comments