mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-03-03 19:47:13 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
<h2 id="补充说明">补充说明</h2>
|
||||
<p><strong>chage命令</strong> 是用来修改帐号和密码的有效期限。</p>
|
||||
<h3 id="语法">语法</h3>
|
||||
<pre><code>chage [选项] 用户名</code></pre>
|
||||
<pre><code class="language-bash">chage [选项] 用户名</code></pre>
|
||||
<h3 id="选项">选项</h3>
|
||||
<pre><code>-m:密码可更改的最小天数。为零时代表任何时候都可以更改密码。
|
||||
<pre><code class="language-bash">-m:密码可更改的最小天数。为零时代表任何时候都可以更改密码。
|
||||
-M:密码保持有效的最大天数。
|
||||
-w:用户密码到期前,提前收到警告信息的天数。
|
||||
-E:帐号到期的日期。过了这天,此帐号将不可用。
|
||||
@@ -14,12 +14,12 @@
|
||||
-l:例出当前的设置。由非特权用户来确定他们的密码或帐号何时过期。</code></pre>
|
||||
<h3 id="实例">实例</h3>
|
||||
<p>可以编辑<code>/etc/login.defs</code>来设定几个参数,以后设置口令默认就按照参数设定为准:</p>
|
||||
<pre><code>PASS_MAX_DAYS 99999
|
||||
<pre><code class="language-bash">PASS_MAX_DAYS 99999
|
||||
PASS_MIN_DAYS 0
|
||||
PASS_MIN_LEN 5
|
||||
PASS_WARN_AGE 7</code></pre>
|
||||
<p>当然在<code>/etc/default/useradd</code>可以找到如下2个参数进行设置:</p>
|
||||
<pre><code># useradd defaults file
|
||||
<pre><code class="language-bash"># useradd defaults file
|
||||
GROUP=100
|
||||
HOME=/home
|
||||
INACTIVE=-1
|
||||
@@ -29,7 +29,7 @@ SKEL=/etc/skel
|
||||
CREATE_MAIL_SPOOL=yes</code></pre>
|
||||
<p>通过修改配置文件,能对之后新建用户起作用,而目前系统已经存在的用户,则直接用chage来配置。</p>
|
||||
<p>我的服务器root帐户密码策略信息如下:</p>
|
||||
<pre><code>[root@linuxde ~]# chage -l root
|
||||
<pre><code class="language-bash">[root@linuxde ~]# chage -l root
|
||||
最近一次密码修改时间 : 3月 12, 2013
|
||||
密码过期时间 :从不
|
||||
密码失效时间 :从不
|
||||
@@ -38,7 +38,7 @@ CREATE_MAIL_SPOOL=yes</code></pre>
|
||||
两次改变密码之间相距的最大天数 :99999
|
||||
在密码过期之前警告的天数 :7</code></pre>
|
||||
<p>我可以通过如下命令修改我的密码过期时间:</p>
|
||||
<pre><code>[root@linuxde ~]# chage -M 60 root
|
||||
<pre><code class="language-bash">[root@linuxde ~]# chage -M 60 root
|
||||
[root@linuxde ~]# chage -l root
|
||||
最近一次密码修改时间 : 3月 12, 2013
|
||||
密码过期时间 : 5月 11, 2013
|
||||
@@ -48,7 +48,7 @@ CREATE_MAIL_SPOOL=yes</code></pre>
|
||||
两次改变密码之间相距的最大天数 :60
|
||||
在密码过期之前警告的天数 :9</code></pre>
|
||||
<p>然后通过如下命令设置密码失效时间:</p>
|
||||
<pre><code>[root@linuxde ~]# chage -I 5 root
|
||||
<pre><code class="language-bash">[root@linuxde ~]# chage -I 5 root
|
||||
[root@linuxde ~]# chage -l root
|
||||
最近一次密码修改时间 : 3月 12, 2013
|
||||
密码过期时间 : 5月 11, 2013
|
||||
|
||||
Reference in New Issue
Block a user