Results 1 to 5 of 5

Thread: How to record the daily login and logout time of a particular user?

  1. #1

    How to record the daily login and logout time of a particular user?

    as titled.

    Thanks for any kind of help!
    JMY(晉明夷)
    http://mfYoga.org -- 瑜伽班 |瑜伽課程
    http://JinMY.me -- JMY 晉明日誌

  2. #2
    Join Date
    Mar 2011
    Location
    19th Hole
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to record the daily login and logout time of a particular user?

    All user access activity is recorded in /var/log/auth.log which is replaced every few days so that the older data is being spun off to auth.log.1 auth.log.2 etc.

    You can look for individual users by building a script (which is beyond my knowledge). A quick and dirty method would be to filter through grep, e.g.:
    Code:
    cat /var/log/auth.log | grep user_name
    Newb: How far must I jump to clear the ledge halfway down?
    Guru: It's bad to jump off cliffs. Let's look at better options.
    Newb: Stop harping about "best practices" and just let me jump.


  3. #3
    Join Date
    Aug 2010
    Location
    Baltimore, MD
    Beans
    25
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: How to record the daily login and logout time of a particular user?

    Try putting the following in a .bash_login file.
    Code:
    punchcard="$HOME/.punchcard"
    echo "in:" >> $punchcard
    date >> $punchcard
    And this in the .bash_logout file.
    Code:
    punchcard="$HOME/.punchcard"
    echo "out:" >> $punchcard
    date >> $punchcard
    Both in the user's home directory.

    The file .punchard will contain the time of login and logout.
    Last edited by sgy; March 22nd, 2013 at 06:48 PM.

  4. #4
    Join Date
    Feb 2010
    Location
    WI USA
    Beans
    10,249
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: How to record the daily login and logout time of a particular user?

    You can see if this is of value or not. http://www.cyberciti.biz/tips/howto-...ccounting.html
    Infinite diversity in infinite combination.

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Manual

  5. #5

    Re: How to record the daily login and logout time of a particular user?

    Thanks all for your comments!
    -> will try them out!
    JMY(晉明夷)
    http://mfYoga.org -- 瑜伽班 |瑜伽課程
    http://JinMY.me -- JMY 晉明日誌

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •