1833873 Members
1907 Online
110063 Solutions
New Discussion

Re: User logon

 
SOLVED
Go to solution
Fuad_1
Regular Advisor

User logon

How can I find out all users who did not login for certain time.
Set goals, and work to achieve them
4 REPLIES 4
Deepak Extross
Honored Contributor

Re: User logon

You can use the "last" command.
Probably loop through all valid users ( see "man users"). Get the most recent login for each user and see if it is later than your time interval.
harry d brown jr
Honored Contributor

Re: User logon


Do you have a "trusted" system? If you do you could have passwd aging on and when they call to have their account reactivated then you know.

You could use "last".

Or you could list the .profiles in their home directories to see if it's been opened.

I'd suggest looking at this thread http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html


live free or die
harry
Live Free or Die
Bill McNAMARA_1
Honored Contributor
Solution

Re: User logon

using finger:
-------------
for i in $(cat /etc/passwd | cut -d: -f1)
do
finger $i| grep Never| xargs echo $i | grep Never
done

or using last
-------------

OPTIONS=""
OPTIONS=$#

echo "" > /tmp/there.loggedin$$
cat /etc/passwd | cut -d: -f 1 | sort > /tmp/passwd.users$$

for i in $(last $OPTIONS | awk {'print $1'} | sort | uniq)
do
grep $i /etc/passwd |cut -d: -f 1 | sort>> /tmp/there.loggedin$$
done

echo "Did not login:"
echo "--------------"
sdiff /tmp/there.loggedin$$ /tmp/passwd.users$$ | grep ">" | tr -s " " ""

rm /tmp/there.loggedin$$
rm /tmp/passwd.users$$

It works for me (tm)
Bill McNAMARA_1
Honored Contributor

Re: User logon

change
for i in $(last $OPTIONS
to
for i in $(last
It works for me (tm)