Skip to content

Commit

Permalink
Only change password* section of configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Dec 11, 2024
1 parent d6f4761 commit 140a33f
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ for FILE in ${NULLOK_FILES}; do
done
{{% elif 'ubuntu' in product %}}
{{{ bash_pam_unix_enable() }}}
sed --follow-symlinks -i 's/\<nullok\>//g' /usr/share/pam-configs/cac_unix
config_file="/usr/share/pam-configs/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"

DEBIAN_FRONTEND=noninteractive pam-auth-update
{{% else %}}
if [ -f /usr/bin/authselect ]; then
Expand Down

0 comments on commit 140a33f

Please sign in to comment.