Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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 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
share|improve this question
See Why can't a normal user chown a file? – enzotib Feb 9 '12 at 17:07
you do not seem to be root, according to eyedea@... – Coren Feb 9 '12 at 17:40
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
up vote 2 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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