Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm an ubuntu newbie I just installed 10.10 and I don't know what I did but now to perform actions that required sudo privileges (open synaptic, mount device, run apt-get install, etc) the OS won't let me saying I dont have enough privileges, for example when I try to sudo apt-get install it tells me:

myusername is not in the sudoers file.  This incident will be reported.

So I have to log in as su to do any on these things. I didn't have to do this before, I just used the regular root privileges but as I said I must have changed something un-intentionally.

Can anyone help me?

Thanks in advance!

share|improve this question
    
Can you post the output of the id command (i.e. groups you are a member of)? –  arrange Mar 24 '11 at 19:23
    
I tried but it said sudo: /etc/sudoers is mode 0644, should be 0440 sudo: no valid sudoers sources found, quitting –  user32310 Nov 4 '11 at 20:01

2 Answers 2

up vote 5 down vote accepted

The standard setup requires all sudoers to be in the admin group. You either dropped out of that group or are using an account that never had this group membership.

As root, add yourself to the admin group

addgroup myusername admin

And try again. If this didn't do the trick then something in your sudo setup is not as it should be. Maybe let us have a look at /etc/sudoers. I would expect there to be the last line:

%admin ALL=(ALL) ALL
share|improve this answer
    
Thanks DsSAR, adding myself as an admin fixed the issue, I guess I must have done something to drop myself out of the group since ubuntu auto-adds the first account as an admin I think. –  javiervd Mar 24 '11 at 19:36
    
Yes it does; Don't mean to scare you but keep an eye out for more privilege weirdness. Make sure all accounts on your machine are properly password protected and only accounts that need to have admin access. You can check using 'grep admin /etc/group' which will list all users that are part of admin (and probably also lpadmin, but that's not relevant here) –  DrSAR Mar 24 '11 at 19:42
    
Thanks, it's a fresh ubuntu install so it just has me for now. –  javiervd Mar 24 '11 at 19:44

Try placing yourself in the sudoers file sudo adduser username admin

share|improve this answer
1  
This won't work since he can't use sudo... –  mathepic Mar 25 '11 at 0:45

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.