Results 1 to 7 of 7

Thread: Need to add myself back into the admin group.

  1. #1
    Join Date
    Aug 2006
    Beans
    24

    Need to add myself back into the admin group.

    Here's a fun one. After disabling lightdm and booting directly to a command line, i found that my sound wasn't working. After checking I realized I wasn't in the audio group. So I added myself in via

    sudo usermod -G audio jason

    Whoops. Now when I run 'groups jason' I can plainly see that audio is now the ONLY group I'm in. Fun.

    Now I'm not in the sudoers file, and I can't use usermod again without using sudo. See my problem here? lol

    Now I assume my next move is to boot from a liveCD and mount to my install. This leaves me with a few questions:

    1. Once the CD is booted, what commands must I run to get fully mounted and ready to fix my clusterQ#$%@$?
    2. What groups should I be in (aka what groups were I in before I screwed up...I never did any group editing before this so essentially I'm asking what the default groups are.
    and 3. What command _should_ I have run to simply add audio in to my groups list, and not overwrite it?

    Feel free to preface your answers with as much laughing and berating as you see fit. But help would be awesome too. =D

  2. #2
    Join Date
    Sep 2008
    Location
    Italy
    Beans
    88
    Distro
    Ubuntu Studio 12.10 Quantal Quetzal

    Re: Need to add myself back into the admin group.

    I haven't done any extensive tweaking, though by running the command "id" i can see my username is a member of the following groups: [my user name], adm, cdrom, sudo, audio, dip, plugdev, lpadmin, sambashare

    that's quite a pickle you got yourself into!

  3. #3
    Join Date
    Apr 2012
    Beans
    4,564

    Re: Need to add myself back into the admin group.

    That happens a lot - it's why adduser or gpasswd are recommended for adding users to a group

    Anyhow before reaching for the liveCD, you should be able to do it from recovery mode

    Code:
    # mount -o remount,rw /
    # usermod -aG adm,cdrom,sudo,dip,plugdev,staff,lpadmin username
    I *think* those are the default groups. If you have stuff like samba then they may also be in sambashare. Obviously the initial login group should be the user private group.

  4. #4
    Join Date
    Aug 2006
    Beans
    24

    Re: Need to add myself back into the admin group.

    Quote Originally Posted by steeldriver View Post
    That happens a lot - it's why adduser or gpasswd are recommended for adding users to a group

    Anyhow before reaching for the liveCD, you should be able to do it from recovery mode

    Code:
    # mount -o remount,rw /
    # usermod -aG adm,cdrom,sudo,dip,plugdev,staff,lpadmin username
    I *think* those are the default groups. If you have stuff like samba then they may also be in sambashare. Obviously the initial login group should be the user private group.
    Code:
    jason@kaito:~$ mount -o remount, rw /
    mount: only root can do that

  5. #5
    Join Date
    Apr 2012
    Beans
    4,564

    Re: Need to add myself back into the admin group.

    You will need to boot into recovery mode - from the grub menu

    If your boot doesn't display the grub menu by default, then you will need to interrupt it by holding down the shift key

    In recovery mode you will be root

    Quote Originally Posted by steeldriver View Post
    That happens a lot - it's why adduser or gpasswd are recommended for adding users to a group

    Anyhow before reaching for the liveCD, you should be able to do it from recovery mode

    Code:
    # mount -o remount,rw /
    # usermod -aG adm,cdrom,sudo,dip,plugdev,staff,lpadmin username
    I *think* those are the default groups. If you have stuff like samba then they may also be in sambashare. Obviously the initial login group should be the user private group.

  6. #6
    Join Date
    Aug 2006
    Beans
    24

    Re: Need to add myself back into the admin group.

    Quote Originally Posted by steeldriver View Post
    You will need to boot into recovery mode - from the grub menu

    If your boot doesn't display the grub menu by default, then you will need to interrupt it by holding down the shift key

    In recovery mode you will be root
    You, good sir, are the man. Thank you.

  7. #7
    Join Date
    Apr 2012
    Beans
    4,564

    Re: Need to add myself back into the admin group.

    Glad you got it fixed - for future reference, a nice safe way to do what you originally wanted to do is

    Code:
    sudo gpasswd --add username groupname
    If you *do* use usermod, remember to give the -a ('append') switch

    Code:
    sudo usermod -aG groupname username

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
  •