Restore sudo access

Naturally, you always use visudo to edit your /etc/sudoers file because that is safer.

But sometime you mess up anyway and lose root.

Thankfully, you can get back in... sometimes.

  1. Restart your machine
  2. Hold shift to enter grub on start up.
  3. Go to recovery
  4. Drop to root shell prompt
  5. Remount FS with "mount -o rw,remount /"
  6. Repair the sudo file or group. (When I wrote this I needed usermod -a -G my_user_name sudo)

Naturally, you should probably lock down your GRUB better than this, since this level of physical access to your machine should not automatically mean root.

links