Announcement

Collapse
No announcement yet.

HELP -Major User Screwup With usermod. Can It Be Fixed or Reinstall?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] HELP -Major User Screwup With usermod. Can It Be Fixed or Reinstall?

    I haven't broken my system in over 10 years, but I think did today. While trying to install the CHIRP ham radio programmer, I accidentally deleted all my groups except dialout.

    I ran $sudo usermod -G dialout username instead of $sudo -aG dialout username. When I rebooted, the only group I am a member of is dialout which means I am unable to sudo for anything.

    Is there any way to recover from this and reinstate my groups such as adm so I can perform root tasks or do I have to reinstall the system?

    Laughter is expected and I'll even laugh with you if you can help me fix it without a complete reinstall of the system.
    "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

    #2
    You can boot into recovery mode, and use the 'root' option, which will take you to a root shell and fix things from there. No sudo needed.

    https://wiki.ubuntu.com/RecoveryMode

    Or, if you want it to be more complicated, boot to a live usb and chroot into the system and then fix things
    https://help.ubuntu.com/community/LiveCdRecovery
    You will need to know which partition(s) you need to use for this method.

    Comment


      #3
      claydoh, you're the man! Thank you so much. I'm filing those instructions in case I ever do something like that again. I don't know what other groups I need to be a member of, but I can sudo so I can administrate and configure my system again. Thanks and Merry Christmas.
      "If you're in a room with another person who sees the world exactly as you do, one of you is redundant." Dr. Steven Covey, The 7-Habits of Highly Effective People

      Comment


        #4
        The default groups are:
        {your-username} adm cdrom sudo dip plugdev lpadmin sambashare, I think.

        Comment


          #5
          Originally posted by claydoh View Post
          The default groups are:
          {your-username} adm cdrom sudo dip plugdev lpadmin sambashare, I think.
          For my own information, where are you getting those? I'm asking because my /etc/group file has a LOT more groups than that (excluding users). If I used my file (minus my users) to help someone restore theirs, would that work?

          I know this sounds like a total noob question, but at this point I can't worry about that. As a famous idiot once said, "It is what it is!"
          Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

          Comment


            #6
            Originally posted by DoYouKubuntu View Post
            For my own information, where are you getting those? I'm asking because my /etc/group file has a LOT more groups than that (excluding users). If I used my file (minus my users) to help someone restore theirs, would that work?

            I know this sounds like a total noob question, but at this point I can't worry about that. As a famous idiot once said, "It is what it is!"
            web searches verifying output on my systems and virtual machines:

            Code:
            $ groups
            claydoh adm cdrom sudo dip plugdev lpadmin libvirt sambashare
            I know that here in my case, libvirt is specific to virt-manager/qemu/etc I have installed, so I left this out. Which then matches my mostly stock laptop output.

            Also:
            cat /etc/group | grep $USER produces the same result:

            Code:
            $ cat /etc/group | grep $USER
            adm:x:4:syslog,claydoh
            cdrom:x:24:claydoh
            sudo:x:27:claydoh
            dip:x:30:claydoh
            plugdev:x:46:claydoh
            lpadmin:x:120:claydoh
            sambashare:x:1000:claydoh
            claydoh:x:1001:
            libvirt:x:132:claydoh
            Just because the list of groups is large, it does not mean that the $USER is part of all of those, directly.

            Comment


              #7
              Just because the list of groups is large, it does not mean that the $USER is part of all of those, directly.
              Yep, you're right. And I wasn't thinking about that at all.

              My output is almost identical to yours, @claydoh.
              Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

              Comment

              Working...
              X