cancel
Showing results for 
Search instead for 
Did you mean: 

show all logins with expiry

 
brian_31
Super Advisor

show all logins with expiry

In redhat linux (RHEL5) is there a way to show all the users on the box (like hp-ux logins) with user passwd expiry information?

Thanks

Brian
2 REPLIES
Matti_Kurkela
Honored Contributor

Re: show all logins with expiry

Is "passwd -S -a" what you're looking for?

Alternatively, if you're looking for expiration dates, "chage -l "... but it takes one user at a time only.

However, that's easy to fix:

cut -d : -f 1 < /etc/passwd | while read user
do
echo
echo "User: $user"
chage -l "$user"
done

MK
MK
brian_31
Super Advisor

Re: show all logins with expiry

MK

passwd -S -a does not seem to work on my RHEL box (not sure why!), But the script you put does the Job. Thanks much MK!

Thanks

Brian.