up vote 2 down vote favorite
1
share [g+] share [fb]

I have a file on my web server that I can't rename, delete, move, edit, anything. I have set the permissions to 777. What else can I do?

EDIT: to clarify - this is on a hosting service to which I do not have shell access. The file is a Drupal installation's settings.php.

SOLUTION: Directory file permissions were inaccurate. Thanks to whomever suggested checking that.

link|improve this question

53% accept rate
2  
How about posting some more information? What's the output of "ls -la file"? What error message do you get? What file are we talking about? – innaM Sep 4 '09 at 15:34
3  
Also check the permissions on the directory. – mark4o Sep 4 '09 at 16:29
feedback

4 Answers

up vote 6 down vote accepted

Check extended attributes, if applicable:

# lsattr file
----i-------------- file
# chattr -i file

The 'i' bit is 'immutable', meaning it resists all changes.

link|improve this answer
feedback

What else can I do?

  • tell us what OS/distro you are running
  • If it is Linux, check if SELinux or Apparmor are running
  • If SELinux is running, what is the output of "ls -lZ file"?
  • use unlink to delete the file instead of rm
  • use ls -i to show the inode of the file and try to remove it by inode number

Use at your own risk.

link|improve this answer
feedback

My guess is that its one of those annoying .pureftp-upload files. Even if it isn't, there are 2 ways I usually deal with these files.

  • Use your file manager from within your web hosting control panel (probably CPanel).
  • Try using PHP (replace the pureftp-upload filename with your filename):
$f = ".pureftp-upload.23kjfvds9osd890235mn";
unlink($f); 

then surround the above code with <?php at the beginning and ?> at the end (code formatting doesn't play nice with php tags).

link|improve this answer
feedback

If this file is in a folder deemed to be accessible through Apache web service, you may need to stop Apache for a moment then do your changes.

I know IIS in windows has something like this where if the file could possibly be accessed then the user rights don't matter.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.