Take the 2-minute tour ×
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.

Sudo returns this error:

sudo: effective uid is not 0, is sudo installed setuid root?

And su - returns this:

su: Authentication failure

The user I'm using is a member of the following groups:

disk wheel locate network video audio optical floppy storage power users

I can log in to root, but can't elevate my user privileges, and I'm sure the password I'm giving to both is correct.

share|improve this question
    
What is the output of stat "$(command -v su)" "$(command -v sudo)"? –  Chris Down Feb 3 '13 at 13:23
    
@ChrisDown here it is pastebin.com/Rk5y3bMU –  Mahmoud Hossam Feb 3 '13 at 13:33
add comment

1 Answer

up vote 5 down vote accepted

For some reason you do not have the the setuid bit set on your su and sudo executables. This bit is required so that su and sudo can elevate you to run as the root user. You can restore the setuid bit by using chmod as root:

chmod u+s "$(command -v su)" "$(command -v sudo)"
share|improve this answer
    
It worked, thank you! –  Mahmoud Hossam Feb 3 '13 at 13:44
    
@MahmoudHossam Note that this may be just the tip of the iceberg. You really should figure out why su and sudo have the wrong permissions and fix that. There may be other files with wrong permissions or other problems. –  Gilles Feb 3 '13 at 23:37
    
@Gilles I've been using the system for about a week now, nothing seems to be wrong with it for now, but thanks for the suggestion anyway. –  Mahmoud Hossam Feb 6 '13 at 23:13
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.