2

I changed the permissions of my /usr directory to 777 by mistake and now my system give this error whenever I try to use sudo:

sudo: setuid must be root

How do I fix this issue?

2
  • 1
    should be on serverfault, but i'll tell you now your best bet is to re install OS - all the setuid and setgid bits will be gone, short of finding out what all of those are and running chmod +sS you'll want to reinstall Jan 27, 2011 at 6:18
  • i had the same problem 2 weeks ago. reinstalling is the only solution. Feb 16, 2011 at 10:03

2 Answers 2

3

Based on your error, you didn't simply changed the permissions of /usr to 777, you did it recursively which is a more serious and problematic change.

Unless you have backups of your system directories, your best option is just to reinstall.

1
  • With the caveat that you could manually reset every file of every sub-directory to the right setting by manually comparing it to a good Ubuntu install.
    – djeikyb
    Apr 17, 2011 at 18:46
0

Go to recovery console (reboot, and chose recovery console ) and type

chown root:root /usr/bin/sudo

then

chmod 4755 /usr/bin/sudo

then

reboot

1
  • 1
    It'll work for sudo only, but other binaries are affected as well and are likely to cause issues too.
    – Lekensteyn
    May 17, 2011 at 8:42

Your Answer

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