Is it possible to find out how/when/who deleted particular dierectory on UNIX Aix3


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Is it possible to find out how/when/who deleted particular dierectory on UNIX Aix3
# 8  
Old 05-14-2004
Perderabo has a really soild point - not that ptrace is good or bad.

A major goal of a sys admin is provide access to data and keep data safe. Anything that compromises a system, or prevents users from getting to a directory - on a production machine - is to be avoided. Even if it is just for a few minutes.

Changing protections on a directory or unplugging routers, or running interesting code is fine (whatever) if you are the only user on the box. Othwerwise exhaust all of the non-disruptive methods first, before you start messing up user's data.

Try the destructive stuff on Saturday at 4:00pm. Or - back up the system, then lock everybody out at 7:00pm, check cron jobs to see if you're gonna cause a problem, reset the system clock And see if it happens again.

I'd also backup/copy all of the files out of that tree to a safe location. And at a time so backup/copy just completes before 4:00pm everyday -- until you find the cause and correct it. You can restore the directory & files at 4:01 if you need to.

If you are not having to restore files now, then the loss of the files isn't that critical.
# 9  
Old 05-18-2004
Thanks Everybody for guiding me with different ideas. Yesterday, We found the process which was deleting the Directory. I was very much tempted to use strace, trace as suggested by Driver, but as Perderabo mentioned there would be some risk, which I chose not to take on production system.
We got hundreds of automated /manual processes running all the time on production system. So Unplugging the system was out of questions , or cannot replace rm or rmdir, since many of these processes are dependent on each other by deleting /creating status file. Even cannot change permission on the directory as many processes are continously uses it.

I did not have unix admin authority, since we are just ERP developer. Hence I could not see in Crontab directory under /var/spool/crontab/??/??
After doing many different tests, following simple approch was successful which was suggested by Perderabo.

We created a subdirectory tmp and did chmod 000 tmp using my userid. At 4:00 pm, all files were deleted except tmp. That proved that 'root' is not the culprit. But whoever deleted all other files must have permission to delete for every user in the system. Who that can be??. Group User -- bingo..(!!But, still at this point, I was not very much sure!) So, this simple test narrowed down to the culprit. Now, 2nd task was which process by group Id is deleting the directory??. We tried to capture all the processes by putting (ps -ef | grep groupid) in a loop during 4:00 pm time.. but we could not capture any processes by Group Id! May be because the process was very short lived!!. I was confused, did not know what to do..!!, Went back to unix admin, tried to discuss with them, what I did and also mentioned about pstrace, strace, ls -lu etc!. Finally, they came up with the exact process run by group id set in cronjobs.


One more Q for all the experts. "ls -lu /usr/bin/rm" will give me the last access date/time. Is it possible to know by any way, the user that accesed 'rm' at that time?.
Perderabo mentioned in previous post--
===============================
Deleting a directory requires write permission to the parent directory. By varying the permissions on that parent, you should be able to nail down the uid involved.
==============================

How do we nail down UID that tries to delete a directory having no permission??

Thanks
DM
# 10  
Old 05-18-2004
Quote:
Originally posted by vipas
How do we nail down UID that tries to delete a directory having no permission??
You get a list of candidates. Maybe that is every user on the system. Or maybe you can limit it down as you did. Maybe it's only those users who are a member of a particular group.

Let's say that your candidates are joe, harry, and fred.

Go to the parent directory.

mkdir fred.d
touch fred.d/file
chmod 700 fred.d fred.d/file
chown fred fred.d fred.d/file

Now only fred (or root) can delete "file". And no one can delete fred.d until after "file" is gone. So if fred tries to remove the parent directory, he will succeed with fred.d/file and then fred.d. But no one else could.

Naturally, you also make a joe.d and a harry.d as well. With most unix systems, chown is restricted to root. You will need root's help with this.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to list deleted files in UNIX?

Hi All, Its an interview question. I just want to know the answer of below question. 1) How to list deleted files in unix (13 Replies)
Discussion started by: pspriyanka
13 Replies

2. UNIX for Dummies Questions & Answers

To find the Ip address of the user who deleted files

Hi, There were a few files deleted from a server by user xyz. The file names are:- /oraextME4/oradata/ME11G22/TEST_IMPORT_01.dbf /oraextME4/oradata/ME11G22/RKVITR1_03.dbf /oraextME4/oradata/ME11G22/TEST_IMPORT_02.dbf need to know the ip address of the terminal from which that... (10 Replies)
Discussion started by: Abhinav Jaiswal
10 Replies

3. AIX

AIX emgr -l -u VUID command and differences from AIX3 to 6?

Hey, I currently only have access to an AIX 6.1 system with no interim fix information I.E. any emgr -l -u command results in the following: 'There is no efix data on this system' Could anyone provide me with valid output of a emgr -l -u VUID command when there IS efix data on a system for the... (0 Replies)
Discussion started by: bstullkid
0 Replies

4. UNIX for Dummies Questions & Answers

Restoring back a deleted file in unix.

Hi, Can any one tell me how to restore back the deleted file in unix? I know the file name. If i know the inode number of the file does help more to restore back the file? (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

5. UNIX for Dummies Questions & Answers

how to recover deleted files in unix

Hi Experts, by mistake i deleted some files that are very important to the project. is there any way that i can recover those files,there is no backup for that but the details of the file we know. This will be a great help. Thanks (5 Replies)
Discussion started by: namishtiwari
5 Replies

6. UNIX for Dummies Questions & Answers

recover deleted file in unix

hi after using rm command how to recover the deleted file (7 Replies)
Discussion started by: arulkumar
7 Replies

7. UNIX for Advanced & Expert Users

Unix ID deleted - What happen to process

I have an unix id (AIX system) which is used to run a couple of processes. They also write some log files into a file system (that is not in the home directory of the user id, but in different location). One bad day, the id was deleted accidentally. But the home directory, files and everything... (1 Reply)
Discussion started by: cmgreat
1 Replies

8. UNIX for Dummies Questions & Answers

is it possible to check logs in UNIX who deleted the files?

Hello, is it possible to check logs in UNIX who deleted the files? Is there logs in UNIX besides .sh_history? (1 Reply)
Discussion started by: james_falco
1 Replies

9. UNIX for Dummies Questions & Answers

Help comparing 2 files to find deleted records

Hi, I need to compare todays file to yesterdays file to find deletes. I cannot use comm -23 file.old file.new. Because each record may have a small change in it but is not really a delete. I have two delimited files. the first field in each file is static. All other fields may change. I... (2 Replies)
Discussion started by: eja
2 Replies

10. UNIX for Dummies Questions & Answers

lost or deleted data in Unix?

Quote: "Until the space is used for another file, it is not deleted and the data can be recovered (although it may require jumping through hoops)." Unquote I know this is true in the Windows world, but I didn't think it was true of Unix. I had always been told once it was deleted in Unix, it... (1 Reply)
Discussion started by: wmosley2
1 Replies
Login or Register to Ask a Question