Skip to content

Instantly share code, notes, and snippets.

@Winding6636
Created November 15, 2019 11:10
Show Gist options
  • Save Winding6636/959b51421f17e4b8b34df7e0bdb4202b to your computer and use it in GitHub Desktop.
Save Winding6636/959b51421f17e4b8b34df7e0bdb4202b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Change the max password days to 99999
cat /etc/shadow | cut -d: -f1 | xargs -I {} chage -I -1 -m 0 -M 99999 -E -1 -W 7 {}
sed -i 's/^PASS_MAX_DAYS.*/PASS_MAX_DAYS 99999/' /etc/login.defs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment