LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-20-2014, 07:55 AM   #1
99cassano
LQ Newbie
 
Registered: Jan 2014
Posts: 3

Rep: Reputation: Disabled
How to track down who has deleted a file


Hello.

Does anyone know how i can track down who has deleted a file in a file system?
 
Old 01-20-2014, 08:08 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Not possible unless you have a trace on literally every command made by every session in the system and even then I'd bet a truly determined person could sidestep that. You may be able to view command history of the various users and catch something. This also depends highly on the integrity of the user accounts. Someone could've logged in not as their self, they could have used an unattended terminal, they could've changed to root. Better instead to look for ways to not have critical files deleted in the future. If there is collaborative work; such as development, then best to use a revision control system to maintain historical changes to the file by various users.
 
Old 01-21-2014, 11:04 AM   #3
ubungu
LQ Newbie
 
Registered: Jun 2012
Location: /home/ubungu
Posts: 27

Rep: Reputation: Disabled
try to log user command, if you are root

In Ubuntu (or Debian-based), I have not try in CentOS

vim /etc/bash.bashrc
• add to end file: export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$(whoami) [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'
• sudo apt-get install sysklogd ( if not installed )
• Set the syslogger to trap local6 to a log file by adding this line in the /etc/syslog.conf file:
local6.* /var/log/cmdlog.log
• touch /var/log/cmdlog.log by root
• /etc/init.d/sysklogd restart
• tail -f /var/log/cmdlog.log
 
  


Reply



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
How to track file transfers via logwatch? newbie14 Linux - Security 39 06-23-2013 12:53 AM
How to track missing file? Kiwi89 Linux - Newbie 4 05-18-2012 06:36 AM
file sync and track changes noir911 General 0 11-10-2006 04:43 PM
track file access on linux gshafik@optusnet.com Linux - Security 3 09-24-2006 11:55 PM
Track File modification dhammika Programming 1 11-25-2005 06:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:03 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