Ubuntu: I removed myself from sudo group while installing xampp after following instructions



Question:

I removed my self from sudo group in Ubuntu 16.04,

 MyUsername is not in the sudoers file.  This incident will be reported.  

& I can't access the recovery from grub because I removed those choices using Grub Custmizer before. Now, I can't use it again to re-add it because I can't use sudo. Any help!? I have some important files & projects here.

of course Visudo won't work because sudo doesn't.


Solution:1

Try to switch to TTY by pressing Ctrl+Alt+F1 Apply following commands: 1. logout 2. 'Login as root' 3. Enter your root password 4. Edit the sudoer file with visudo 5. Logout 6. Login as your user 7. Try out if can apply sudo command


Solution:2

It's fixed now. I did as follows

  • in grub if you are on dual boot, Selecting Ubuntu & pressing e adds kernel parameters so, do that then in Linux, After uuid= , ro quiet splash add single so it becomes ro quiet splash single. Now it will boot in a mode which allow you to use terminal as sudo.
  • If you are on single boot, only ubuntu, hold left-shift on bios menu till grub appear, do as above.

NOTE: it will write press ctrl + d to continue, this will boot ubuntu as you left it. DO NOT DO THIS. Press Enter, this will choose maintenance mode, Now you can type in the terminal as sudo by default.

  • type adduser YOUR_USERNAME admin if you are on any version under 12.04

  • type adduser YOUR_USERNAME sudo if you are on Ubuntu 12.04 or later.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »