Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

C2 check user profile id

Rupert_1
Advisor

C2 check user profile id

Hi,

Tru64 V4.0f, C2 security.I want to do housekeepng, what command to use to find out the user which has not login for 100 days.
I have more than 200 users.
Thks.
2 REPLIES
Ivan Ferreira
Honored Contributor

Re: C2 check user profile id

This perl script should do the job:

$NOW = time();
$LINE = `/usr/sbin/edauth -g $ARGV[0] | grep u_suclog`;

@FIELDS = split(/:/,$LINE);
foreach (@FIELDS) {
if ( $_ =~ /u_suclog/ )
{ ($junk,$TIME) = split(/#/);} }

$TIMEDIFF=$NOW-$TIME;

if ($TIMEDIFF > 8640000) {
print "The user has not logged on since 100 days or more\n";
print "Last access : ", scalar localtime($TIME), "\n";
}


Save as check.pl and run:

perl check.pl username
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ivan Ferreira
Honored Contributor

Re: C2 check user profile id

You can also run like this:

for user in `cut -d":" -f1 /etc/passwd`; do checkuser.pl; done
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?