abc@ubuntu:~$ groups

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 ?

  • not a stackoverflow question. try askubuntu or superuser
    – nvm
    Jan 23 '11 at 11:13

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

  • Logging into recovery mode and editing /etc/group worked for me! Jan 24 '11 at 21:19

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

  • 2
    You did not read the question carefully. I said I am not in sudo group. 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. 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 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

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

P.S It just a guess.

  • 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. 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. 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

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.