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've been using 'sudo ' since I setup my server about a week ago.

It suddently stopped working with no explanation.

I am in 'sudo' group. So there should be no config change required to /etc/sudoers

$ sudo apt-get install tsocks
[sudo] password for me: 
me is not in the sudoers file.


root@host:/etc# groups me
me : me sudo

The only thing it could possibly be related to was I added the following line to sshd_config:

PermitRootLogin without-password

But I have since changed that back to

PermitRootLogin yes

Permission on file is 400:

ls -l /etc/sudoers
-r--r----- 1 root root 491 Sep 28 21:52 /etc/sudoers

Here is visudo output:

Defaults        env_reset
root    ALL=(ALL) ALL
%sudo ALL=(ALL) ALL

I'm in the sudo group in /etc/group, i used $ usermod -G sudo me

sudo:x:27:me

No idea why it stopped working, or how to fix it.

share|improve this question
    
Permission on the /etc/sudoers is 440 as you have displayed it. But that is ok. –  mdpc Nov 29 '12 at 23:10
    
sudo does not necessarily use group membership to provide access, it looks like your sudoers file has been changed somehow. –  mdpc Nov 29 '12 at 23:11
    
@mdpc, the stock Debian config includes a directive like %sudo ALL=(ALL) ALL. The stock config is also 491 bytes on my system. –  Zoredache Nov 29 '12 at 23:14
    
i updated question with my file. –  chovy Nov 29 '12 at 23:14
1  
Do you have physical access to the console? Do you have any other access to the root account? You may need to go into rescue mode so you can inspect the auth logs and see if any errors are getting logged. –  Zoredache Nov 29 '12 at 23:19
show 1 more comment

2 Answers

Type 'visudo' and check, if your user is added there - probably not. Search for a line, which consists something like:

root    ALL=(ALL)       ALL

For your user you should have something similar in visudo.

share|improve this answer
2  
You shouldn't have to add the user explicitly to /etc/sudeors if you are in the sudo group. Works fine on my other system, I can sudo w/o having my name in /etc/sudoers. And like I said, this just stopped working. –  chovy Nov 29 '12 at 23:10
add comment

Ok I don't know wtf is going on, but I just rebooted my server and now sudo works fine.

share|improve this answer
    
That's something you should have tried before posting the question. –  John Gardeniers Nov 30 '12 at 0:28
    
why? afaik, sudo doesn't require a reboot. Why would a reboot fix the problem? –  chovy Nov 30 '12 at 1:33
    
Clearly something went wrong. Rebooting is what you try when you can find no apparent reason for a problem. –  John Gardeniers Nov 30 '12 at 5:17
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.