Sanitize passwords from special characters

Currently users can enter literally anything in the password field, which is not always ok for the end applications. Would be nice for Virtualmin to prevent users from entering special characters like ' or " in the password field or automatically sanitize such entries.

Thanks for considerations.

Status: 
Closed (fixed)

Comments

Howdy -- you can add restrictions to what can be used as a password by going into Webmin -> System -> Users and Groups -> Module Config -> Password Restrictions.

There are a number of options you can tweak on that screen, but it sounds like you may want to set "Perl regexp to check password against" to look for certain characters.

Excellent advice! Thank you very much!

It works great, but throughs out a not very user-friendly message to the screen:

Failed to modify domain : Password does not match regexp ^[a-zA-Z0-9]+$

I wonder is there an easy way to replace this message to something like:

Only letters and numbers are allowed when choosing your password.

Sure, you can customize that by creating this file:

/etc/webmin/useradmin/custom-lang

And in there, add this line:

usave_epasswd_re=Only letters and numbers are allowed when choosing your password.

Once you do that, restart Webmin, and then it should use that customized text.