Score:0

Accidently removed my only admin account from sudoers file in UBUNTU 20.04 Server and CANNOT access root, HELP

us flag

I accidently removed my admin account from the sudoers group by adding it to another group by using (usermod -G without -a), and I cannot access the root account since it has no password and it keeps asking me for a password when I use (su).

is there anyway I can log in as root to add my admin again to the sudoers group? anyhelp is much appreciated.

DannyNiu avatar
us flag
Make a bootable live USB, enter it, mount system drive, then edit the file.
Neil avatar
cn flag
yes the way to do it is to mount your drive in a Ubuntu live session and chroot into the partition then you should be able to run root commands. try this: https://linuxhint.com/how_to_reset_forgotten_root_password_in_ubuntu/
us flag
I\m using ubuntu SERVER not desktop, does this way work too?
nobody avatar
gh flag
You can also make it in https://wiki.ubuntu.com/RecoveryMode
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.