Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am getting the dreaded sudo: must be setuid root error even though the executable in /usr/bin/sudo has ownership root:root and mode 4755 (-rwsr-xr-x). /etc/sudoers is mode 440. My user is in sudoers with all appropriate settings. I've purged and re-installed the package, to no avail.

I didn't initially configure this machine; its upkeep has fallen to me by default. Is it possible that this behaviour is an interaction with PAM and, if so, how do I fix it? The machine is running Debian squeeze 2.6.26-2-686 SMP kernel. Nothing is written on failure to /var/log/auth.log so it's bailing out before that.

UPDATE: here's sudoers (with a lot of superfluous comment lines removed), but I'm pretty sure it's not the issue.

Defaults        env_reset
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:\
    /usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification
User_Alias              SUDOERS=david
Defaults:SUDOERS        !lecture,!authenticate

# User privilege specification
root    ALL=(ALL:ALL) ALL
%sudo ALL=(ALL:ALL) ALL
SUDOERS ALL=(ALL:ALL) ALL

Yes, I know this is overly lax. I'll tighten it up when I get it working. As far as I can tell, it never even gets to the stage of reading this file, but dies when the sudo process itself tries to escalate its user ID. A near-identical setup works flawlessly on several (>10) other machines, so I think it must be an external configuration that is causing this to fail.

share|improve this question
    
What's the command you are trying to run? I get this with strace sudo as that won't take sudo's permissions into account. –  Dennis Kaarsemaker Jan 18 '13 at 15:33
    
I'm trying to run sudo su –  David G Jan 18 '13 at 15:36
    
Why don't you post your /etc/sudoers file so we can see what's in there? –  val0x00ff Jan 18 '13 at 15:40
    
Have you tried to create another user, chmod/chown the sudo binary over again and try sudo su - or su - etc. I don't have an answer at this moment. –  val0x00ff Jan 18 '13 at 16:28
2  
Firstly, are you sure you're picking up the right sudo (ie, does the error persist when you do /usr/bin/sudo instead of letting PATH do the work)? If you are, could we see the output of mount, in case /usr has somehow got mounted nosuid? –  MadHatter Jan 18 '13 at 16:37

1 Answer 1

Thanks to MadHatter, I found the solution. The filesystem had been created as one big root partition (not by me!) with /usr, /var, /home and so on simply as subdirectories. For some reason, it had also been mounted nosuid, presumably in a misguided attempt at security. I'm promoting this to an answer so it will show up more readily for anyone suffering the same issue. I should have checked mount options but didn't think to as it's such a silly situation to encounter.

share|improve this answer

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.