Re: Check when a user last logged in?



Jean-Pierre Radley typed (on Fri, Aug 08, 2008 at 04:22:26PM -0400):
| Jeff Hyman typed (on Fri, Aug 08, 2008 at 10:11:49AM -0400):
| | Assasin.x@xxxxxxxxx typed (on Thu, Aug 07, 2008 at 04:18:40PM -0700):
| | | I'm trying to make a script that will remove/point out or delete old
| | | user accounts. The problem is, I have no idea how to check when a
| | | user last logged in!
| | |
| | | Checking the modification date of the home folder will not work
| | | because there are many users that use the same home folder. I had
| | | heard SCO has some sort of built in way of checking for this, or that
| | | there is a unix command that can do it.
| | |
| | | Anybody out there able to help me out?
| | |
| | | Thanks in advance!
| |
| |
| | # last user_name | head -2
| | ... or ...
| | # last user_name | head -2 | tail -1
|
| Since the original poster is looking for "old user accounts", the 'last'
| command is useless, because it will only provide login data for the
| last one to seven days -- unless one has changed root's crontab to run
| /etc/cleanup at some time other than early Sunday morining.

Hello JP,

Interesting.... looks like I turned that OFF.
I personally like being able to use 'last' and go back in history.
Things do pop up from time-to-time especially around payroll
conflicts.... but thanks for the input.

- Jeff H

#! /bin/sh
# @(#) cleanup 69.1 98/02/16
---- clipped ----

# Clean up super-user log.
cp /usr/adm/sulog /usr/adm/Osulog
/usr/adm/sulog

# If accounting isn't enabled, clean up wtmp and wtmpx,
# being careful not to create them if they don't exist.
if [ -x /usr/lib/acct/acct_enable ] && /usr/lib/acct/acct_enable -cs; then
: Do nothing - accounting will clean up wtmp and wtmpx
else
# Next 3 lines - Sun Apr 20 12:52:38 EDT 2003 - JBH
# I want the 'last' command to stick around so I can verifiy
# whos logged in or out.
sync
# [ -f /etc/wtmp ] && >/etc/wtmp
# [ -f /etc/wtmpx ] && >/etc/wtmpx
fi

# Clean up miscellaneous files.
find / -type f -name core -atime +7 -local -exec rm -f {} \;
.



Relevant Pages

  • Re: Check when a user last logged in?
    ... | Since the original poster is looking for "old user accounts", ... Do nothing - accounting will clean up wtmp and wtmpx ...
    (comp.unix.sco.misc)
  • RE: how to cleanup a cached credential?
    ... >How can i clean up my cached credential on this WS to eliminate other ... >users to access the same resource?? ... then user accounts again. ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.windows.server.sbs)
  • Re: how to cleanup a cached credential?
    ... Kendall [MSFT]) wrote: ... >>How can i clean up my cached credential on this WS to eliminate other ... >then user accounts again. ...
    (microsoft.public.windows.server.sbs)
  • Re: Removing spyware from multipler user accounts
    ... If there are several user accounts on a Windows XP Home Edition ... > trying to clean up. ... Depends what scanner tool you're using, too, and what spyware. ...
    (microsoft.public.windowsxp.general)
  • RE: Internet Explorer Scripts error in regular mode now too
    ... Sorry Sue If I didn't give enough Details in my troubleshooting: ... wondows uses in User Accounts to present as pictures to select. ... tried the Reg file or the register command?. ... Error message when you try to open the User Accounts item in Control Panel ...
    (microsoft.public.windowsxp.security_admin)