Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
abc@ubuntu:~$ groups
root

abc@ubuntu:~$ sudo bash
[sudo] password for abc: 
abc is not in the sudoers file.  This incident will be reported.

I get this error on launching synaptic: "Failed to run /usr/sbin/synaptic as user root. The underlying authorization mechanism (sudo) does not allow you to run this program. Contact the system administrator."

Can you help ?

share|improve this question
    
not a stackoverflow question. try askubuntu or superuser –  nvm Jan 23 '11 at 11:13
add comment

migrated from stackoverflow.com Jan 24 '11 at 6:38

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 0 down vote accepted

You can reboot into recovery mode and edit the sudoers file with nano or something.

share|improve this answer
    
Logging into recovery mode and editing /etc/group worked for me! –  abc Jan 24 '11 at 21:19
add comment

sudo visudo to put the user in sudoers file. you can do echo 'abc ALL=(ALL) ALL' >> /etc/sudoers

share|improve this answer
2  
You did not read the question carefully. I said I am not in sudo group. –  abc Jan 23 '11 at 7:18
    
abc@ubuntu:~$ sudo visudo [sudo] password for abc: abc is not in the sudoers file. This incident will be reported. –  abc Jan 23 '11 at 7:19
    
Above solution did not work. abc@ubuntu:~$ echo 'abc ALL=(ALL) ALL' >> /etc/sudoers bash: /etc/sudoers: Permission denied –  abc Jan 23 '11 at 7:22
    
You can do su to get the root shell. and then enter echo 'abc ALL=(ALL) ALL' >> /etc/sudoers or su -c 'echo "abc ALL=(ALL) ALL" >> /etc/sudoers' –  user36582 Jan 23 '11 at 7:27
1  
su [username] allows you to change to the given user (or root when no arguments are supplied) using that users password. sudo allows you to execute commands with higher privilege using your current users password IF it is listed in the sudoers file. –  TomMD Jan 23 '11 at 16:45
show 3 more comments

Try to boot from live CD and add "abc ALL=(ALL) ALL" to /etc/sudoers. It must help.

P.S It just a guess.

share|improve this answer
    
For this simple job you gonna use Live CD ?? WoW –  user36582 Jan 23 '11 at 7:29
    
I think Live CD is my only option. @Neel Basu, if you have a better solution, then please let us all know. Meanwhile I will go with @Ashot Martirosyan's approach. –  abc Jan 23 '11 at 7:37
    
are you sure that su is not working ? su will ask for your root password. can you just run su and tell me its response ? it should give you a root shell with # –  user36582 Jan 23 '11 at 7:51
    
@Neel In case of Ubuntu - there is no working root account, if you don't set password by hand you cannot use su to switch to that account. –  Lukasz Stelmach Jan 23 '11 at 8:34
    
This solution should work fine. Another option that works well is copy over the root password from another box by copying the right line in /etc/shadow. –  TomMD Jan 23 '11 at 16:50
add comment

Here is a fix: http://www.psychocats.net/ubuntu/fixsudo

@Tanath: you should never edit the sudoers file directly! That kind of thing causes the above problems. Always use a command like visudo to edit this file (the program will check that the formatting is correct, etc)

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.