Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

When I use the command like:

sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

I get an error like /etc/sudoers is owned by uid 777, should be 0. What should I do?

share|improve this question

Have you run anything like sudo chown 777 on any files/directories by any chance? If not, someone has broken into your system. If you did, then don't ever do that again. It's apparent that whoever did it meant to use chmod instead of chown, but even with chmod it is very wrong.

You have to boot into recovery mode, or live session, and change its ownership and permission back to normal

chown root: /etc/sudoers
chmod 440 /etc/sudoers

Make sure you understand what chown does before using it. See

share|improve this answer
I used the command,sudo chown 777 myfolder it seems to be error .what i install also the same error. chown: changing ownership of `/etc/sudoers': Operation not permitted. – padma Jul 25 '12 at 10:39
@padma, Well firstly, sudo chown 777 myfolder will set the ownership of myfolder to 777, which is likely a non-existant user, and secondly, you must've added some other stuff on that command, because somehow you managed to run it on /etc/sudoers too. Let's hope you didn't change any other system files. Anyway, since you can't use sudo anymore, you have to boot into recovery mode to get a root shell, or boot the Ubuntu CD and fix it from there. – geirha Jul 25 '12 at 11:07

I got also some success with:

pkexec chown root /usr/lib/sudo/

share|improve this answer

I was having the same issue and because it was so difficult I made a video to explain the solution. Even though this isn't for Ubuntu the fix should work just as well.

Hope it helps. :)

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.