how to know who has deleted the file.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to know who has deleted the file.
# 1  
Old 12-11-2008
how to know who has deleted the file.

Hi,

We have a file which needs supper user previleges to delete. There are 10 users having super user preveleges. Some times back that file got deleted. How to know who has deleted that file?
# 2  
Old 12-11-2008
Hi,
that may depend on Your file system.
I guess if You're lucky the superuser in question may have the rm/del command in their .*_history file? Otherwise I guess it would be very hard.

/Lakris
# 3  
Old 12-11-2008
on linux you could use inotify to get a notifikation if somebody changes a file observed by inotify.
# 4  
Old 12-12-2008
or another solution would be wrap the default rm command /bin/rm

provide a symlink to rm command like

/bin/rm -> /bin/my_own_rm

and in /bin/my_own_rm filename, who deleted_it, time_of_deletion everything could be logged but again one who has super_user permission could still modify this or bypass it without having to use /bin/my_own_rm command

but its a good way of keeping track of the files that are deleted and the user who deleted that
# 5  
Old 12-13-2008
If you are using Linux you should be able to use the AUDIT program.
# 6  
Old 12-14-2008
Hello -

By superuser do you mean sudo?

If so do you have access to the /var/log directory?

$ cat /var/log/auth.log | grep rm

You will see entries like this:

Dec 14 00:37:32 test-laptop sudo: joeuser : TTY=pts/0 ; PWD=/home/joeuser ; USER=root ; COMMAND=/bin/rm /tmp/fille

yrs


Michael
# 7  
Old 12-16-2008
You'll need some kind of system accounting package, depending on the O/S you're using.
There's no default logging of super user commands, as super user is supposed to be the most trusted person to have system access. There's also security issues with logging all super user commands.

You could use a shell with history functionality (most have same form of command history), but these can be easily overcome by a malicious user. The only sure way is to install a system/process audit package and these are available for most distro's.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Restoring deleted file with rm -rf

Is there a way I could recover a deleted text file with "rm -rf" command. Running CentOS 6.5. Thank you. (5 Replies)
Discussion started by: galford
5 Replies

2. UNIX for Dummies Questions & Answers

How to recover deleted file?

Hi All By mistake i have deleted some file in a directory, is there any way to get it back in Unix( i am using sh ) (2 Replies)
Discussion started by: parthmittal2007
2 Replies

3. UNIX for Dummies Questions & Answers

deleted a swap file

I attempted to delete a swap file (rm .<filename>.swp). Now the system is trying to delete one file that doesn't exist anymore and the file is adding a number in increments to the name of the file it is attempting to delete (filename1.csv, filename2.csv) The log says the filename1.csv does... (0 Replies)
Discussion started by: student21
0 Replies

4. Solaris

Retrieve deleted file

hi there, Is there any way to retrive the deleted files from solaris, we are using solaris 10 and the file seems delete when it is opened. I search over by Google but no good result... tnx :-) (4 Replies)
Discussion started by: dagigg
4 Replies

5. Shell Programming and Scripting

restore deleted file

I accidently deleted the files from linux machine. How to restore back the files. (1 Reply)
Discussion started by: sandy1028
1 Replies

6. Shell Programming and Scripting

Lock a file from being deleted?

Hi In my script, users have the option to delete files from a directory, however, I don't want them to be able to delete the automatically generated log file. Is there anyway to lock a file from being deleted? Note: The file can't be read only as it has to be written to quite frequently. ... (3 Replies)
Discussion started by: Darren Taylor
3 Replies

7. Solaris

/etc/passwd file been deleted

Hi Folks , Would be grateful if someone could help me out in one of the question that came to my mind . If the /etc/passwd file has been deleted and the system has been rebooted . Then i dont think that any user would be able to login and the system will be useless . Whats the best solution for... (5 Replies)
Discussion started by: gera_sachin125
5 Replies

8. Solaris

File deleted bymistake

Bymistake I deleted a file and there is no backup.Is there anyway to get that file. (1 Reply)
Discussion started by: csreenivas
1 Replies

9. Linux

how can i restore a deleted file

I am a relatively new linux user.would like to know how to undo a deleted file (2 Replies)
Discussion started by: wojtyla
2 Replies

10. UNIX for Advanced & Expert Users

retrieving a deleted file

hi!, is there any way to retrieve a file that I have deleted few minutes back?? I am using Solaris- 5.6.. :rolleyes: (2 Replies)
Discussion started by: jyotipg
2 Replies
Login or Register to Ask a Question