1833642 Members
4815 Online
110062 Solutions
New Discussion

inactive users

 
Ron Irving
Trusted Contributor

inactive users

Good afternoon gentlemen!!

How would I locate user names that have not been active in say 60 days?

Find command?

Thanks in advance!!
Should have been an astronaut.
7 REPLIES 7
Tingli
Esteemed Contributor

Re: inactive users

One way is you can finger the user.
Patrick Wallek
Honored Contributor

Re: inactive users

Is your system trusted? If it is you can 'getprpw' to get information about each user.

# /usr/lbin/getprpw -m slogint username

Will show the last successful login for the user 'username'.
Ron Irving
Trusted Contributor

Re: inactive users

well...we have over 1000 users. That would be alot of fingers.
Should have been an astronaut.
OldSchool
Honored Contributor

Re: inactive users

"a lot of fingers"...

awk -F: "{print $1}" /etc/passwd | finger

might get you started
Dennis Handly
Acclaimed Contributor

Re: inactive users

>OldSchool: "a lot of fingers"...
>awk -F: "{print $1}" /etc/passwd | finger

Probably needs a few more: :-)
awk -F: '{print $1}' /etc/passwd | xargs finger
Patrick Wallek
Honored Contributor

Re: inactive users

The commands give should get you started. It is not that difficult to write a script to repeat the command for all users.

If you have a trusted system and want to run the getprpw command I mentioned for all users, this would do:

for MYUSER in $(do
echo "${MYUSER} - \c"
/usr/lbin/getprpw -m slogint ${MYUSER}
done
Patrick Wallek
Honored Contributor

Re: inactive users

I'm a bit off kilter tonight apparently. What you really need:

for MYUSER in $(awk -F: '{print $1}' /etc/passwd)
do
echo "${MYUSER} - \c"
/usr/lbin/getprpw -m slogint ${MYUSER}
done


Ignore my script above.