Skip to content

Commit

Permalink
Add "-Initial" replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Jan 21, 2025
1 parent d47766a commit d05e01f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ if ! grep -qE 'pam_pwhistory\.so\s+[^#\n]*\benforce_for_root\b' "$conf_file"; th
s/$/ enforce_for_root/g
}
}' "$conf_file"

sed -i -E '/^Password-Initial:/,/^[^[:space:]]/ {
/pam_pwhistory\.so/ {
s/$/ enforce_for_root/g
}
}' "$conf_file"
fi

DEBIAN_FRONTEND=noninteractive pam-auth-update --enable cac_pwhistory

0 comments on commit d05e01f

Please sign in to comment.