Skip to content

Instantly share code, notes, and snippets.

@mschmitt
Created May 14, 2013 08:08
Show Gist options
  • Save mschmitt/5574416 to your computer and use it in GitHub Desktop.
Save mschmitt/5574416 to your computer and use it in GitHub Desktop.
Disable password aging for all users without password hash and UID>=500
# Disable password aging for all users without password hash and UID>=500
perl -MUser::pwent -e 'while($e=getpwent()){$e->uid<500&&next;
$e->passwd!~/^!!/&&next;$cmd="chage -E -1 -I -1 -M -1 ".$e->name;
print"$cmd\n";system($cmd);}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment