Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Okay, here's my problem. I was being an idiot and installed compiz-core on my Xubuntu 12.10. So there I was, trying to figure out how to fix my issue, and I did sudo xfwm4 --replace.

Then I was unable to login. So I logging with guest, delete my old account, without deleting the home folder, of course, and I create a new account "michael2". Instead of creating a new home folder for it, I instead instructed the program to use my old home folder. Unfortunately, it completely erased the folder, along with over 150GB worth of downloads and about 200 hours worth of work (I work from home, so, yeah).

And to top it all off, whenever I try to use the sudo command, I get the error

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

I don't know how to fix this, nor can I login to root (I never set the root password, because I never had the need to login as root to do anything).

Any help will be appreciated. Is there maybe a way that I can do system restore to restore my previous files and username? I need answers as soon as possible, because I'm literally losing money by the second (the entire work from home kinda thing).

share|improve this question

To regain root access, you will need to boot in recovery mode. When you reach GRUB, select an entry labeled "(...) Recovery mode".

After some time you should get a screen similar to this one, when you should select "Drop to root shell prompt"

enter image description here

Then you will be in a shell as root, and can add your used to the sudo group again:

usermod -a -G adm <your_username>
usermod -a -G sudo <your_username>

After reboot, you should have again sudo permissions. If that's not the case, repeat the procedure but use visudo to add yourself to the sudoers file.

share|improve this answer

You'll need to use the Ubuntu installer in rescue mode to mount your root partition and edit the sudoers file to add your new user account.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.