Unix Technical Forum

Find users logged on more than once

This is a discussion on Find users logged on more than once within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi ! How can I get the list of users who are logged on more than once ? Can ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 10:47 AM
Revenger
 
Posts: n/a
Default Find users logged on more than once

Hi !
How can I get the list of users who are logged on more than once ?
Can someone help me with this ?
Thanks !
--
Pozdrav
Revenger
14.6.2006 09:55:51
Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da
itko sere po njemu.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 10:47 AM
James
 
Posts: n/a
Default Re: Find users logged on more than once

Revenger wrote:
> Hi !
> How can I get the list of users who are logged on more than once ?
> Can someone help me with this ?
> Thanks !
> --
> Pozdrav
> Revenger
> 14.6.2006 09:55:51
> Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da
> itko sere po njemu.


You might check the /var/adm/wtmp file or the output of "last" command
to
see if they could help.

Your question is not specific to AIX system, so I guess if you post the

question in comp.unix.shell or comp.unix.admin, you might get
responses in quick succession.

James

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 10:49 AM
steven_nospam at Yahoo! Canada
 
Posts: n/a
Default Re: Find users logged on more than once


Revenger wrote:
> Hi !
> How can I get the list of users who are logged on more than once ?
> Can someone help me with this ?
> Thanks !
> --
> Pozdrav


This is probably not the ideal way to do it if you have a lot of users
on the system, as you have to grep a file once for EVERY user entry,
but it works. It shows a list of any duplicate user logins at the time
of the sampling. I think this could be done using awk in a better way,
but didnt have time to sit down and figure it out.

# START OF SCRIPT
#!/bin/ksh
#set -vx
/bin/rm /tmp/user.snapshot 2>/dev/null
TIMESTAMP="$(date +"%c")"
who|sort|sed -e "s/ /!/g">/tmp/user.snapshot

TITLEBAR=Y
for LOOP in $(cat /tmp/user.snapshot)
do
USRNAM=$(echo "${LOOP}"|cut -c1-8)
if test $(cat /tmp/user.snapshot|grep "^${USRNAM}"|wc -l) -gt 1
then
if test "${TITLEBAR}" = "Y"
then
TITLEBAR=N
echo "\nList of Duplicate Users as of ${TIMESTAMP}:\n"
fi
echo "${LOOP}"|sed -e "s/!/ /g"
fi
done
/bin/rm /tmp/user.snapshot
# END OF SCRIPT

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com