View Full Version : Deleting files created by nobody
Any idea how to delete files created by user type "nobody" besides asking Aleatia support (they have the root access)? Thanks for your help.
SiteCreativecom
12-18-2001, 12:40 PM
Normally you can't do this, just because of the UNIX way of managing users and groups. You're not supposed to be able to delete/modify other ppl's files.
What files do you have that belong to nobody?
- Jonathan
wmvink
12-18-2001, 01:16 PM
Try the cgi-script 'Nobody Delete':
Description: Nobody Delete can delete files created under the name "nobody" (i.e. files created by CGI scripts that you wouldn't otherwise be able to remove).
http://www.hotscripts.com/Detailed/8707.html
SiteCreativecom
12-18-2001, 02:53 PM
I stand corrected.
What happens, is that a program I installed builds those files using "nobody" as the webserver's id.
Therefore only root, or the program itself can delete
them. The function that'll allow nuking of those files will be put in to the program in its next version. So for now, I 've to find a way to delete them.
I've tried nobody.cgi before posting. However, it seems that even after executing unix commands to change to the directory where those files have been created, the script is still showing the current directory where the script resides, i.e. cgi-bin.
Perhaps I'm missing something. Has anyone used nobody.cgi successfully?
wmvink
12-18-2001, 06:36 PM
There's another script that claims to do the same:
Description: nobody.cgi is a simple Perl script that you can use to execute commands as user:nobody. Do you have a message board, counter or any other script on your server that generates files? Have you ever tried to manually edit one of these files? You may have noticed that you can't because you don't own the file - user:nobody owns the file and you can't edit it. By installing nobody.cgi on your server, you can execute commands with user:nobody's permissions, which means you can create, delete, view, modify and change permissions on files owned by user:nobody.
http://www.hotscripts.com/Detailed/1669.html
If that doesn't help, have you tried to delete the files using the file manager in the control panel? I remember (vaguely - i may not have been totally sober :weyes: ) that I had a similar problem a few days ago. Deleting the file in the file manager fixed that...but don't quote me on that.
If all else fails...e-mail support.
Both links led to the same script. Wonders who is the rightful programmer? My guess is the latter link.
Anyway, I've tried file manager in cpanel. It doesn't allow as well. Looks like got to email Aletia support for support.
Thanks to all replying.
Create a file called, perhaps doit.cgi in your directory. In it, place the following:
#!/bin/sh
echo "content-type:text/html"
echo ""
echo "hi there, deleting test.data"
rm test.data
Change "test.data" to the filename that is owned by "nobody" that you want to get rid of.
chmod the directory containing the file to 777.
Execute this script by calling it from your browser.
Be sure to chmod the directory back to 755 or whatever value it was.
That should do the trick without emailing support.
Hi Ron,
Each of my nobody files reside in a directory created by nobody as well. The higher level however is created by me. ie.
msdirectory (me)
--> /business (nobody)
--> /business/index.html (nobody)
--> /special (nobody)
--> /special/index.html (nobody)
e.t.c
I tried using rmdir but not successful.
SiteCreativecom
12-21-2001, 10:34 AM
Ah I see.
Telnet into your shell, and type:
chmod 777 msdirectory
Create a new PHP script that contains the following code:
<?
system("rm -f msdirectory/*");
?>
and view it in your browser window. That should delete all the nobody files in msdirectory.
Then go back to your shell and type:
rmdir msdirectory
- Jonathan
Hi Jonathan,
Thanks for the suggestion. I tried it out just now, the files remain intact.
SiteCreativecom
12-21-2001, 11:43 AM
Can you telnet into your shell, and give us the results of the following command:
ls -l msdirectory
- Jonathan
I use SSH (Putty) and the result for ls -l msdirectory as follows:
drwxr-xr-x 2 nobody nobody 4096 Dec 18 05:25 business
drwxr-xr-x 2 nobody nobody 4096 Dec 18 05:25 consumer
drwxr-xr-x 2 nobody nobody 4096 Dec 18 05:25 specials
Thanks.
SiteCreativecom
12-21-2001, 11:49 AM
Okay, getting an idea...
Now give us the results of:
ls -lR msdirectory
- Jonathan
ls -lR msdirectory gives...
drwxr-xr-x 2 nobody nobody 4096 Dec 18 05:25 business
drwxr-xr-x 2 nobody nobody 4096 Dec 18 05:25 consumer
drwxr-xr-x 2 nobody nobody 4096 Dec 18 05:25 specials
msdirectory/business:
total 4
-rw-r--r-- 1 nobody nobody 245 Dec 18 05:41 index.html
msdirectory/consumer:
total 4
-rw-r--r-- 1 nobody nobody 245 Dec 18 05:41 index.html
msdirectory/specials:
total 4
-rw-r--r-- 1 nobody nobody 245 Dec 18 05:41 index.html
SiteCreativecom
12-21-2001, 11:58 AM
Ok, modify that PHP program to look like:
<?
system("rm -rf msdirectory/*");
?>
Run it, and then telnet into your shell and rmdir msdirectory
- Jonathan
Y-E-S! It works! Thanks a lot Jonathan!
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.