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

I recently had to move an Ubuntu server to a new network. After I hooked it up again, I find I can no longer sudo, even though I was able to previously.

Does this mean a network problem is interfering with sudo (perhaps via PAM or something?) I don't really know the ins and outs of linux security.

Thx! Tom

share|improve this question
    
Can you post your /etc/sudoers, as well as the outputs of id and hostname ? –  zarkdav Aug 31 '10 at 17:47
    
Yeah, make sure that user is in the sudoers file. –  Petey B Aug 31 '10 at 17:49
1  
@Petey actually the user could well not be in the file. What's important to check is whether the user or group are in the file, and there is no hostname limitation (hence my question). –  zarkdav Aug 31 '10 at 17:51
    
By "new network" do you mean a new LDAP/NIS domain, or a new IP network? –  gWaldo Aug 31 '10 at 17:53
add comment

3 Answers

Are there hostname-based restrictions on the commands in your sudoers?

The user specifications say which users, on which machines, can invoke which commands (as which target user). Often, the machine restriction is given as ALL, but perhaps it isn't in your setup?

share|improve this answer
add comment

The only way moving a machine to a new network can change your auth setup is if your auth setup depends on authorizing via the network somehow, like via LDAP or something. Your PAM config would indeed be involed in this, so you should look there at least to start figuring out what needs fixing.

share|improve this answer
    
I doubt networking would be involved here - regardless of his origin network, once he's logged into the server he'll be sudoing from localhost, right? –  James Lawrie Aug 31 '10 at 17:53
    
Sure, but sudoing can rely on groups which can be defined in, say, LDAP for example. There's really not enough data on his auth setup to tell, so it's all just guessing at random. –  pjz Sep 3 '10 at 1:57
add comment
up vote 0 down vote accepted

Turns out the reason was really stupid: a CIFS share couldn't be located on the new network, causing the mount.cifs utility to repeatedly log to the console and screw up all keyboard input. This meant that in reality I couldn't even log in let alone sudo.

Once I removed the CIFS share from /etc/fstab, everything worked just fine, including sudo.

Thanks to all for their input. :)

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.