You can use this to get users of regular user ids listed in login.defs:
Code:
MIN=$(grep '^UID_MIN' /etc/login.defs)
MAX=$(grep '^UID_MAX' /etc/login.defs)
awk -F':' -v "min=${MIN##UID_MIN}" -v "max=${MAX##UID_MAX}" '{ if ( $3 >= min && $3 <= max ) print $1}' /etc/passwd >> userlist
And you could feed that into the chage command to reset the expiry of those users to, say... 60 days from now:
Code:
while read u; do
echo "chage -M 60 $u"
#chage -M 60 $u
done < userlist
Test that first,. if it works to satisfaction, you can remove the 'echo' part and uncomment the command. Or change it to suit your specific need.