Author Topic: Change password with SHA512-CRYPT  (Read 2471 times)

Offline the_extremist

  • Newbie
  • *
  • Posts: 9
Change password with SHA512-CRYPT
« on: September 07, 2020, 05:18:21 AM »
Hello, I have a problem. Trying to generate new password with sha-512-crypt.
In plain mode everything works fine with %p parameter, when I try to use crypt method I get the error, the is no coding function. Tryied with %P.

This is config.inc.ph

Code: [Select]
$config['password_driver'] = 'sql';
$config['password_confirm_current'] = false;
$config['password_minimum_length'] = 8;
$config['password_require_nonalpha'] = false;
$config['password_log'] = true;
$config['password_login_exceptions'] = true;
// If the server is accessed via fqdn, replace localhost by the fqdn:
#$config['password_hosts'] = array('192.168.45.2');
$config['password_force_save'] = true;
$config['password_algorithm'] = 'clear';
$config['password_force_new_user'] = true;

// SQL Driver options
$config['password_db_dsn'] = 'mysql://xxxxxxxxx:xxxxxxxxx@127.0.0.1/xxxxxxxxxxxxx';

$config['password_dovecotpw'] = '/usr/bin/doveadm pw';
$config['password_crypt_rounds'] = 50000;
$config['password_crypt_hash'] = 'SHA512-CRYPT';
$config['password_dovecotpw_method'] = 'SHA512-CRYPT';
$config['password_dovecotpw_with_method'] = true;
$config['password_algorithm'] = 'dovecot';

// SQL Update Query with encrypted password using random 8 character salt
$config['password_query'] = "UPDATE mailbox SET password = %P WHERE username=%u";

doveadm working fine I think

Code: [Select]
[root@localhost password]# doveadm pw -p 'ASDwqe123' -s SHA512-CRYPT
{SHA512-CRYPT}$6$m6iskStIm8EusmYK$ogeTjtqmLTJ660p8g0eVnFWBQcmnzXwRGKNZjOJ2T4t3t8xzvpBZ5u/MtgdXI.Uf3Lj8fxaLxJ8aZebEYaVEo0

Please help me with this

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: Change password with SHA512-CRYPT
« Reply #1 on: September 07, 2020, 07:03:28 AM »
password_algorithm='sha512-crypt' // needs to be in lower-case

Offline the_extremist

  • Newbie
  • *
  • Posts: 9
Re: Change password with SHA512-CRYPT
« Reply #2 on: September 07, 2020, 07:38:44 AM »
It's working now ;) Thanks :))