Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> How To Change The Owner Of A File?
tansqrx
post Jan 26 2007, 10:22 PM
Post #1


Super Member
Group Icon

Group: [HOSTED]
Posts: 533
Joined: 25-April 05
Member No.: 4,374



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?
Go to the top of the page
 
+Quote Post
pyost
post Jan 26 2007, 10:37 PM
Post #2


Nenad Bozidarevic
Group Icon

Group: [MODERATOR]
Posts: 1,013
Joined: 7-November 05
From: Belgrade, Serbia
Member No.: 9,500



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.
Go to the top of the page
 
+Quote Post
TavoxPeru
post Jan 27 2007, 02:39 AM
Post #3


Super Member
Group Icon

Group: [HOSTED]
Posts: 763
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



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,
Go to the top of the page
 
+Quote Post
xboxrulz
post Jan 27 2007, 05:39 AM
Post #4


Colonel Panic
Group Icon

Group: [MODERATOR]
Posts: 2,793
Joined: 25-March 05
From: Toronto, Ontario, Canada
Member No.: 3,233



I thought SSH was disabled at Astahost

xboxrulz
Go to the top of the page
 
+Quote Post
vujsa
post Jan 28 2007, 01:49 AM
Post #5


Absolute Newbie
Group Icon

Group: Admin
Posts: 888
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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


Go to the top of the page
 
+Quote Post
vhortex
post Jan 29 2007, 07:44 AM
Post #6


Guilty Until Proven Innocent
Group Icon

Group: Members
Posts: 372
Joined: 13-April 05
Member No.: 3,937



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"
Go to the top of the page
 
+Quote Post
tansqrx
post Jan 29 2007, 04:07 PM
Post #7


Super Member
Group Icon

Group: [HOSTED]
Posts: 533
Joined: 25-April 05
Member No.: 4,374



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?
Go to the top of the page
 
+Quote Post
vujsa
post Jan 29 2007, 10:18 PM
Post #8


Absolute Newbie
Group Icon

Group: Admin
Posts: 888
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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
Go to the top of the page
 
+Quote Post
TavoxPeru
post Jan 31 2007, 08:08 AM
Post #9


Super Member
Group Icon

Group: [HOSTED]
Posts: 763
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



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,
Go to the top of the page
 
+Quote Post
vhortex
post Feb 1 2007, 10:23 PM
Post #10


Guilty Until Proven Innocent
Group Icon

Group: Members
Posts: 372
Joined: 13-April 05
Member No.: 3,937



nice to know that it helped.. =)
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To Change Ur Ip Address(47)
  2. How To Change Registered Owner`s Name On Win Xp(21)
  3. Howto: Change Graphical Login To Text(3)
  4. Shut Down, Restart, Log Off XP Using A Batch File(23)
  5. How To Save A Image In Pdf File And Download It?(10)
  6. Counter With Img In Flat File(2)
  7. Recover Tables From A MySQL .frm File(8)
  8. Switch Network Settings With Batch Files(18)
  9. Uploading Image File Through JSP Code To Server(9)
  10. Disable /change The Find In Page Sound In Firefox(1)
  11. How To Use Psd File(14)
  12. Super File Recover(3)
  13. You Cannot Create A File Named Con(9)
  14. Dynamically Change The Background Image On Mouse Effects!(3)
  15. How Do You Use The cPanel File Manager?(14)
  1. Deleting A Corrupt File(26)
  2. Need Help Urgently (missing Or Corrupt Hal.dll File).(6)
  3. How To Change Your Ip Address.(68)
  4. Is A Php File Searchable?(8)
  5. Problem With Move_uploaded_file()(5)
  6. Safari And Hosts File(8)
  7. How To Copy File & Folders From Linux To Windows?.(12)
  8. Need To Edit A Wav File [solved](1)
  9. Mysql And User File_priv(0)
  10. Domain Change.(10)
  11. Joomla Template Kit Extension For Nvu/composer(3)
  12. Center Update(5)
  13. Css File Size(7)


 



- Lo-Fi Version Time is now: 13th October 2008 - 12:14 AM