LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-11-2010, 12:27 AM   #1
hamedhsn
Member
 
Registered: Feb 2010
Distribution: opensuse 11.2
Posts: 57

Rep: Reputation: 0
log access file program


hi.
i want to make a program to write the result of access to a file ,i mean for example a user wants to (open,delete,edit)a file but if he has no access to this file ,something write to a log file.
so after that i can check which user got access denied by accessing to which file.
can anybody help me?
or if any tools available that can do this?
or if there is any built in log access file that record the permission denied to files?

any help/hint would be appreciated..
thanks in advance.
i use opensuse11.2
 
Old 11-11-2010, 12:44 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Buster (Fluxbox WM)
Posts: 1,390
Blog Entries: 52

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
You may find the auditd package helpful; you can use auditctl to set up watch rules (see the examples towards the end of the man page).

Last edited by neonsignal; 11-11-2010 at 12:45 AM.
 
Old 11-15-2010, 11:49 PM   #3
hamedhsn
Member
 
Registered: Feb 2010
Distribution: opensuse 11.2
Posts: 57

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by neonsignal View Post
You may find the auditd package helpful; you can use auditctl to set up watch rules (see the examples towards the end of the man page).
thanks for introducing that tool,but i have a problem i found this link http://www.cyberciti.biz/tips/linux-...to-a-file.html
it has really good example ,i can successfully set the rule but when i use ausearch -f /etc/passwd
i got <no match> i tried several rules but no can have result..
can you help me??
 
Old 11-18-2010, 12:16 AM   #4
hamedhsn
Member
 
Registered: Feb 2010
Distribution: opensuse 11.2
Posts: 57

Original Poster
Rep: Reputation: 0
i got the answer ,you should start the audit daemon by using auditd -n command.cool isn't it!!
but i want to put watch on every file that a particular user access???
 
Old 01-16-2011, 11:45 PM   #5
hamedhsn
Member
 
Registered: Feb 2010
Distribution: opensuse 11.2
Posts: 57

Original Poster
Rep: Reputation: 0
it can also be started by using auditctl -e 1 and ended by auditctl -e 0
 
  


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
[SOLVED] How to create a log file for a program laginagesh Linux - Software 1 08-22-2009 08:41 AM
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 04:14 PM
Squid Proxy is unable to log "access.log" file. nishith Linux - Server 6 08-10-2008 12:00 AM
Log File Parser Program kaplan71 Linux - General 1 05-11-2005 08:55 PM
Get Log file content by C/C++ program alchen1999 Programming 4 09-04-2003 10:55 AM

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

All times are GMT -5. The time now is 09:35 PM.

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
Open Source Consulting | Domain Registration