Rename and reorder number for pam module check.

This commit is contained in:
Samson-W 2019-05-10 15:49:17 +08:00
parent e35e51602a
commit 0c676832d1
17 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ apply () {
apt_install $PACKAGE
elif [ $FNRET = 2 ]; then
warn "$PATTERN is not present in $FILE"
add_line_file_before_pattern $FILE "password [success=1 default=ignore] pam_unix.so obscure sha512 remember=5" "# pam-auth-update(8) for details."
add_line_file_before_pattern $FILE "password [success=1 default=ignore] pam_unix.so obscure sha512" "# pam-auth-update(8) for details."
elif [ $FNRET = 3 ]; then
crit "$FILE is not exist, please check"
elif [ $FNRET = 4 ]; then

View File

@ -53,7 +53,7 @@ apply () {
apt_install $PACKAGE
elif [ $FNRET = 2 ]; then
warn "$PATTERN is not present in $FILE"
add_line_file_before_pattern $FILE "password [success=1 default=ignore] pam_unix.so obscure sha512 remember=5" "# pam-auth-update(8) for details."
add_line_file_before_pattern $FILE "password [success=1 default=ignore] pam_unix.so obscure sha512" "# pam-auth-update(8) for details."
elif [ $FNRET = 3 ]; then
crit "$FILE is not exist, please check"
elif [ $FNRET = 4 ]; then

View File

@ -15,9 +15,9 @@ set -u # One variable unset, it's over
HARDENING_LEVEL=3
PACKAGE='libpam-modules'
PATTERN='^password.*pam_unix.so'
PATTERN='^password.*pam_pwhistory.so'
FILE='/etc/pam.d/common-password'
KEYWORD='pam_unix.so'
KEYWORD='pam_pwhistory.so'
OPTIONNAME='remember'
CONDT_VAL=5
@ -54,7 +54,7 @@ apply () {
apt_install $PACKAGE
elif [ $FNRET = 2 ]; then
warn "$PATTERN is not present in $FILE"
add_line_file_before_pattern $FILE "password [success=1 default=ignore] pam_unix.so obscure sha512 remember=5" "# pam-auth-update(8) for details."
add_line_file_before_pattern $FILE "password required pam_pwhistory.so remember=5" "# pam-auth-update(8) for details."
elif [ $FNRET = 3 ]; then
crit "$FILE is not exist, please check"
elif [ $FNRET = 4 ]; then