Files disappearing from /users/home


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Files disappearing from /users/home
# 1  
Old 03-22-2011
Files disappearing from /users/home

We have seen an issue whereby every morning around the same time , we see files being deleted from /users/$userid .

We have many crons and processes running across 40+ different servers .
Possibly some rogue process is doing this .

How can one isolate the process removing stuff from the users home .

The users home is mounted from all the 40 machines : Thus which machine is running the rogue process ( and what that is ) is the challenge to figure out .

All machines are Linux boxes .

Any pointers to audit scripts/tools would be appreciated .
# 2  
Old 03-22-2011
It is probably a process designed to clean up old files. Since it works across users, it has to have permissions. If we assume the files in question are 755 permissions, this means it has to run in a crontab owned by a user that is allowed su or sudo. Or is root to start with.

To verify this assumption, consider setting 000 permisions on some dummy files in the directory trees in question. Use the same naming conventions, ownerships, file sizes and file times as the ones that got clobbered. If the dummy file(s) are removed it has to be a priviliged user.

What this does is limit the number of crontabs to read. If the assumptions are good start grepping the crontabs for jobs that run at the time in question, limit the search to just privileged crontab files.

If all users have cron access, then you may have a script that a weak programmer wrote that everyone has shared. Good luck with that.

If you have linux consider, the inotify family. http://linux.die.net/man/7/inotify You can interactively watch for deletions in the directory trees in question.
# 3  
Old 03-22-2011
How is the user's home mounted? Are you using an automounter?

What files disappear? Old files, new files, all files, random files? One user, some users, all users?
If you can determine the rules by which files are disappearing and the time of the process, that will go a long way towards finding the process.
When you get close, you could create files using "touch" with timestamps a few minutes apart and use this to determine what time the process runs.

Is the danger time in working hours? Is the user logged in at the time? I'd certainly look at /etc/profile and the user's own Shell profile.

One blind guess would be to look for a script running from cron at around the right time which contains a "find" statement on /users where the username parameter is not set. Similarly look through /etc/passwd for an account with home directory of /users (I've seen this one cause havoc before).
# 4  
Old 03-22-2011
[Jim] We have all our crons run from the same userid , and its this userids home which is seeing strange removal . We also see this early in the morning around 6:00 : meaning we have a 10 minute suspect window . We are going to log 'ps -ef' in a loop for 10 minutes on a few servers where we have most of our crons to locate the process .
Thanks for the inotify tool .

[Methyl] I guess there is an automounter used to mount the users home ( we have 40+ machines ) .
Many files disappear : what hits us the ssh , and bin/prompt : We have many tools run with this userid ( and many ssh'es to our several servers which are impacted by this )
We have looked at the crons but dont see a suspect . As mentioned above , we are now going to look at raw ps output in that 10 minute window .

I was hoping that there would be some way to monitor a directory to such an extent that one could know what process ( and from which host its run ) does something to a directory ??
( We know the userid ,the directory and we know the approx timeframe - need to find the process and machine )
# 5  
Old 03-22-2011
Quote:
Many files disappear : what hits us the ssh , and bin/prompt :
What does this statement mean?
What does the problem look like?

Have any files ever re-appeared?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

what is the use of each login related files present in users home directory

# ls -l total 10 -rw-r--r-- 1 dummy2 other 140 Jun 19 21:37 local.cshrc -rw-r--r-- 1 dummy2 other 136 Jun 19 21:37 local.cshrc~ -rw-r--r-- 1 dummy2 other 157 Jun 19 21:37 local.login -rw-r--r-- 1 dummy2 other 178 Jun 19 21:37 local.profile... (6 Replies)
Discussion started by: chidori
6 Replies

2. Shell Programming and Scripting

users who have un-sanctioned(forbidden) files in their home directory.

Hello guys, I have to create a sh script which return users who have un-sanctioned(forbidden) files in their home directory. I tried to do: #!/bin/sh -x SHADOW_FILE="/etc/shadow" PASSWORD_FILE="/etc/passwd" for i in `grep -v '^+' $PASSWORD_FILE | cut -d: -f1,6` do username=`echo... (6 Replies)
Discussion started by: catalint
6 Replies

3. Cybersecurity

ssh many users to one home

Hey guys, Hmm.. I'm not quite sure where to open this. If any mod thinks this is not the place, please move it to wherever its suited :) So, I want to allow some trusted users to scp files into my server (to an specific user), but I do not want to give these users a home, neither ssh... (1 Reply)
Discussion started by: flpgdt
1 Replies

4. Solaris

Common Home directory for different users??

Hi Guys, I have a problem with configuring a server. this is a solaris 10 with sparc platform. I have setup so that the server is Authenticating through NIS but I dont want the server to Mount the Home directories. The users need to logged in through the CDE/display. I have over 200 users... (2 Replies)
Discussion started by: Luky
2 Replies

5. Shell Programming and Scripting

copy some files from users home folders to my folder

i have users home directories in /home all the users have some files starting with character e and i want to copy all these files in a folder in my (root) home using a script i tried the script for i in m5 do cd m5 cp e1* /home/pc/exam cd .. done but get these... (3 Replies)
Discussion started by: pcrana
3 Replies

6. UNIX for Dummies Questions & Answers

lost /home/directory for users

I'm using HPUX 11i. The other day a user logon to the workstation and was not able to find the /home/directory (tom is the directory) I login myself and it is the same thing. The home directory is on the server, so I was thinking of using sam to map it again. does anyone know how to do it... (5 Replies)
Discussion started by: blizzgamer
5 Replies

7. UNIX for Dummies Questions & Answers

Disappearing files

Suse 10.3 ispconfig Using as a web server, mail server. I'm the only user. These files: /var/log/httpd/ispconfig_access_log_2008_08_28 /var/log/httpd/ispconfig_access_log_2008_08_29 vanished without a trace. I still have older and newer files, but not these. I have not deleted... (5 Replies)
Discussion started by: KillerDog
5 Replies

8. Solaris

Can't create users in /home

Hi Friends,, I installed solaris 10 in vmware just now.I got a simple problem while i want to create users in /home directory.It is saying "cannot create ".So i checked the permission and then i find that the perm to user(root) is r-x.So i tried to change it to rwx using chmod but again i got a... (4 Replies)
Discussion started by: sdspawankumar
4 Replies

9. HP-UX

Home dir for users

Hello all, Most of our users have the same home directory, I know it's weird but it has been like this before me and we don't want to change that for now. When creating a new user using command useradd, it is not allowing me to create it because it is using the home directory of someone else. I... (2 Replies)
Discussion started by: qfwfq
2 Replies

10. AIX

HACMP users home directories

What would be the best approach to configure one external /home f/s in simple two node config and have concurrent access ? (1 Reply)
Discussion started by: zz2kzq
1 Replies
Login or Register to Ask a Question