LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-18-2006, 11:19 PM   #1
sixerjman
Member
 
Registered: Sep 2004
Distribution: Debian Testing / Unstable
Posts: 180
Blog Entries: 1

Rep: Reputation: 32
Is there any way to tell which user last accessed a file?


I have a script that monitors access to files (using 'stat' to get the access time) but I couldn't find any switches to show the user which performed the access.

I know about 'fuser' and 'lsof' but those commands identify open files
and I just want to check last (completed) access.

Any help would be appreciated. Thanks in advanced!
 
Old 10-18-2006, 11:30 PM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
I suppose you can look at each user's home directory and find their .bash_history file
 
Old 10-19-2006, 01:28 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint, Tribblix
Posts: 9,746

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
That depend on the O/S.
You'll need some kernel tracing facility.
Under Solaris 10+ or the latest MacOS/X, a simple DTrace script would do the job.
Under Linux, nothing equivalent exists. Simpler experimental ways to explore are KProbes, LTT, DProbes, SystemTraps and probably others.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning permissions for a file to be accessed by particular users praveen kumar Linux - Networking 3 05-18-2006 10:20 AM
file created/accessed dates plainkeyman Linux - General 4 10-27-2005 07:34 PM
user home directorys can't be accessed anymore r_squared Linux - General 1 01-04-2005 08:35 PM
Slack 9: mounted FAT32 partitions cannot be accessed by normal user Obi-Wan_Kenobi Slackware 6 07-12-2003 11:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration