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.

I changed the ownership 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
share|improve this question

migrated from stackoverflow.com Jan 27 '11 at 12:47

This question came from our site for professional and enthusiast programmers.

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 –  tobyodavies Jan 27 '11 at 6:18
    
i had the same problem 2 weeks ago. reinstalling is the only solution. –  theTuxRacer Feb 16 '11 at 10:03

2 Answers 2

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.

share|improve this answer
    
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 '11 at 18:46

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

share|improve this answer
1  
It'll work for sudo only, but other binaries are affected as well and are likely to cause issues too. –  Lekensteyn May 17 '11 at 8:42

Your Answer

 
discard

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