Last active
November 29, 2018 22:32
-
-
Save jayers99/4790433a7069dd547f64a6559728c618 to your computer and use it in GitHub Desktop.
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
# see all users | |
sudo cat /etc/shadow | |
# list all users with a password set to expire | |
sudo cat /etc/shadow | grep ':90:' | |
# cut out just the user name | |
sudo cat /etc/shadow | grep ':90:' | tr ':' ' ' | awk '{print $1}' | |
# put those users in a var | |
USER_LIST=$(sudo cat /etc/shadow | grep ':90:' | tr ':' ' ' | awk '{print $1}') | |
# loop through those users and set expiration really high | |
for i in $USER_LIST; do echo $i; sudo passwd -x 99999 $i; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment