diff --git a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_retry/bash/ubuntu.sh b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_retry/bash/ubuntu.sh index 7491f465d7c8..a0e6201f1682 100644 --- a/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_retry/bash/ubuntu.sh +++ b/linux_os/guide/system/accounts/accounts-pam/password_quality/password_quality_pwquality/accounts_password_pam_retry/bash/ubuntu.sh @@ -2,4 +2,9 @@ {{{ bash_instantiate_variables("var_password_pam_retry") }}} -{{{ bash_ensure_pam_module_options('/etc/pam.d/common-password', 'password', 'requisite', 'pam_pwquality.so', 'retry', "$var_password_pam_retry", "$var_password_pam_retry") }}} +{{{ bash_pam_pwquality_enable() }}} +PAM_FILE_PATH=/usr/share/pam-configs/cac_pwquality +if grep -qE 'pam_pwquality\.so.*retry=[^[:space:]]' "$PAM_FILE_PATH"; then + sed -i -E '/pam_pwquality\.so/ s/\bretry=[^[:space:]]*\b ?//' "$PAM_FILE_PATH" +fi +{{{ bash_pam_pwquality_parameter_value('retry', "$var_password_pam_retry") }}}