uTools-Manuals/docs/linux/chpasswd.html
2019-04-21 11:50:48 +08:00

16 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="chpasswd">chpasswd</h1>
<p>批量更新用户口令的工具</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>chpasswd命令</strong> 是批量更新用户口令的工具,是把一个文件内容重新定向添加到<code>/etc/shadow</code>中。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">chpasswd(选项)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-e输入的密码是加密后的密文
-h显示帮助信息并退出
-m当被支持的密码未被加密时使用MD5加密代替DES加密。</code></pre>
<h3 id="实例">实例</h3>
<p>先创建用户密码对应文件,格式为<code>username:password</code>,如<code>abc:abc123</code>必须以这种格式来书写并且不能有空行保存成文本文件user.txt然后执行chpasswd命令</p>
<pre><code class="language-bash">chpasswd &lt; user.txt</code></pre>
<p>以上是运用chpasswd命令来批量修改密码。是linux系统管理中的捷径。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->