2

I am trying to change the ownership of a folder and all its contents to www-data, but am being denied permission to change it. I am root. and I've tried using sudo but nothing works.

eyedea@eyedea-ER912AA-ABA-SR1810NX-NA620:/var/www$ chown -R www-data.www-data /var/www/drupal/
chown: changing ownership of `/var/www/drupal/scripts/run-tests.sh': Operation not permitted
chown: changing ownership of `/var/www/drupal/scripts/code-clean.sh': Operation not permitted
chown: changing ownership of `/var/www/drupal/scripts/drupal.sh': Operation not permitted
Stéphane Gimenez
  • 28,527
  • 3
  • 76
  • 87
Bodhidarma
  • 221
  • 4
  • 9
  • See [Why can't a normal user `chown` a file?](http://unix.stackexchange.com/questions/27350/why-cant-a-normal-user-chown-a-file) – enzotib Feb 09 '12 at 17:07
  • 1
    you do not seem to be root, according to eyedea@... – Coren Feb 09 '12 at 17:40
  • 1
    This particular example is just because you're not actually root; the same thing explained in @enzotib's link. You're sure you actually tried it as root or by sudo-ing it? – Michael Mrozek Feb 09 '12 at 18:59

1 Answers1

2

If /var/www/drupal is an NFS mount and rootsquash is enabled, you will get an error such as this. You'll have to make this change from the NFS server directly, or make the change as the existing non-root owner of these files.

It could also be that write permissions are not enabled on the files you are getting an error with. Make sure the write bit is flipped for at least the owner of the file.

mills013
  • 684
  • 4
  • 4