I notice there are settings in /etc/pam.d/common-password to define minimum password strength. For example:
...
password requisite pam_pwquality.so retry=3 maxrepeat=0 minlen=19 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 reject_username enforce_for_root dictcheck=0
password required pam_pwhistory.so remember=10 use_authtok enforce_for_root
...
These checks are run when passwd is run. I want to check if a given string will pass these checks but I don't want it to actually modify the user's password if it succeeds. Essentially I am looking for something like passwd --dry-run.
How can I achieve this