Can we get the list of users who accessed a file

Hi all,
I will thankful if anybody helps me in finding out the users who accessed any of our files.

Thanks in advance
Chanakya

Hey,

I have the same problem now that you had long back.
Did you get any solution(s) for this problem ? If yes, I'll appriciate if you'll share the solution to this problem.

I have also been looking to this problem since past 15 days and losts of research is being done to solve this problem.
As you can look into Qs posted by myself in recent times, under Advanced and Expert Unix forum..in this site only.. with title "inode table location ??"

Please help me, if you can !!

Thanks in advance !!:slight_smile:

Try This one

------------------------------------------------------------------------

Once again I dun have any *NIX box with me. So why Just giving one logic by which you will get your answer.
-------------------------------------------------------------
#!/bin/bash

## List all the files which one accessed since last 1 min #####
for file_dir in `find <parent-dir> -atime -1`

do
### Find out the PID for that files which one been accessed
pid=`fuser -f $file_dir`

### Find out the owner/user name for that Process
### Replace the $access_user_filed with the filed no from the ps -ef
### command
user=`ps -ef | grep $pid | awk { print $access_user_filed }`
echo " $file_dir access by the $user " >> File_Access_List "
mail -s " File Access List " user@yourdomain.com < File_Access_List
done