iredmail-doc/html_bk/reset.user.password-zh_CN.html

67 lines
3.5 KiB
HTML
Raw Permalink 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.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>重置用户密码</title>
<link rel="stylesheet" type="text/css" href="./css/markdown.css" />
</head>
<body>
<div id="navigation">
<a href="https://www.iredmail.org" target="_blank">
<img alt="iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>&nbsp;
<span>iRedMail</span>
</a>
&nbsp;&nbsp;//&nbsp;&nbsp;<a href="./index.html">Document Index</a></div><div class="admonition note">
<p class="admonition-title">This tutorial is available in other languages. <a href="https://github.com/iredmail/docs">Help translate more</a></p>
<p><a href="./reset.user.password.html">English</a> /</p>
</div>
<h1 id="_1">重置用户密码</h1>
<blockquote>
<ul>
<li>SQL 版本推荐使用 SSHA512 密码。没有特殊情况请不要使用 MD5 密码。</li>
<li>BSD 系统的 SQL 后端推荐使用 BCRYPT 密码。</li>
</ul>
</blockquote>
<p>对于 MySQL 或者 PostgreSQL 后端,可以使用 <code>openssl</code><code>doveadm</code> 命令来生成
密码,然后用它替换掉旧密码。</p>
<p>例如:使用 <code>doveadm</code> 命令生成一个 SSHA512 密码:</p>
<pre><code>$ doveadm pw -s 'ssha512' -p '123456'
{SSHA512}jOcGSlKEz95VeuLGecbL0MwJKy0yWY9foj6UlUVfZ2O2SNkEExU3n42YJLXDbLnu3ghnIRBkwDMsM31q7OI0jY5B/5E=
</code></pre>
<p>要生成 MD5 密码,可以使用 <code>doveadm</code><code>openssl</code> 命令:</p>
<pre><code># doveadm pw -s 'MD5' -p '123456' | awk -F'{MD5}' '{print $2}'
$1$TDG8oXHb$6YB9NO5NZaZxku0xv6RsW0
# openssl passwd -1 123456
$1$TDG8oXHb$6YB9NO5NZaZxku0xv6RsW0
</code></pre>
<blockquote>
<p><strong>注意</strong>: SOGo groupware 不支持不带前缀的 md5 密码,所以如果要兼容 SOGo
请在 MD5 密码前添加一个 <code>{CRYPT}</code> 前缀。例如:
<code>{CRYPT}$1$TDG8oXHb$6YB9NO5NZaZxku0xv6RsW0</code>.</p>
</blockquote>
<ul>
<li>为用户 <code>user@domain.ltd</code> 重置密码:</li>
</ul>
<pre><code>sql&gt; USE vmail;
sql&gt; UPDATE mailbox SET password='{SSHA512}jOcGSlKEz95VeuLGecbL0MwJKy0yWY9foj6UlUVfZ2O2SNkEExU3n42YJLXDbLnu3ghnIRBkwDMsM31q7OI0jY5B/5E=' WHERE username='user@domain.ltd';
</code></pre>
<p>OpenLDAP 后端用户可以使用 phpLDAPadmin 或其它 LDAP 客户端工具。如果有其它
程序需要通过 LDAP 做验证,建议使用 <code>SSHA</code> 密码以保证通用性,不是所有程序都支持
SSHA512。</p>
<p>作为一种临时方案,可以重置为明文密码,然后立即登录 Roundcube webmail 或
启用了自助服务 (self-service) 功能的 iRedAdmin-Pro 修改密码。
例如:</p>
<pre><code>sql&gt; USE vmail;
sql&gt; UPDATE mailbox SET password='{PLAIN}123456' WHERE username='user@domain.ltd';
</code></pre>
<h2 id="_2">参考资料</h2>
<ul>
<li><a href="./password.hashes.html">iRedMail 支持的哈希密码</a></li>
</ul><div class="footer">
<p style="text-align: center; color: grey;">All documents are available in <a href="https://github.com/iredmail/docs/">GitHub repository</a>, and published under <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">Creative Commons</a> license. You can <a href="https://github.com/iredmail/docs/archive/master.zip">download the latest version</a> for offline reading. If you found something wrong, please do <a href="https://www.iredmail.org/contact.html">contact us</a> to fix it.</p>
</div></body></html>