Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there any way / script so that whenever the new files gets created inside the /home directory then i get the notification email so that i know if some malicious user has uploaded something on my server

share|improve this question
    
If you have many users then your mail box should be made from rubber. You will have to read tons of emails. –  B14D3 Mar 1 '13 at 7:23
1  
Could you please tell us the situation that you're facing? –  quanta Mar 1 '13 at 7:27
    
I have all my personal websites , i am not using any mailbox. i only want that when malacious user upload something due to some vulnerability in my site then i should know –  user75380 Mar 1 '13 at 7:45
    
Which method he's using to upload? How do you know it is a malicious script? –  quanta Mar 1 '13 at 8:31
    
github.com/splitbrain/Watcher –  quanta Mar 1 '13 at 8:45

2 Answers 2

Add this to your cron:

0 * * * * find /home/user -cmin -60 -print

This will email you a list of files that have been created in the past hour, assuming your cron is set to email you successfully.

share|improve this answer
    
As long as you care regarding file content change, not metadata, you'd better use -mmin –  poige Mar 1 '13 at 8:30

Most efficient way to track such events in Linux is using inotify based utilities, for e. g.:

and so on.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.