-1

I inadvertently failed to append myself to a group by using usermod -G group_name user_name instead of usermod -aG group_name user_name and now belong only to the group_name group.

The problem is: I can not bring up the grub2 menu with Left-Shift on boot, therefore I can not drop to root login and reinstate my sudo membership.

Is there another way?

To be clear, I have not lost my password, I have inadvertently removed myself from the admin group.

1 Answers1

-1

Following the advice given here I did the following:

  1. Boot from the installation stick (or disk)
  2. In Unity bring up a terminal with ctrl+T. If the boot sequence stalls for any reason (graphics in my case) switch to another tty. I switched to tty2 with ctrl+alt+F2.
  3. Mount your system root drive. On my system this requires sudo mount /dev/sda2 /mnt
  4. Gain access to the installed system by chrooting into it. In my example I typed sudo chroot /mnt, because my system's root directory / is mounted there from the previous command. You now have a bash session in your original installation with full privileges.
  5. Enter usermod -aG sudo user_name
  6. Reboot normally.
  7. Rejoin all the default groups with

    sudo usermod -aG lpadmin,sambashare,adm,cdrom,dip,plugdev user_name
    
muru
  • 207,228