How to Change Password Complexity

Hello masters, I hope everyone is well :blush:. Some help please. I need to register several emails on Hestia, but I need the password complexity to be able to be changed. More precisely, the first letter of the password must be lowercase, password length is OK. I’m importing a client, which has more than 200 machines with saved passwords. Guys from IT asked me for this help. I looked here on the forum and on Github, but I confess I didn’t find where I could change it.

Via Command line and it will by pass any complexity rules

2 Likes

Hi @LuxX360,

If you use command line script v-add-mail-account it won’t enforce password complexity (well, only minimum length to 6).

If you want to change it from Web UI you should edit function validate_password in file /usr/local/hestia/web/inc/main.php. Note that this change will be replaced in next Hestia update.

Example:

Original:

function validate_password($password) {
        return preg_match('/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(.){8,}$/', $password);
}

This won’t force case letters:

function validate_password($password) {
        return preg_match('/^(?=.*[a-zA-Z])(?=.*\d)(.){8,}$/', $password);
}
2 Likes

Thanks for the reply. Is there a command to change the password of already created accounts, like leaving all accounts with the same password?

v-change-mail-account-password user domain account newpw

2 Likes

Thank you again @eris @sahsanu. This last command and creating a script to read users in the email panel ( v-list-mail-accounts ) allowed changing everyone’s password in the blink of an eye.

2 Likes