Results 1 to 7 of 7

Thread: Need help, I accidentally removed myself from all the groups, can't sudo

  1. #1
    Join Date
    Dec 2007
    Beans
    35

    Angry [SOLVED] Need help, I accidentally removed myself from all the groups, can't sudo

    Hi guys,


    I was trying to add myself to an existing group but instead ended only on two groups: the new group and myself. Right now I can't do sudo and who knows what other things.

    If I try to sudo I get this:

    Code:
    my-username is not in the sudoers file.  This incident will be reported.
    What is the list of groups I should belong to?

    Can anyone publish what do you see after typing this in the terminal:

    Code:
    groups your-username
    Do I need to boot into recovery mode?

    Help!
    Last edited by lobo_tuerto; December 21st, 2010 at 06:45 PM. Reason: solved

  2. #2
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Need help, I accidentally removed myself from all the groups, can't sudo

    I think this will help you:

    http://www.psychocats.net/ubuntu/fixsudo
    Ubuntu 16.04 Desktop Guide - Ubuntu 14.04 Desktop Guide - Forum Guide to BBCode - IRC #ubuntuforums

    Member: Not Canonical Team

    Please do not PM me about your forum account unless you have been asked to. The correct place to contact an admin about your account is here.

  3. #3
    Join Date
    Aug 2009
    Location
    India
    Beans
    2,110
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Need help, I accidentally removed myself from all the groups, can't sudo

    Boot using a live cd and edit the sudoers file..And this is the output which you asked,

    Code:
    karthick@Ubuntu-desktop:~$ groups karthick
    karthick : karthick adm dialout cdrom dip plugdev lpadmin admin sambashare

  4. #4
    Join Date
    Jul 2010
    Location
    The 'Burg
    Beans
    575
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Need help, I accidentally removed myself from all the groups, can't sudo

    If you still have your root password, why not just go System>Adminstration>Users&Groups and add your user back into the required groups?

  5. #5
    Join Date
    Oct 2009
    Location
    Elgin, IL USA
    Beans
    2,946
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Need help, I accidentally removed myself from all the groups, can't sudo

    Quote Originally Posted by lobo_tuerto View Post
    Do I need to boot into recovery mode?
    Yes, that will work. No password is needed for netroot or root shell from there to edit /etc/group

    I had to do that when natty temporarily removed admin from sudoers and I had to add myself to sudo group.
    i5 650 3.2 GHz, 8 GB, nvidia GTX 750 Ti, 32" 1080p | i7-4700MQ, 8 GB, Intel HD 4600/nvidia GTX 765M, 15.6" 1080p | etc.

  6. #6
    Join Date
    Dec 2007
    Beans
    35

    Re: Need help, I accidentally removed myself from all the groups, can't sudo

    Great success!

    I booted into recovery mode as root, then simply did:

    Code:
    adduser my-username admin
    adduser my-username adm
    (Thank you coffeecat!)


    Then rebooted, and sudo is working!

    And then added the missing groups (thank you karthick87!)

  7. #7
    Join Date
    Aug 2009
    Location
    India
    Beans
    2,110
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Need help, I accidentally removed myself from all the groups, can't sudo

    You are welcome

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •