How do I find last login time and date for users? - SCO

This is a discussion on How do I find last login time and date for users? - SCO ; I am working on a system that has been set up ages ago and I'm trying to figure out a way (if any) that I can clean up old, inactive user accounts. The problem is, that whoever set this up ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: How do I find last login time and date for users?

  1. How do I find last login time and date for users?

    I am working on a system that has been set up ages ago and I'm trying
    to figure out a way (if any) that I can clean up old, inactive user
    accounts. The problem is, that whoever set this up set it so all
    users use the same home folder... so checking home folder modification
    dates is not doable. last I found isn't really useful because I am
    unable to check for users that logged in say... 3 months ago.

    The basic aim here is to remove user accounts that have not logged in
    in 3 months or greater. With this current implementation, is there
    any way I can determine which users are inactive and which are not?

    Thanks!

  2. Re: How do I find last login time and date for users?

    Assasin.x@gmail.com typed (on Fri, Sep 05, 2008 at 12:35:02PM -0700):
    | I am working on a system that has been set up ages ago and I'm trying
    | to figure out a way (if any) that I can clean up old, inactive user
    | accounts. The problem is, that whoever set this up set it so all
    | users use the same home folder... so checking home folder modification
    | dates is not doable. last I found isn't really useful because I am
    | unable to check for users that logged in say... 3 months ago.
    |
    | The basic aim here is to remove user accounts that have not logged in
    | in 3 months or greater. With this current implementation, is there
    | any way I can determine which users are inactive and which are not?

    I suspect you're S.O.L. ...

    --
    JP

  3. Re: How do I find last login time and date for users?

    On Fri, 5 Sep 2008 12:35:02 -0700 (PDT), Assasin.x@gmail.com wrote:

    >I am working on a system that has been set up ages ago and I'm trying
    >to figure out a way (if any) that I can clean up old, inactive user
    >accounts. The problem is, that whoever set this up set it so all
    >users use the same home folder... so checking home folder modification
    >dates is not doable. last I found isn't really useful because I am
    >unable to check for users that logged in say... 3 months ago.
    >
    >The basic aim here is to remove user accounts that have not logged in
    >in 3 months or greater. With this current implementation, is there
    >any way I can determine which users are inactive and which are not?
    >
    >Thanks!


    I wrote a script for exactly the same pupose. It lists the last 4
    logins for each user in the passwd file


    :
    # @(#) last4 last 4 logins by user
    USERS=`grep -v NOLOGIN /etc/passwd | cut -d: -f1`
    for USER in $USERS
    do
    echo "---------- $USER --------------"
    last -n 4 $USER
    done


    --
    # Jeff Liebermann 150 Felker St #D Santa Cruz CA 95060
    # 831-336-2558 jeffl@comix.santa-cruz.ca.us
    # http://802.11junk.com jeffl@cruzio.com
    # http://www.LearnByDestroying.com AE6KS

  4. Re: How do I find last login time and date for users?


    ----- Original Message -----
    From: "Jean-Pierre Radley"
    Newsgroups: comp.unix.sco.misc
    To:
    Sent: Friday, September 05, 2008 4:53 PM
    Subject: Re: How do I find last login time and date for users?


    > Assasin.x@gmail.com typed (on Fri, Sep 05, 2008 at 12:35:02PM -0700):
    > | I am working on a system that has been set up ages ago and I'm trying
    > | to figure out a way (if any) that I can clean up old, inactive user
    > | accounts. The problem is, that whoever set this up set it so all
    > | users use the same home folder... so checking home folder modification
    > | dates is not doable. last I found isn't really useful because I am
    > | unable to check for users that logged in say... 3 months ago.
    > |
    > | The basic aim here is to remove user accounts that have not logged in
    > | in 3 months or greater. With this current implementation, is there
    > | any way I can determine which users are inactive and which are not?
    >
    > I suspect you're S.O.L. ...


    Well, he could identify 3 month stale accounts 3 months from now easy enough.

    --
    Brian K. White brian@aljex.com http://www.myspace.com/KEYofR
    +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
    filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!


  5. Re: How do I find last login time and date for users?

    On Sep 5, 1:59 pm, Jeff Liebermann wrote:
    > On Fri, 5 Sep 2008 12:35:02 -0700 (PDT), Assasi...@gmail.com wrote:
    > >I am working on a system that has been set up ages ago and I'm trying
    > >to figure out a way (if any) that I can clean up old, inactive user
    > >accounts. The problem is, that whoever set this up set it so all
    > >users use the same home folder... so checking home folder modification
    > >dates is not doable. last I found isn't really useful because I am
    > >unable to check for users that logged in say... 3 months ago.

    >
    > >The basic aim here is to remove user accounts that have not logged in
    > >in 3 months or greater. With this current implementation, is there
    > >any way I can determine which users are inactive and which are not?

    >
    > >Thanks!

    >
    > I wrote a script for exactly the same pupose. It lists the last 4
    > logins for each user in the passwd file
    >
    > :
    > # @(#) last4 last 4 logins by user
    > USERS=`grep -v NOLOGIN /etc/passwd | cut -d: -f1`
    > for USER in $USERS
    > do
    > echo "---------- $USER --------------"
    > last -n 4 $USER
    > done
    >
    > --
    > # Jeff Liebermann 150 Felker St #D Santa Cruz CA 95060
    > # 831-336-2558 je...@comix.santa-cruz.ca.us
    > #http://802.11junk.com je...@cruzio.com
    > #http://www.LearnByDestroying.com AE6KS


    Thanks! It definitely seems to be picking up user logins, however
    some of the users that I know have logged on in the past couple days
    are not showing up... :S.

  6. Re: How do I find last login time and date for users?

    Jeff Liebermann typed (on Fri, Sep 05, 2008 at 01:59:39PM -0700):
    | On Fri, 5 Sep 2008 12:35:02 -0700 (PDT), Assasin.x@gmail.com wrote:
    |
    | >I am working on a system that has been set up ages ago and I'm trying
    | >to figure out a way (if any) that I can clean up old, inactive user
    | >accounts. The problem is, that whoever set this up set it so all
    | >users use the same home folder... so checking home folder modification
    | >dates is not doable. last I found isn't really useful because I am
    | >unable to check for users that logged in say... 3 months ago.
    | >
    | >The basic aim here is to remove user accounts that have not logged in
    | >in 3 months or greater. With this current implementation, is there
    | >any way I can determine which users are inactive and which are not?
    | >
    | I wrote a script for exactly the same pupose. It lists the last 4
    | logins for each user in the passwd file
    |
    | :
    | # @(#) last4 last 4 logins by user
    | USERS=`grep -v NOLOGIN /etc/passwd | cut -d: -f1`
    | for USER in $USERS
    | do
    | echo "---------- $USER --------------"
    | last -n 4 $USER
    | done

    Ah, but please recall that the command 'last' depends on files that by
    default are destroyed every Sunday morning. The odds that the jerk who
    gave everyone the same home directory also disabled that weekly crontab
    task are, sez I, rather miniscule.

    --
    JP

  7. Re: How do I find last login time and date for users?

    On Fri, 5 Sep 2008 17:55:01 -0400, Jean-Pierre Radley
    wrote:

    >Jeff Liebermann typed (on Fri, Sep 05, 2008 at 01:59:39PM -0700):
    >| On Fri, 5 Sep 2008 12:35:02 -0700 (PDT), Assasin.x@gmail.com wrote:
    >|
    >| >I am working on a system that has been set up ages ago and I'm trying
    >| >to figure out a way (if any) that I can clean up old, inactive user
    >| >accounts. The problem is, that whoever set this up set it so all
    >| >users use the same home folder... so checking home folder modification
    >| >dates is not doable. last I found isn't really useful because I am
    >| >unable to check for users that logged in say... 3 months ago.
    >| >
    >| >The basic aim here is to remove user accounts that have not logged in
    >| >in 3 months or greater. With this current implementation, is there
    >| >any way I can determine which users are inactive and which are not?
    >| >
    >| I wrote a script for exactly the same pupose. It lists the last 4
    >| logins for each user in the passwd file
    >|
    >| :
    >| # @(#) last4 last 4 logins by user
    >| USERS=`grep -v NOLOGIN /etc/passwd | cut -d: -f1`
    >| for USER in $USERS
    >| do
    >| echo "---------- $USER --------------"
    >| last -n 4 $USER
    >| done


    >Ah, but please recall that the command 'last' depends on files that by
    >default are destroyed every Sunday morning. The odds that the jerk who
    >gave everyone the same home directory also disabled that weekly crontab
    >task are, sez I, rather miniscule.


    Good point. The last command relies on the file /etc/wtmp or
    /var/adm/wtmp to have the necessary data. I have the crontab entry
    that wipes wtmp every week disarmed on most of my system or switched
    to running every month or so after saving the old wmtp. The idea is
    to have a record of who's been on my machines. Incidentally, that's
    the problem with boilerplate crontabs. A good maintenance schedule
    for a small biz, is very different for that of an internet server, or
    major corporation.

    Also, wtmp records the user login, but not if the user switches to a
    different user (using su or sudo). Su attemps can be found in
    /usr/adm/sulog or /var/adm/sulog. It's text file and can be read
    directly.



    --
    # Jeff Liebermann 150 Felker St #D Santa Cruz CA 95060
    # 831-336-2558 jeffl@comix.santa-cruz.ca.us
    # http://802.11junk.com jeffl@cruzio.com
    # http://www.LearnByDestroying.com AE6KS

  8. Re: How do I find last login time and date for users?

    In article ,
    wrote:
    >I am working on a system that has been set up ages ago and I'm trying
    >to figure out a way (if any) that I can clean up old, inactive user
    >accounts. The problem is, that whoever set this up set it so all
    >users use the same home folder... so checking home folder modification
    >dates is not doable. last I found isn't really useful because I am
    >unable to check for users that logged in say... 3 months ago.
    >
    >The basic aim here is to remove user accounts that have not logged in
    >in 3 months or greater. With this current implementation, is there
    >any way I can determine which users are inactive and which are not?
    >
    >Thanks!


    Did the suggestions made when you last asked this question work?

    http://groups.google.com/group/comp....db90e443d30269

    John
    --
    John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/

  9. Re: How do I find last login time and date for users?

    John DuBois wrote:
    > In article ,
    > wrote:
    >> I am working on a system that has been set up ages ago and I'm trying
    >> to figure out a way (if any) that I can clean up old, inactive user
    >> accounts. The problem is, that whoever set this up set it so all
    >> users use the same home folder... so checking home folder modification
    >> dates is not doable. last I found isn't really useful because I am
    >> unable to check for users that logged in say... 3 months ago.
    >>
    >> The basic aim here is to remove user accounts that have not logged in
    >> in 3 months or greater. With this current implementation, is there
    >> any way I can determine which users are inactive and which are not?
    >>
    >> Thanks!

    >
    > Did the suggestions made when you last asked this question work?
    >
    > http://groups.google.com/group/comp....db90e443d30269
    >
    > John


    John,

    Why is the following wrong?

    # userls -l smf -x lastSuccessfulLoginTime
    smf {lastSuccessfulLoginTime 1146676216}
    # tcl
    tcl>fmtclock 1146676216
    Wed May 03 12:10:16 CDT 2006
    tcl>exit
    # ls -l /u/smf/.lastlogin
    -r-------- 1 smf auth 0 Sep 6 16:28 /u/smf/.lastlogin
    #

    System is SCO OS 5.0.7 with MP5

    --
    Steve Fabac
    S.M. Fabac & Associates
    816/765-1670

  10. Re: How do I find last login time and date for users?

    In article <48C3023E.7010707@att.net>,
    Steve M. Fabac, Jr. wrote:
    >John DuBois wrote:
    >> ...
    >> http://groups.google.com/group/comp....db90e443d30269

    >
    >John,
    >
    >Why is the following wrong?
    >
    ># userls -l smf -x lastSuccessfulLoginTime
    >smf {lastSuccessfulLoginTime 1146676216}
    ># tcl
    >tcl>fmtclock 1146676216
    >Wed May 03 12:10:16 CDT 2006
    >tcl>exit
    ># ls -l /u/smf/.lastlogin
    >-r-------- 1 smf auth 0 Sep 6 16:28 /u/smf/.lastlogin


    It's reporting the last successful password change time instead of last
    successful login time. I'll raise a bug report.

    The 'lastlogin' utility I mentioned reads the database directly and reports the
    correct time.

    John
    --
    John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/

+ Reply to Thread