Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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
Also check the permissions on the directory. – mark4o Sep 4 '09 at 16:29
up vote 8 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.

share|improve this answer

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.

share|improve this answer

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";

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

share|improve this answer

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .