程式扎記: [Linux 文章收集] Linux turn OFF password expiration / aging

標籤

2014年12月4日 星期四

[Linux 文章收集] Linux turn OFF password expiration / aging

Source From Here 
/etc/shadow stores actual password in encrypted format for user’s account with additional properties related to user password. The password expiration information for a user is contained in the last 6 fields. Password expiration for a select user can be disabled by editing the /etc/shadow file 

However I recommend using chage command. The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password. 
 

To list current aging type chage command as follows: 
$ chage -l training
Last password change : Dec 11, 2013
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 disable password aging / expiration for user foo, type command as follows and set: 
$ sudo chage training
Changing the aging information for training
Enter the new value, or press ENTER for the default

Minimum Password Age [0]:
 0
Maximum Password Age [99999]: 99999
Last Password Change (YYYY-MM-DD) [2013-12-11]: # Just enter
Password Expiration Warning [7]: # Just enter
Password Inactive [-1]: -1
Account Expiration Date (YYYY-MM-DD) [1969-12-31]: # Just enter

OR 
$ sudo chage -I -1 -m 0 -M 99999 -E -1 username

Supplement 
鳥哥私房菜 - Linux 帳號管理

沒有留言:

張貼留言

網誌存檔

關於我自己

我的相片
Where there is a will, there is a way!