Éî¶ÈÆÊÎöLinux chageÏÂÁîµÄ¹¦Ð§ÓëÊÂÇéÔÀí
LinuxϵͳÖеÄchageÏÂÁîÊÇÓÃÀ´ÐÞ¸ÄÓû§Õ˺ŵÄÃÜÂëʧЧÈÕÆÚµÄÏÂÁҲ¿ÉÒÔÓÃÀ´ÐÞ¸ÄÕ˺ŵÄ×ºÍ×î¶Ì¿ÉÓÃÈÕÆڵȡ£¸ÃÏÂÁîÔÚÖÎÀíÓû§Õ˺ÅÇå¾²ÉÏÆ𵽺ÜÊÇÖ÷ÒªµÄ×÷Ó㬿ÉÒÔÓÐÓõؿØÖÆÓû§ÃÜÂëµÄʹÓÃÏÞÆÚ£¬ÔöǿϵͳµÄÇå¾²ÐÔ¡£
chageÏÂÁîµÄʹÓÃÒªÁ죺
chageÏÂÁîµÄ»ù±¾Ó﷨Ϊ£º
chage [Ñ¡Ïî] Óû§Ãû
µÇ¼ºó¸´ÖÆ
ÀýÈ磬ҪÐÞ¸ÄÓû§¡°testuser¡±µÄÃÜÂëʧЧÈÕÆÚ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
chage -l testuser
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
chageÏÂÁîµÄÑ¡Ï
-E DATE£ºÉèÖÃÃÜÂëµÄʧЧÈÕÆÚ¡£
-M DAYS£ºÉèÖÃÃÜÂëµÄ×ʹÓÃÌìÊý¡£
-m DAYS£ºÉèÖÃÃÜÂëµÄ×î¶ÌʹÓÃÌìÊý¡£
-I DAYS£ºÃÜÂëʧЧǰµÄÖÒÑÔÌìÊý¡£
-W DAYS£ºÃÜÂëÓâÆÚºóÕ˺ű»Ëø¶¨Ç°µÄÖÒÑÔÌìÊý¡£
chageÏÂÁîµÄÔÀí£º
chageÏÂÁîÏÖʵÉÏÊÇͨ¹ýÐÞ¸ÄÓû§Õ˺ŵÄ/etc/shadowÎļþÀ´ÊµÏֵġ£ÔÚLinuxϵͳÖУ¬Óû§µÄÃÜÂëÊÇÒÔ¼ÓÃÜÐÎʽ´æ´¢ÔÚ/etc/shadowÎļþÖеģ¬¶øchageÏÂÁîÔò¸ü¸ÄÁË/etc/shadowÎļþÖÐÏà¹Ø×ֶεÄÊýÖµ£¬´Ó¶øʵÏÖ¶ÔÃÜÂëʧЧÈÕÆÚµÈÊôÐÔµÄÐ޸ġ£
ÏÂÃæͨ¹ýÒ»¸öÏêϸʾÀýÀ´ËµÃ÷chageÏÂÁîµÄʹÓü°ÔÀí£º
¼ÙÉèÒªÐÞ¸ÄÓû§¡°testuser¡±µÄÃÜÂëʧЧÈÕÆÚΪ2022Äê12ÔÂ31ÈÕ£¬×ʹÓÃÌìÊýΪ90Ì죬×î¶ÌʹÓÃÌìÊýΪ7Ì죬ÃÜÂëʧЧǰµÄÖÒÑÔÌìÊýΪ14Ì죬ÃÜÂëÓâÆÚºóÕ˺ű»Ëø¶¨Ç°µÄÖÒÑÔÌìÊýΪ7Ì죬¿ÉÒÔƾ֤ÒÔÏ°취²Ù×÷£º
Éó²é¡°testuser¡±µÄÄ¿½ñÕ˺ÅÐÅÏ¢£º
chage -l testuser
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÐÞ¸ÄÕ˺ŵÄÏà¹ØÊôÐÔ£º
chage -E 2022-12-31 -M 90 -m 7 -I 14 -W 7 testuser
µÇ¼ºó¸´ÖÆ
ÔÙ´ÎÉó²é¡°testuser¡±µÄÕ˺ÅÐÅϢȷÈÏÐÞ¸ÄÉúЧ£º
chage -l testuser
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ͨ¹ýÒÔÉϲÙ×÷£¬¾Í¿ÉÒÔÀÖ³ÉÐÞ¸ÄÓû§¡°testuser¡±µÄÃÜÂëʧЧÈÕÆÚÒÔ¼°ÆäËûÏà¹ØÊôÐÔ¡£
×ܵÄÀ´Ëµ£¬chageÏÂÁîÊÇÒ»¸öºÜÊÇÊÊÓõÄÏÂÁ¿ÉÒÔ×ÊÖúÖÎÀíÔ±ÎÞаÖÎÀíÓû§Õ˺ŵÄÇå¾²ÐÔ£¬Í¨¹ý¿ØÖÆÃÜÂëµÄʧЧÈÕÆÚµÈÊôÐÔ£¬ÔöǿϵͳµÄÇå¾²ÐÔ¡£
ÒÔÉϾÍÊÇÉî¶ÈÆÊÎöLinux chageÏÂÁîµÄ¹¦Ð§ÓëÊÂÇéÔÀíµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡