54 lines
2.4 KiB
HTML
54 lines
2.4 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>Reset user password</title>
|
|
<link href="./css/markdown.css" rel="stylesheet"></head>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="navigation">
|
|
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
|
|
|
|
// <a href="./index.html">Document Index</a>
|
|
</div><h1 id="reset-user-password">Reset user password</h1>
|
|
<p>With MySQL or PostgreSQL backends, you can generate a password hash with
|
|
<code>openssl</code> or <code>doveadm</code> command first, then replace old one with this newly
|
|
generated one.</p>
|
|
<p>For example:</p>
|
|
<ul>
|
|
<li>Generate a salted MD5 password hash with <code>openssl</code> (plain password is <code>123456</code>
|
|
in this case):</li>
|
|
</ul>
|
|
<pre><code>$ openssl passwd -1 123456
|
|
$1$2dQ48hyz$.mCLeDSdPkP3fxVmARsB.0
|
|
</code></pre>
|
|
|
|
<p>Or, generate password hash with <code>doveadm</code>:</p>
|
|
<pre><code>$ doveadm pw -s 'ssha' -p '123456'
|
|
{SSHA}MU5Y8OfD9HylnHk4UQaVyaJf6Lugx6vt
|
|
</code></pre>
|
|
|
|
<ul>
|
|
<li>Reset password for user <code>user@domain.ltd</code> and <code>another-user@domain.ltd</code>:</li>
|
|
</ul>
|
|
<pre><code>sql> USE vmail;
|
|
sql> UPDATE mailbox SET password='$1$2dQ48hyz$.mCLeDSdPkP3fxVmARsB.0' WHERE username='user@domain.ltd';
|
|
sql> UPDATE mailbox SET password='{SSHA}MU5Y8OfD9HylnHk4UQaVyaJf6Lugx6vt' WHERE username='another-user@domain.ltd';
|
|
</code></pre>
|
|
|
|
<p>With OpenLDAP backend, you can reset it with phpLDAPadmin or other LDAP client
|
|
tools, <code>SSHA</code> is preferred.</p>
|
|
<p>Reference: <a href="./password.hashes.html">how to use or migrate password hashes</a></p><br /><p style="text-align: center;">If you found something wrong
|
|
in this document, please do
|
|
<a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.</p><p style="text-align: center; color: grey;">This tutorial is published under a <a href="http://creativecommons.org/licenses/by-nd/3.0/us/" target="_blank">CC BY-ND 3.0</a> license.<!-- Google Analytics -->
|
|
<script type="text/javascript">
|
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
|
</script>
|
|
<script type="text/javascript">
|
|
try {
|
|
var pageTracker = _gat._getTracker("UA-3293801-14");
|
|
pageTracker._trackPageview();
|
|
} catch(err) {}
|
|
</script>
|
|
</body></html> |