Linux user password policy management

Reference Catalog for Linux learning sequence: https: //www.cnblogs.com/lv1572407/p/11815911.html

 

  In the first two chapters we have preliminary contact with the basics associated password policy. Now talk about in detail.

First, we look at how to change the password now.
[root @ mysql1 ~] # passwd user001 // interactively modify the password
Changing the User password for user001.
New password:
BAD PASSWORD: IT IS TOO simplistic / Systematic
BAD PASSWORD: IS TOO the Simple
the Retype new new password:
passwd: All authentication tokens Updated successfully .
[root @ mysql1 ~] # echo "MySQL" | passwd --stdin user001 // noninteractive Change password
Changing the User password for user001.
passwd: All authentication tokens Updated successfully.

Secondly, we have to learn how to set password policies.
[root @ mysql1 ~] # chage -l user001 // View user's default password policy information
Last Change password: Jun 13, 2019
Password the Expires: Never
Password inactive: Never
the Account the Expires: Never
Number The Days of the BETWEEN password Minimum Change: 0
the Maximum Number The Days of the BETWEEN Change password: 99999
Number The password of Days of the before warning the Expires: 7


there is a lot of chage command parameters, it is recommended that you do not go back, use the time that is viewed directly --help can.
Set Password recent modification time, this usually does not require manual settings, viewed mainly.
[root @ mysql1 ~] # chage -d "2018-08-08" user001

set account expiration date, the account expires after the ban on the use of the account.
[root @ mysql1 ~] # chage -E "2019-08-08" user001

password expiration, password available time, usually set to 7 days can be.
[root @ mysql1 ~] # chage -I 7 user001

password modify the minimum time interval and password to modify the maximum time interval.
[mysql1 the root @ ~] # 2 user001 the chage -m
[mysql1 the root @ ~] -M # 90 user001 the chage

before password expiration warning time.
[root @ mysql1 ~] # chage -W 7 user001

After configuring the above policy information, view user001 user's existing user policy.
[root @ mysql1 ~] # chage -l user001
Last password change : Aug 08, 2018
Password expires : Nov 06, 2018
Password inactive : Nov 13, 2018
Account expires : Aug 08, 2019
Minimum number of days between password change : 2
Maximum number of days between password change : 90
Number of days of warning before password expires : 7

Guess you like

Origin www.cnblogs.com/lv1572407/p/11816109.html