-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

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
    
  • Just stop using usermod for adding groups. This whole mess could have been avoided if you'd run adduser user_name group_name in the first place. – muru Mar 5 '16 at 8:25
  • So, @muru, the solution is to know everything about linux beforehand? I'll try to be omniscient in future. – Tony Martin Mar 5 '16 at 15:21
  • don't be stupid. Your problem was originally caused by you missing a crucial usermod option - -a. The solution is to be careful when you're messing with accounts. My comment was prompted by your continued usage of usermod when safer alternatives exist. – muru Mar 5 '16 at 15:24
  • I simply followed a tutorial on how to set up kismet, made a slip of the keyboard and found myself in the situation described. The tutorial did not offer alternatives. Nor did it offer a tutorial in all aspects of using and administering a Linux system. But thank you for the intelligence assessment. – Tony Martin Mar 6 '16 at 1:58
  • You're most welcome. – muru Mar 6 '16 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.