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 帳號管理

沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...