ѧϰLinux chageÏÂÁîµÄ²ÎÊýºÍÓ÷¨
ÎÊÌ⣺ÉîÈëÃ÷È·Linux chageÏÂÁîµÄ²ÎÊýºÍ¹¦Ð§
Linux²Ù×÷ϵͳ×÷ΪÌìÏÂÉÏ×îÊ¢ÐеIJÙ×÷ϵͳ֮һ£¬ÆäÇ¿Ê¢µÄ¹¦Ð§ºÍÎÞаÐÔ±¸ÊÜÓû§Çàíù¡£ÔÚLinuxϵͳÖУ¬ chage ÏÂÁîÊÇÒ»¸öºÜÊÇÓÐÓõŤ¾ß£¬ÓÃÓÚÖÎÀíÓû§µÄÃÜÂëÓâÆÚºÍÕÊ»§µ½ÆÚµÈÐÅÏ¢¡£Í¨¹ý¸ÃÏÂÁÖÎÀíÔ±¿ÉÒÔÇáËɵؿØÖÆÓû§µÄÃÜÂëÕ½ÂÔ£¬ÔöǿϵͳµÄÇå¾²ÐÔ¡£±¾ÎĽ«ÉîÈë̽ÌÖLinux chageÏÂÁîµÄ²ÎÊýºÍ¹¦Ð§£¬ÒÔ¼°ÌṩÏêϸµÄ´úÂëʾÀý£¬×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·ºÍʹÓøÃÏÂÁî¡£
1. chageÏÂÁî¸ÅÊö
chage ÏÂÁîÖ÷ÒªÓÃÀ´ÐÞ¸ÄÓû§ÃÜÂëÓâÆÚÐÅÏ¢£¬°üÀ¨ÃÜÂëµ½ÆÚÌõ¼þʾÌìÊý¡¢ÃÜÂëÓâÆÚʱ¼ä¡¢ÕË»§µ½ÆÚʱ¼äµÈ¡£Í¨¹ý chage ÏÂÁÖÎÀíÔ±¿ÉÒÔÎÞаµØ¶¨ÖÆÓû§µÄÃÜÂëÕ½ÂÔ£¬Ìá¸ßϵͳµÄÇå¾²ÐÔ¡£
2. chageÏÂÁî²ÎÊýÏê½â
ÔÚʹÓà chage ÏÂÁîʱ£¬¿ÉÒÔÖ¸¶¨²î±ðµÄ²ÎÊýÀ´ÊµÏÖ²î±ðµÄ¹¦Ð§¡£ÏÂÃæÊǼ¸¸ö³£ÓÃµÄ chage ÏÂÁî²ÎÊý£º
-l£ºÏÔʾÓû§µÄÃÜÂëÓâÆÚÐÅÏ¢¡£
-E£ºÉèÖÃÕË»§µÄʧЧʱ¼ä¡£
-M£ºÉèÖÃÃÜÂëÓÐÓÃÆÚ¡£
-m£ºÉèÖÃÃÜÂëÐ޸ľàÀë¡£
-W£ºÉèÖÃÃÜÂëµ½ÆÚÇ°ÖÒÑÔÌìÊý¡£
-I£ºÉèÖÃÕË»§²»Ô˶¯Ê±Ê§Ð§Ê±¼ä¡£
-d£ºÉèÖÃ×îºóÒ»´ÎÃÜÂë±ä»»µÄʱ¼ä¡£
3. chageÏÂÁîʾÀý
ÏÂÃæͨ¹ý¼¸¸öÏêϸµÄ´úÂëʾÀýÀ´ÑÝʾÔõÑùʹÓà chage ÏÂÁ
ʾÀý 1£ºÉó²éÓû§ÃÜÂëÓâÆÚÐÅÏ¢
chage -l user1
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÏÔʾÓû§ user1 µÄÃÜÂëÓâÆÚÐÅÏ¢£¬°üÀ¨ÉÏ´ÎÃÜÂëÐÞ¸Äʱ¼ä¡¢ÃÜÂëÓâÆÚʱ¼ä¡¢ÃÜÂëÓÐÓÃÆÚ¡¢ÃÜÂëÐ޸ľàÀëµÈ¡£
ʾÀý 2£ºÉèÖÃÕË»§µÄʧЧʱ¼ä
chage -E 2023-12-31 user1
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÉèÖÃÓû§ user1 µÄÕË»§Ê§Ð§Ê±¼äΪ2023Äê12ÔÂ31ÈÕ¡£
ʾÀý 3£ºÉèÖÃÃÜÂëÓÐÓÃÆÚ
chage -M 90 user1
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÉèÖÃÓû§ user1 µÄÃÜÂëÓÐÓÃÆÚΪ90Ìì¡£
ʾÀý 4£ºÉèÖÃÃÜÂëµ½ÆÚÇ°ÖÒÑÔÌìÊý
chage -W 7 user1
µÇ¼ºó¸´ÖÆ
¸ÃÏÂÁÉèÖÃÓû§ user1 µÄÃÜÂëµ½ÆÚÇ°ÖÒÑÔÌìÊýΪ7Ìì¡£
4. ×ܽá
ͨ¹ý±¾ÎĵÄÏÈÈÝ£¬¶ÁÕß¿ÉÒÔ¸üÉîÈëµØÃ÷È·Linux chageÏÂÁîµÄ²ÎÊýºÍ¹¦Ð§£¬ÕÆÎÕÔõÑùʹÓøÃÏÂÁîÀ´ÖÎÀíÓû§µÄÃÜÂëÓâÆÚÐÅÏ¢¡£ÔÚÏÖʵ²Ù×÷ÖУ¬ÖÎÀíÔ±¿ÉÒÔƾ֤ϵͳÐèÇóºÍÇå¾²Õ½ÂÔ£¬ÎÞаµØÉèÖÃÓû§µÄÃÜÂëÕ½ÂÔ£¬Ìá¸ßϵͳµÄÇå¾²ÐÔ¡£Ï£Íû±¾ÎĶԶÁÕßÓÐËù×ÊÖú£¬½Ó´ý¼ÌÐø¹Ø×¢LinuxϵͳµÄ¸ü¶àÊÊÓÃ֪ʶ¡£
ÒÔÉϾÍÊÇѧϰLinux chageÏÂÁîµÄ²ÎÊýºÍÓ÷¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡