diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/bash/shared.sh b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/bash/shared.sh index 9c097499f77..ea2a045456e 100644 --- a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/bash/shared.sh +++ b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/bash/shared.sh @@ -13,17 +13,7 @@ done {{% elif 'ubuntu' in product %}} {{{ bash_pam_unix_enable() }}} config_file="/usr/share/pam-configs/cac_unix" -sed -i -E '/^Password:/,/^[^[:space:]]/ { - /pam_unix\.so/ { - s/\s*nullok//g - } -}' "$config_file" - -sed -i -E '/^Password-Initial:/,/^[^[:space:]]/ { - /pam_unix\.so/ { - s/\s*nullok//g - } -}' "$config_file" +sed -iE 's/^(.*pam_unix\.so)([^#\n\r]+\s*)?(nullok)(.*)?$/\1\2\4/g' "$config_file" DEBIAN_FRONTEND=noninteractive pam-auth-update {{% else %}} diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/oval/shared.xml b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/oval/shared.xml index 8d670982225..05c6f635595 100644 --- a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/oval/shared.xml +++ b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/oval/shared.xml @@ -15,7 +15,7 @@ {{% if product in ["sle12", "sle15", "slmicro5"] %}} ^/etc/pam.d/.*$ {{% elif 'ubuntu' in product %}} - ^/etc/pam.d/common-password + ^/etc/pam.d/common-(password|auth|account|session|session-noninteractive)$ {{% else %}} ^/etc/pam.d/(system|password)-auth$ {{% endif %}} diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/no_nullok.pass.sh b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/no_nullok.pass.sh index 41454c199d9..a4a0080e61b 100644 --- a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/no_nullok.pass.sh +++ b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/no_nullok.pass.sh @@ -7,13 +7,14 @@ config_file=/usr/share/pam-configs/tmp_unix cat << EOF > "$config_file" Name: Unix authentication +Conflicts: unix Default: yes -Priority: 256 +Priority: 257 Auth-Type: Primary Auth: - [success=end default=ignore] pam_unix.so nullok try_first_pass + [success=end default=ignore] pam_unix.so try_first_pass Auth-Initial: - [success=end default=ignore] pam_unix.so nullok + [success=end default=ignore] pam_unix.so Account-Type: Primary Account: [success=end new_authtok_reqd=done default=ignore] pam_unix.so diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_commented.pass.sh b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_commented.pass.sh index a9fa304c5ac..18fc8421426 100644 --- a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_commented.pass.sh +++ b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_commented.pass.sh @@ -7,13 +7,14 @@ config_file=/usr/share/pam-configs/tmp_unix cat << EOF > "$config_file" Name: Unix authentication +Conflicts: unix Default: yes -Priority: 256 +Priority: 257 Auth-Type: Primary Auth: - [success=end default=ignore] pam_unix.so nullok try_first_pass + [success=end default=ignore] pam_unix.so try_first_pass # nullok Auth-Initial: - [success=end default=ignore] pam_unix.so nullok + [success=end default=ignore] pam_unix.so # nullok Account-Type: Primary Account: [success=end new_authtok_reqd=done default=ignore] pam_unix.so diff --git a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_present.fail.sh b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_present.fail.sh index 004e9c3692d..2d16d24e82a 100644 --- a/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_present.fail.sh +++ b/linux_os/guide/system/accounts/accounts-restrictions/password_storage/no_empty_passwords/tests/nullok_present.fail.sh @@ -7,8 +7,9 @@ config_file=/usr/share/pam-configs/tmp_unix cat << EOF > "$config_file" Name: Unix authentication +Conflicts: unix Default: yes -Priority: 256 +Priority: 257 Auth-Type: Primary Auth: [success=end default=ignore] pam_unix.so nullok try_first_pass