Get back to sudo group without recovery mode

3

I made a big mistake when executed command:

sudo usermod -G vboxusers me

instead of "gpasswd" or "adduser", and I lost sudo group. Is it possible restore it, if I dont know root password, and have only access via ssh? I also have access to PhpMyAdmin. Ubuntu linux.

Ivan Borshchov

Posted 2015-01-13T18:12:45.100

Reputation: 133

The documentation for usermod is downright misleading. It actually says "new list of supplementary groups". – James McLaughlin – 2016-12-13T19:27:47.160

Answers

1

I'm sorry. You're mildly hosed.

Talk to the server owner or another sudo user you know. Put on your best "I screwed up" hat and own your mistake. To regain sudo access you need to either boot to recovery mode or login as the root user. Thankfully, after you get hold of them it's a quick fix.

Edit: Did a quick google search. you are not the first person to do this with that command: https://askubuntu.com/questions/70442/how-do-i-add-myself-back-as-a-sudo-user

Ohnana

Posted 2015-01-13T18:12:45.100

Reputation: 671