CHAGE
åç§°
大纲
æè¿°
é项
注æ
éç½®æä»¶
æä»¶
éåºå¼
åè§
åç§°
chage − æ´æ¹ç¨æ·å¯ç è¿æä¿¡æ¯
大纲
chage [é项] ç»å½ |
æè¿°
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 their password.
é项
chage å½ä»¤å¯ä»¥æ¥åçé项æï¼
−d, −−lastday LAST_DAY
Set the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY−MM−DD (or the format more commonly used in your area).
−E, −−expiredate EXPIRE_DATE
Set the date or number of days since January 1, 1970 on which the user’s account will no longer be accessible. The date may also be expressed in the format YYYY−MM−DD (or the format more commonly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again.
EXPIRE_DATE 设置为 −1 ä¼ç§»é¤è´¦æ·çè¿ææ¥æã
−h, −−help
ç°å®å¸®å©ä¿¡æ¯å¹¶éåºã
−I, −−inactive INACTIVE
Set the number of days of inactivity after a password has expired before the account is locked. The INACTIVE option is the number of days of inactivity. A user whose account is locked must contact the system administrator before being able to use the system again.
INACTIVE 设置为 −1 ä¼ç§»é¤è´¦æ·ç¦ç¨åè½ã
−l, −−list
ç°å®è´¦æ·å¹´é¾ä¿¡æ¯ã
−m, −−mindays MIN_DAYS
å¨å¯ç æ´æ¹ä¹é´çæå°å¤©æ°è®¾ç½®ä¸º MIN_DAYSãæ¤åæ®µä¸ç 0 å¼è¡¨ç¤ºç¨æ·å¯ä»¥å¨ä»»ä½æ¶é´æ´æ¹å¶å¯ç ã
−M, −−maxdays MAX_DAYS
Set the maximum number of days during which a password is valid. When MAX_DAYS plus LAST_DAY is less than the current day, the user will be required to change their password before being able to use their account. This occurrence can be planned for in advance by use of the −W option, which provides the user with advance warning.
MAX_DAYS 设置为 −1 ä¼ç§»é¤å¯ç æææ§æ£æ¥ã
−R, −−root CHROOT_DIR
Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
−W, −−warndays WARN_DAYS
Set the number of days of warning before a password change is required. The WARN_DAYS option is the number of days prior to the password expiring that a user will be warned their password is about to expire.
å¦ææ²¡æéæ©ä»»ä½é项ï¼chage ä¼è¿å¥äº¤äºæ¨¡å¼ï¼ä»¥ææå- 段çå½åå¼æç¤ºç¨æ·ãè¾å¥ä¸ä¸ªæ°å¼å¯ä»¥æ´æ¹è¿äºå- æ®µï¼æèç空使ç¨å½åå¼ãå½åå¼åºç°å¨ [ ] æ 记对éã
注æ
chage éè¦æä¸ä¸ªå½±åå¯ç æä»¶æå¯ç¨ã
åªæ root æå¯ä»¥ä½¿ç¨ chageï¼ä¸ä¸ªç¹æ®æåµæ¯ −l é项ï¼ç¨æ¥è®©éç¹æç¨æ·è§å¾èªå·±çå¯ç æè´¦æ·ä½æ¶è¿æã
éç½®æä»¶
å¨ /etc/login.defs 䏿å¦ä¸éç½®åéï¼å¯ä»¥ç¨æ¥æ´æ¹æ¤å·¥å·çè¡ä¸ºï¼
æä»¶
/etc/passwd
ç¨æ·è´¦æ·ä¿¡æ¯ã
/etc/shadow
å®å¨ç¨æ·è´¦æ·ä¿¡æ¯ã
éåºå¼
chage å½ä»¤æå¦ä¸éåºå¼ï¼
0
æå
1
æéä¸å¤
2
æ æçå½ä»¤è¯æ³
15
æ æ³æ¾å°å½±åå¯ç æä»¶
åè§
passwd(5), shadow(5).