gizzmo Posted April 30, 2003 Report Share Posted April 30, 2003 For Mandrake 9.1, is there a way to track the use of a file. On my network, I'm trying to audit when a user opens a specific file and then closes it. Any help would be apprecitated. Thanks Quote Link to comment Share on other sites More sharing options...
aru Posted May 3, 2003 Report Share Posted May 3, 2003 You can use "/usr/sbin/lsof" and maybe "/sbin/fuser" Here are some examples from lsof man page: To list all open files, use: ~# lsof To list all open files for login name ``abe'', or user ID 1234, or process 456, or process 123, or process 789, use: ~# lsof -p 456,123,789 -u 1234,abe To find the process that has /u/abe/foo open, use: ~# lsof /u/abe/foo To send a SIGHUP to the processes that have /u/abe/bar open, use: ~# kill -HUP `lsof -t /u/abe/bar` To find any open file, including an open UNIX domain socket file, with the name /dev/log, use: ~# lsof /dev/log There are more examples including nfs and network runs. Read both programs' man pages for more info. HTH Quote Link to comment Share on other sites More sharing options...
gizzmo Posted May 6, 2003 Author Report Share Posted May 6, 2003 Thanks aru, This will get me started. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.