Unix administration - Re: Need script to extract from /etc/security/lastlog -> list of users and their la

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2005 > Re: Need script to extract from /etc/security/lastlog -> list of users and their la





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Need script to extract from /etc/security/lastlog -> list of users and their la
Dan

2005-01-18, 5:56 pm

I wanted something similar, that used only native base AIX/ksh
commands, and that sorted output in reverse chrono sequence.

The idea was mine; the final working version was achieved with the
generous help of Paul Landay at us.ibm.com

#!/bin/ksh

UIDS=`last | cut -f1 -d' ' | cat -n | sort -k 2.1 | uniq -f1 | sort
-n | cut -f2`

for UID in $UIDS
do
last -1 $UID
done


I chose to name it "who.last". It leaves a bit to be desired in column
alignment, etc. occasionally, but is good enough to see the last time
users (including other sysadmins) were in (provided you don't allow
remote login directly to root, of course.)

Apologies for the google groups, our organization has let our newsfeed
subscription lapse.

Dan Goodman

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com