Skip to content

Commit

Permalink
Fix nullok_present.fail.sh of no_empty_passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Jan 6, 2025
1 parent d110d7b commit d55d84f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
PASSWORD_AUTH_FILE="/etc/pam.d/password-auth"

if ! $(grep -q "^[^#].*pam_unix\.so.*nullok" $PASSWORD_AUTH_FILE); then
sed -i --follow-symlinks 's/\([\s].*pam_unix\.so.*\)\s\(try_first_pass.*\)/\1nullok \2/' $PASSWORD_AUTH_FILE
sed -i --follow-symlinks 's/\(^[^#].*pam_unix\.so.*\)\s\(try_first_pass.*\)/\1nullok \2/' $PASSWORD_AUTH_FILE
fi

0 comments on commit d55d84f

Please sign in to comment.