• A talk to kedar.nitty-witty
  • About both of us
  • Copyright
  • Search
  • MySQL Resources
..::CHANGE is INEVITABLE::.. Kedar's Blog for MySQL and more
  • General
  • Just for fun
  • Review
  • Technical
  • MySQL
  • Guest Posts
  • Personal
  • Software
  • QA-Testing
  • RSS Feed
  • Twitter

Audit-Checking login history-to know WHO DID THAT on Redhat Linux

By
Kedar
– February 16, 2010
DiggDeliciousLinkedInRedditStumbleUponPrintMore...

I’m using Redhat Linux (RHEL 5). Yesterday I saw a bit suspicious activities and data movements under my “home” (/home/username directory).
I thought of investigate / audit through my Redhat linux machine and catch the “Right Person” / “Who did it”.

Following are the steps I followed: [which if you follow, you may follow.]

1. Retrieve all successful logins on the system

cat /var/log/secure* | grep Accepted > logins.txt
Now logins.txt will contain all successfull logins to you Redhat linux system.
You may go through the file and have a manual first look up.

[ad#ad-2-250x250img]

2. Check users at perticular time

Other command to find out last login details of perticular users we have last, lastb commands which shows listing of last logged in users.

The last program, which prints a detailed report of the times of the most recent user logins, does so by scanning the /var/log/wtmp file.

Output includes following details:

User name
Tty device number
Login date and time
Logout time
Total working time

It also has an option to search logins at perticular time as follows:
last -t YYYYMMDDHHMMSS – Display the state of logins as of the specified time.

Files used in this are:
/etc/utmp – This is a binary file that contains a record for every active tty line.
/var/adm/wtmp – Keeps track of both logins and logouts.

3. finger – It’s a user information lookup program

Finally you can get more information about user with the finger command.

finger -ls user-id – Above command will tell you linux user’s login name, real name, terminal name, write status, home directory, home phone number, login shell, mail status, and the contents of the files .plan .project .pgpkey .forward

So, ultimately I got the Right Person and later came to know he was in my “home” to do “right” tasks only.
I don’t know if any other way is available but this is one of the way I approched.

DiggDeliciousLinkedInRedditStumbleUponPrintMore...

You might also like::

  1. My Google Exploitation – Web History Graphs 2009
  2. Linux Shell Commands – quick how-tos
  3. MySQL Memory Usage Limits on 32 bit Linux
  4. crontab not working with dynamic date filename – rhel linux
  5. Simple Shell Script to Monitoring Disk Space on a Linux Machine
Tags: Audit Linux, linux, login history, Technical, Who did that, who logged in

No Comments

Start the ball rolling by posting a comment on this article!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

CAPTCHA Image
CAPTCHA Audio
Refresh Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Daily Popular
    • Collection for insulting – one liners
    • MyDumpSplitter-Extract tables from Mysql dump-shell script
    • How to echo colored text in linux shell script
  • Also Visit:

    My Photography
    My Quotes
    My Funny Pics

  • Register / Login
    • Register
    • Log in
  • Recent Comments
    • Kedar on Place to visit Mumbai: Alibaug 1-2 day tour weekend picnic
    • Kedar on Place to visit Mumbai: Alibaug 1-2 day tour weekend picnic
    • Kedar on MyDumpSplitter-Extract tables from Mysql dump-shell script
    • Kedar on Monitor multiple mysql replication using php: Updated
    • Kedar on Monitor multiple mysql replication using php: Updated

..::CHANGE is INEVITABLE::... All Rights Reserved.