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
  • See Why can't a normal user chown a file? – enzotib Feb 9 '12 at 17:07
  • 1
    you do not seem to be root, according to eyedea@... – Coren Feb 9 '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 9 '12 at 18:59
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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