Results 1 to 7 of 7

Thread: Lost sudo privileges

  1. #1
    Join Date
    Sep 2010
    Beans
    3

    Lost sudo privileges

    I'm not sure if this is the right place for this, but I am a total noob after all, so here I am..

    I was going through the Google tutorials on basic Linux stuff - the ownership and permissions one, specifically.

    Basically, I didn't know that the default behavior for usermod -G [groups] removed the specified user from any groups not listed. I know, I know- I should have read and understood the man page first, but I didn't, and I accidentally my membership to admin.

    My question then, is this: is there any way before earth and heaven to restore my ability to use sudo without re-installing? I understand that the root password is disabled by default, and so here I am without any admin accounts on my machine. Perhaps using a Live CD or an equivalent to edit the sudoers file? If such a thing were possible I would rejoice.

    Any help at all is greatly appreciated!

  2. #2
    Join Date
    Jun 2010
    Location
    Finland
    Beans
    90
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Lost sudo privileges

    You can use "su -" for root access, then you can put back the rights.
    Oh, and do that in the console.

    It will ask for a password which is NOT your user password. It's 'superuser' password. I am not sure if it will ask for a new password if you haven't set one for it yet, but "sudo passwd root" would change that password.
    This brings us back to the sudo privileges
    joona@Joona-PC:~$man girls
    No manual entry for girls ..

  3. #3
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Lost sudo privileges

    Boot into recovery mode and drop to the root shell.

    You can then add yourself back into the admin group.

    Instructions here:
    http://www.psychocats.net/ubuntu/fixsudo

  4. #4
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Lost sudo privileges

    Quote Originally Posted by JohnHeikkila View Post
    You can use "su -" for root access, then you can put back the rights.
    Maybe for other other Linux distros, but not in Ubuntu. There is no root password set in Ubuntu by default. To get root access withou sudo, you boot into recovery mode.

  5. #5
    Join Date
    Sep 2010
    Beans
    3

    Re: Lost sudo privileges

    John,

    I don't think you understand; the default password for a fresh 10.04 installation is locked, so I can't use "su" for anything. Additionally, there are several groups that the first user specified during installation of 10.04 is a member of - I don't remember what they are, but I know one of them was admin, the group conferring the ability to use sudo.

    Since I've accidentally removed myself from the admin group, I cannot use the sudo command any longer. I am aware of a file (/etc/sudoers) that dictates which users have what privileges somehow, but since the only user on my machine has no admin access and the root password is locked by default, I think I'm stuck.

  6. #6
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Lost sudo privileges

    Quote Originally Posted by blamor View Post
    Since I've accidentally removed myself from the admin group, I cannot use the sudo command any longer. I am aware of a file (/etc/sudoers) that dictates which users have what privileges somehow, but since the only user on my machine has no admin access and the root password is locked by default, I think I'm stuck.
    You're not stuck.

    Boot into recovery mode.

    Instructions in the link I posted earlier.

  7. #7
    Join Date
    Sep 2010
    Beans
    3

    Re: Lost sudo privileges

    thanks! I saw your first post right after I posted my second! I really appreciate the help, everything is fine now

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
  •