Created
October 18, 2023 02:23
-
-
Save KnightsWhoSayNi0/e0ede89506da5996f110d97a9698da53 to your computer and use it in GitHub Desktop.
Simple script to edit password policies in linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE="${FILE:-"/etc/login.defs"}" | |
sed -i "s/^[^#]*PASS_MAX_DAYS.*$/PASS_MAX_DAYS 90/" "${FILE}" | |
sed -i "s/^[^#]*PASS_MIN_DAYS.*$/PASS_MIN_DAYS 7/" "${FILE}" | |
sed -i "s/^[^#]*PASS_WARN_AGE.*$/PASS_WARN_AGE 14/" "${FILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment