[How To] Regain lost root level access for user

I lost root access somehow on the only user I had on my laptop, my password didn't work and no password worked (not even admin, blank, root,...), I was desperate because I couldn't do almost anything. It said that my
user is not in the sudoers file. This incident will be reported.
This is what I did to solve it:

  1. Created an instalation USB with Zorin OS.
  2. Booted my laptop from the USB.
  3. Selected the "Try Zorin OS option".
  4. Went to "+ Other location" in Files (File Explorer) app.
  5. Selected my laptop's disk.
  6. Went to /etc and in the Right Click menu selected "Open in Terminal".
  7. In terminal sudo nano sudoers.
  8. Went to the last line and wrote user ALL=(ALL) ALL change user with your username.
  9. "Ctrl + O", then "Ctrl + X".
  10. Restart and boot from your main Zorin OS.

This process is for people that can't boot into recovery mode in GNU Grub, that was my case.

2 Likes

I adjusted this to be a tutorial in the Tutorials & Guides sub-forum.