首页 > 编程知识 正文

东风猛士详细参数介绍,荣耀30s配置参数介绍

时间:2023-05-03 21:07:39 阅读:229085 作者:2434

一直不太明白chage -m参数的意思,从网上搜索也是没有搜到太好的例子,只是说明-m参数的功能,本人也不是太明白解释的意思:

-m  --mindays MIN_DAYS
           Set the minimum number of days between password changes to MIN_DAYS.
           A value of zero for this field indicates that the user may change
           his/her password at any time.

-m:中文解释的意思:密码可更改的最小天数。为零时代表任何时候都可以更改密码

后来看到hdsdxn的LINUX私房菜中的解决,才有些明白:-m  密码最短保留天数

经过测试最终明白了-m参数的意思:密码最短保留天数,此天数之内不能对密码进行修改,说直白一些就是从上次密码修改的日期+这个天数之内的日期不能修改密码,当用户尝试修改密码时,会提示如下信息:

You must wait longer to change your password
passwd: Authentication token manipulation error

root用户直接修改用户密码不受影响

例子如下:

test用户的密码过期策略如下,默认值:[root@desktop ~]# chage -l testLast password change: Jun 10, 2014Password expires: neverPassword inactive: neverAccount expires: neverMinimum number of days between password change: 0Maximum number of days between password change: 99999Number of days of warning before password expires: 7系统日期如下:[root@desktop ~]# dateThu Jun 12 00:37:14 CST 2014修改Minimum number of days between password change值:[root@desktop ~]# chage -m 2 test[root@desktop ~]# chage -l testLast password change: Jun 10, 2014Password expires: neverPassword inactive: neverAccount expires: neverMinimum number of days between password change: 2Maximum number of days between password change: 99999Number of days of warning before password expires: 7切换test用户,修改密码,会报如下错误:[root@desktop ~]# su - test[test@desktop ~]$ passwdChanging password for user test.Changing password for test.(current) UNIX password: You must wait longer to change your passwordpasswd: Authentication token manipulation error报如上错误的原因是由于密码保留的最短天数还没有到,即上次修改密码时间为2014年6月10日,密码最短保留天数为2天,则密码保留到2014年6月12日,此时间之内,密码不能修改,而到了2014年6月13日后,就可以修改密码继续测试:修改系统时间为2014年6月13日,显示修改后的日期:[test@desktop ~]$ dateFri Jun 13 00:45:56 CST 2014再次修改密码,成功:[test@desktop ~]$ passwdChanging password for user test.Changing password for test.(current) UNIX password: New password: Retype new password: passwd: all authentication tokens updated successfully.


版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。