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.

  • The documentation for usermod is downright misleading. It actually says "new list of supplementary groups".
    – James M
    Dec 13, 2016 at 19:27

1 Answer 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .