{"id":52097,"date":"2024-12-03T09:21:24","date_gmt":"2024-12-03T01:21:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52097\/"},"modified":"2024-12-03T09:21:24","modified_gmt":"2024-12-03T01:21:24","slug":"linux%e4%b8%adchage%e5%91%bd%e4%bb%a4%e7%9a%84%e8%af%ad%e6%b3%95%e6%98%af%e4%bb%80%e4%b9%88","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52097\/","title":{"rendered":"Linux\u4e2dchage\u547d\u4ee4\u7684\u8bed\u6cd5\u662f\u4ec0\u4e48"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Linux\u4e2dchage\u547d\u4ee4\u7684\u8bed\u6cd5\u662f\u4ec0\u4e48<\/h1>\n<p>\u54c8\u55bd\uff01\u5927\u5bb6\u597d\uff0c\u5f88\u9ad8\u5174\u53c8\u89c1\u9762\u4e86\uff0c\u6211\u662f\u7c73\u4e91\u7684\u4e00\u540d\u4f5c\u8005\uff0c\u4eca\u5929\u7531\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aLinux\u4e2dchage\u547d\u4ee4\u7684\u8bed\u6cd5\u662f\u4ec0\u4e48\u300b<\/span>\uff0c\u672c\u6587\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65\uff0c\u4e5f\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8f6c\u53d1! \u4e0b\u9762\u5c31\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01<\/p>\n<p>linux chage\u547d\u4ee4\u7b80\u4ecb\uff1a<\/p>\n<p>chage\u547d\u4ee4\u7528\u4e8e\u5bc6\u7801\u5b9e\u6548\u7ba1\u7406\uff0c\u8be5\u662f\u7528\u6765\u4fee\u6539\u5e10\u53f7\u548c\u5bc6\u7801\u7684\u6709\u6548\u671f\u9650\u3002\u5b83\u53ef\u4ee5\u4fee\u6539\u8d26\u53f7\u548c\u5bc6\u7801\u7684\u6709\u6548\u671f\u3002\u5bf9\u4e8echage\u547d\u4ee4\u7684\u63cf\u8ff0\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>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<\/p>\n<p>\u547d\u4ee4\u8bed\u6cd5\uff1a<\/p>\n<p>chage [options] user<\/p>\n<p>\u547d\u4ee4\u53c2\u6570\uff1a<\/p>\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u53c2\u6570<\/p>\n<\/td>\n<td>\n<p>\u63cf\u53d9<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-d<\/p>\n<\/td>\n<td>\n<p>\u6307\u5b9a\u5bc6\u7801\u6700\u540e\u4fee\u6539\u65e5\u671f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-e<\/p>\n<\/td>\n<td>\n<p>\u5bc6\u7801\u5230\u671f\u7684\u65e5\u671f\uff0c\u8fc7\u4e86\u8fd9\u5929\uff0c\u6b64\u8d26\u53f7\u5c06\u4e0d\u53ef\u7528\u30020\u8868\u793a\u9a6c\u4e0a\u8fc7\u671f\uff0c-1\u8868\u793a\u6c38\u4e0d\u8fc7\u671f\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-h<\/p>\n<\/td>\n<td>\n<p>\u663e\u793a\u5e2e\u52a9\u4fe1\u606f\u5e76\u9000\u51fa<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-i<\/p>\n<\/td>\n<td>\n<p>\u5bc6\u7801\u8fc7\u671f\u540e\uff0c\u9501\u5b9a\u8d26\u53f7\u7684\u5929\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-l<\/p>\n<\/td>\n<td>\n<p>\u5217\u51fa\u7528\u6237\u4ee5\u53ca\u5bc6\u7801\u7684\u6709\u6548\u671f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-m<\/p>\n<\/td>\n<td>\n<p>\u5bc6\u7801\u53ef\u4ee5\u66f4\u6539\u7684\u6700\u5c0f\u5929\u6570\u3002\u4e3a\u96f6\u4ee3\u8868\u4efb\u4f55\u65f6\u5019\u90fd\u53ef\u4ee5\u66f4\u6539\u5bc6\u7801\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-m<\/p>\n<\/td>\n<td>\n<p>\u5bc6\u7801\u4fdd\u6301\u6709\u6548\u7684\u6700\u5927\u5929\u6570\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>-w<\/p>\n<\/td>\n<td>\n<p>\u5bc6\u7801\u8fc7\u671f\u524d\uff0c\u63d0\u524d\u6536\u5230\u8b66\u544a\u4fe1\u606f\u7684\u5929\u6570\u3002<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<p>1: \u67e5\u770bchage\u547d\u4ee4\u7684\u5e2e\u52a9\u4fe1\u606f<\/p>\n<p>[root@db-server ~]#man chage<br \/>[root@db-server ~]# info chage<br \/>[root@db-server ~]# chage -h<br \/>usage: chage [options] user<\/p>\n<p><strong>options:<\/strong><\/p>\n<p>-d, &#8211;lastday last_day set last password change to last_day<br \/>-e, &#8211;expiredate expire_date set account expiration date to expire_date<br \/>-h, &#8211;help display this help message and exit<br \/>-i, &#8211;inactive inactive set password inactive after expiration<br \/>to inactive<br \/>-l, &#8211;list show account aging information<br \/>-m, &#8211;mindays min_days set minimum number of days before password<br \/>change to min_days<br \/>-m, &#8211;maxdays max_days set maximim number of days before password<br \/>change to max_days<br \/>-w, &#8211;warndays warn_days set expiration warning days to warn_days<\/p>\n<p>2\uff1a\u67e5\u770bmysql\u7528\u6237\u4ee5\u53ca\u5bc6\u7801\u7684\u6709\u6548\u671f<\/p>\n<p>[root@db-server ~]# chage -l mysql<br \/>last password change : mar 26, 2015<br \/>password expires : never<br \/>password inactive : never<br \/>account expires : never<br \/>minimum number of days between password change : -1<br \/>maximum number of days between password change : -1<br \/>number of days of warning before password expires : -1<br \/>[root@db-server ~]#<\/p>\n<p>3\uff1a\u8bbe\u7f6emysql\u7528\u623760\u5929\u540e\u5bc6\u7801\u8fc7\u671f\uff0c\u81f3\u5c117\u5929\u540e\u624d\u80fd\u4fee\u6539\u5bc6\u7801\uff0c\u5bc6\u7801\u8fc7\u671f\u524d7\u5929\u5f00\u59cb\u6536\u5230\u544a\u8b66\u4fe1\u606f\u3002<\/p>\n<p>[root@db-server ~]# chage -m 60 -m 7 -w 7 mysql<br \/>you have new mail in \/var\/spool\/mail\/root<br \/>[root@db-server ~]# chage -l mysql<br \/>last password change : mar 26, 2015<br \/>password expires : may 25, 2015<br \/>password inactive : never<br \/>account expires : never<br \/>minimum number of days between password change : 7<br \/>maximum number of days between password change : 60<br \/>number of days of warning before password expires : 7<br \/>[root@db-server ~]#<br \/>clip_image001<\/p>\n<p>4\uff1a\u5f3a\u5236\u65b0\u5efa\u7528\u6237\u7b2c\u4e00\u6b21\u767b\u9646\u65f6\u4fee\u6539\u5bc6\u7801<\/p>\n<p>[root@db-server home]# useradd test<br \/>[root@db-server home]# passwd test<br \/>changing password for user test.<br \/>new unix password:<br \/>retype new unix password:<br \/>passwd: all authentication tokens updated successfully.<br \/>[root@db-server home]# chage -d 0 test<br \/>you have new mail in \/var\/spool\/mail\/root<br \/>[root@db-server home]# chage -l test<br \/>last password change : password must be changed<br \/>password expires : never<br \/>password inactive : never<br \/>account expires : never<br \/>minimum number of days between password change : 0<br \/>maximum number of days between password change : 99999<br \/>number of days of warning before password expires : 7<\/p>\n<p><strong>\u4e0b\u9762\u7ed9\u5927\u5bb6\u4ecb\u7ecdlinux chage\u547d\u4ee4<\/strong><\/p>\n<p><strong>\u529f\u80fd\uff1a<\/strong>\u4fee\u6539\u5e10\u53f7\u548c\u5bc6\u7801\u7684\u6709\u6548\u671f\u9650<\/p>\n<p><strong>\u7528\u6cd5\uff1a<\/strong>chage[-l][-m mindays][-m maxdays][-i inactive][-e expiredate][-w warndays][-d lastdays]username<\/p>\n<p><strong>\u53c2\u6570\uff1a<br \/><\/strong><\/p>\n<p>-l\uff1a\u5217\u51fa\u7528\u6237\u7684\u4ee5\u53ca\u5bc6\u7801\u7684\u6709\u6548\u671f\u9650<br \/>-m:\u4fee\u6539\u5bc6\u7801\u7684\u6700\u5c0f\u5929\u6570<br \/>-m\uff1a\u4fee\u6539\u5bc6\u7801\u7684\u6700\u5927\u5929\u6570<br \/>-i\uff1a\u5bc6\u7801\u8fc7\u671f\u540e\uff0c\u9501\u5b9a\u5e10\u53f7\u7684\u5929\u6570<br \/>-d\uff1a\u6307\u5b9a\u5bc6\u7801\u6700\u540e\u4fee\u6539\u7684\u65e5\u671f<br \/>-e\uff1a\u6709\u6548\u671f\uff0c0\u8868\u793a\u7acb\u5373\u8fc7\u671f\uff0c-1\u8868\u793a\u6c38\u4e0d\u8fc7\u671f<br \/>-w\uff1a\u5bc6\u7801\u8fc7\u671f\u524d\uff0c\u5f00\u59cb\u8b66\u544a\u5929\u6570<\/p>\n<p>\u7406\u8bba\u8981\u638c\u63e1\uff0c\u5b9e\u64cd\u4e0d\u80fd\u843d\uff01\u4ee5\u4e0a\u5173\u4e8e\u300aLinux\u4e2dchage\u547d\u4ee4\u7684\u8bed\u6cd5\u662f\u4ec0\u4e48\u300b\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u5927\u5bb6\u90fd\u638c\u63e1\u4e86\u5427\uff01\u5982\u679c\u60f3\u8981\u7ee7\u7eed\u63d0\u5347\u81ea\u5df1\u7684\u80fd\u529b\uff0c\u90a3\u4e48\u5c31\u6765\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u5427\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u4e2dchage\u547d\u4ee4\u7684\u8bed\u6cd5\u662f\u4ec0\u4e48 \u54c8\u55bd\uff01\u5927\u5bb6\u597d\uff0c\u5f88\u9ad8\u5174\u53c8\u89c1\u9762\u4e86\uff0c\u6211\u662f\u7c73\u4e91\u7684\u4e00\u540d\u4f5c\u8005\uff0c\u4eca\u5929\u7531\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u300aLinux\u4e2dchage\u547d\u4ee4\u7684\u8bed\u6cd5\u662f\u4ec0\u4e48\u300b\uff0c\u672c\u6587\u4e3b\u8981\u4f1a\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65\uff0c\u4e5f\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8f6c\u53d1! \u4e0b\u9762\u5c31\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01 linux chage\u547d\u4ee4\u7b80\u4ecb\uff1a chage\u547d\u4ee4\u7528\u4e8e\u5bc6\u7801\u5b9e\u6548\u7ba1\u7406\uff0c\u8be5\u662f\u7528\u6765\u4fee\u6539\u5e10\u53f7\u548c\u5bc6\u7801\u7684\u6709\u6548\u671f\u9650\u3002\u5b83\u53ef\u4ee5\u4fee\u6539\u8d26\u53f7\u548c\u5bc6\u7801\u7684\u6709\u6548\u671f\u3002\u5bf9\u4e8echage\u547d\u4ee4\u7684\u63cf\u8ff0\u5982\u4e0b\u6240\u793a\uff1a 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 \u547d\u4ee4\u8bed\u6cd5\uff1a chage [options] user \u547d\u4ee4\u53c2\u6570\uff1a \u53c2\u6570 \u63cf\u53d9 -d \u6307\u5b9a\u5bc6\u7801\u6700\u540e\u4fee\u6539\u65e5\u671f -e \u5bc6\u7801\u5230\u671f\u7684\u65e5\u671f\uff0c\u8fc7\u4e86\u8fd9\u5929\uff0c\u6b64\u8d26\u53f7\u5c06\u4e0d\u53ef\u7528\u30020\u8868\u793a\u9a6c\u4e0a\u8fc7\u671f\uff0c-1\u8868\u793a\u6c38\u4e0d\u8fc7\u671f\u3002 -h \u663e\u793a\u5e2e\u52a9\u4fe1\u606f\u5e76\u9000\u51fa -i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52097","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52097"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52097\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}