Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
@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

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

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 L 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
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

Your Answer


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.