Virtualmin password generator is not including sometimes digits or upper letters

SYSTEM INFORMATION
OS type and version Debian 10
Webmin version 2.105
Virtualmin version 7.9.0
Related packages SUGGESTED

Hi, Im using Virtualmin PRO and I included requirements for passwords in “/etc/webmin/useradmin/config” with the following configuration:

passwd_min=8
passwd_re=^(?=.*[A-Z])(?=.*\d)(?=.*\W).+$
passwd_redesc=Password must contain at least 1 uppercase letter, 1 symbol (such as !, @, #, etc.), and 1 digit (from 0 to 9).

The problem im facing is when I add this rule for the generator of password in the following configuration “/etc/webmin/virtual-server/config”:
passwd_chars=12|a-z,A-Z,0-9,#

the password sometimes does not contain a digit or an upper letter and I can’t rely on the function “generate password” because it will give me the error from “passwd_redesc”. I took that rule from the answer of Ilia in that topic - Virtualmin Password Generator [#68641] | Virtualmin
Is there any way that I force the rule to contain at least one from each of my requirements ?

Example for generated password wih the rule:

#z,#0,#-0a

Hello @Ilia and @Joe ,

I was wondering if I could seek your expert opinion on this matter? Your insights would be greatly appreciated. Thank you!

Hello,

Thanks for the heads up! I agree, we need to improve password generation in both Webmin and Virtualmin, and use a new &substitute_pattern('regex', {'length' => n}); for generating a password with the given regex and required length.

@Jamie, if you don’t mind I will send you PRs for that?

1 Like

Thanks, please do!

1 Like

Alright, done:

1 Like

Thank you very much!

Could you please inform me when I can anticipate the release of the new code that I submitted as a request to Virtualmin? I kindly request this information to help me plan accordingly.

We cannot provide an ETA, sorry!

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.