Nov 25, 2009
Pages: 1, 2

How To Change The Owner Of A File?

free web hosting
Open Discussion & Free Web Hosting > Astahost > Hosted Members Support

How To Change The Owner Of A File?

tansqrx
I have been using phpFormGenerator which is included in Fantastico under the cPanel. The script works OK but I have encountered another problem. When I send attachments they are stored on the server and I can’t delete them. The problem appears to be that phpFormGenerator creates the file with no owner.

CODE
-rw-r--r--  1 nobody nobody 420457 Dec  7 00:41 12_41_25_update.txt


I have SSHed into the server and tried to delete them manually.

CODE
-jailshell-3.00$ rm 12_41_25_update.txt
rm: remove write-protected regular file `12_41_25_update.txt'? y
rm: cannot remove `12_41_25_update.txt': Permission denied


I next tried to chmod the files

CODE
-jailshell-3.00$ chmod 777 12_41_25_update.txt
chmod: changing permissions of `12_41_25_update.txt': Operation not permitted


And last but not least I tried to take ownership

CODE
-jailshell-3.00$ chown ******* 12_41_25_update.txt
chown: changing ownership of `12_41_25_update.txt': Operation not permitted


Any suggestions?

 

 

 


Comment/Reply (w/o sign-up)

pyost
You might want to take a look at this discussion, since the topic started had a similar problem. The solution can be found here, thanks to vujsa.

Comment/Reply (w/o sign-up)

TavoxPeru
Some months ago i have the same trouble with phpFormGenerator and with phpGenie at other sites i mantain and never found the solution, so, all the problematic files and directories remain at that servers, i jUst read the solution and try the cleanup script, it seems to work but nothing happens and also the script dont show anything.

It is very strange, because in one of the servers with trouble i can chmod 777 the directory but i cant delete it after that.

Best regards,

Comment/Reply (w/o sign-up)

xboxrulz
I thought SSH was disabled at Astahost

xboxrulz

Comment/Reply (w/o sign-up)

vujsa
QUOTE(TavoxPeru @ Jan 26 2007, 09:39 PM) *

Some months ago i have the same trouble with phpFormGenerator and with phpGenie at other sites i mantain and never found the solution, so, all the problematic files and directories remain at that servers, i jUst read the solution and try the cleanup script, it seems to work but nothing happens and also the script dont show anything.

It is very strange, because in one of the servers with trouble i can chmod 777 the directory but i cant delete it after that.

Best regards,
If nothing is shown after you run the script, then it didn't work!

The path must be correct!
/home/username/public_html/directory/file.txt

As for the directory that you can chmod to 777 but can't delete, you have to have write permission in the parent directory as well so chmod the parent to 777 as well.

SSH isn't disabled, just not offered. It has been found that shell access is far more trouble to deal with than it is worth!

Anyhow, if you really want to chown a file or directory, you have to write a script to do it in the file system. Since the server owns the entity, only the server can change the owner of that entity! The server only performs tasks when it is directed to do so by a script. But if you write a script and it is wrong, then the file could be owned someone other than you ar or the server and then there isn't any possibility of changing it again without an system admin to help.This would be so much easier if everything use FTP instead of the file system!

vujsa


 

 

 


Comment/Reply (w/o sign-up)

vhortex
QUOTE(TavoxPeru @ Jan 27 2007, 10:39 AM) *

Some months ago i have the same trouble with phpFormGenerator and with phpGenie at other sites i mantain and never found the solution, so, all the problematic files and directories remain at that servers, i jUst read the solution and try the cleanup script, it seems to work but nothing happens and also the script dont show anything.

It is very strange, because in one of the servers with trouble i can chmod 777 the directory but i cant delete it after that.

Best regards,


i solved that by using a filemanager i installed.. of course you need to make it secure..
the control panel file manager belongs to cpanel user, i guess.. and it cannot erase that rouge file.

using a filemanager you have installed means that you are telling apache to clean itself up.. since it is apache that put it there.. it is also owned by apache.

it worked on my side..

---

this situation also occured in the paid hostings.. aside from the ftp rouge temp file when i get those random ftp timeouts.

it is bother some but i think it is ok.. i already have a use for this "feature"

Comment/Reply (w/o sign-up)

tansqrx
Cleanup.php worked the first time. I have already deleted the file but the original post mentioned leaving it there but password protected. How would one go about doing this?

Comment/Reply (w/o sign-up)

vujsa
QUOTE(tansqrx @ Jan 29 2007, 11:07 AM) *

Cleanup.php worked the first time. I have already deleted the file but the original post mentioned leaving it there but password protected. How would one go about doing this?

Well, the easiest way to password protect a directory is to use the Web Protect feature in cPanel.

Just goto cPanel > Site Management > Web Protect and select the directory that you want to protect.

the directories are a little tricky to navigate in this program but you'll get the hang of it. It is like the filemanager where clicking the folder icon will take you into the folder but the folder name will select that folder.

Generally speaking, any folder inside of a protected folder will require the same password to enter.
You can add multiple users to this folder and ech folder can have a different password and/or user.

It is possible to do all of this manually but if you don't get it right, there could be a hole in your security. With a script, you could even use this as your primary means of user management in restriccted areas but that usually isn't done anymore.

For more information, look into password protection using .htaccess and .htpasswd.

Keep in mind that this only restricts http acces to the folder. FTP access is not restricted so it is possible for someone to access your ftp account and either remove the restriction or move your sensitive script to a non-restricted folder for their use.

vujsa

Comment/Reply (w/o sign-up)

TavoxPeru
QUOTE(vhortex @ Jan 29 2007, 02:44 AM) *

i solved that by using a filemanager i installed.. of course you need to make it secure..
the control panel file manager belongs to cpanel user, i guess.. and it cannot erase that rouge file.

using a filemanager you have installed means that you are telling apache to clean itself up.. since it is apache that put it there.. it is also owned by apache.

it worked on my side..

---

this situation also occured in the paid hostings.. aside from the ftp rouge temp file when i get those random ftp timeouts.

it is bother some but i think it is ok.. i already have a use for this "feature"

Following your suggestion i install a filemanager and finally i could solve the problem and be able to delete all the problematic directories and files. The reason i could not be able to do it before was because the ftp program that i use don't show some htaccess files that were left behind, i dont know why it happens because with this same ftp program i can see this files in other sites.

Best regards,

Comment/Reply (w/o sign-up)

vhortex
nice to know that it helped.. =)

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2

See Also,

*SIMILAR VIDEOS*
Searching Video's for change, owner, file
advertisement



How To Change The Owner Of A File?

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com