Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

2 Answers 2

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 https://help.ubuntu.com/community/FilePermissions

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
add comment

I got also some success with:

pkexec chown root /usr/lib/sudo/sudoers.so

share|improve this answer
add comment

Your Answer

 
discard

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.