I was reading some blog and I found that I can manually start GUI by issuing this command sudo startx, so I did that. I did it in the terminal with the GUI already running. Now I'm unable to login to my user account.

Before that my PC used to boot straight into my account without asking for the password (without even showing the GRUB menu since I have only Ubuntu 12.04 installed on my PC). But now it boots and lands in a screen (without showing the GRUB menu) which displays my user account along with the Guest account. When I choose my account, it asks for the password. I entered the password but it comes back again to the same screen without any response. I am damn sure that the password that I entered was right. When I choose the Guest account, everything goes well. Now I have access only to the Guest account.

Before posting this question, I read similar questions posted here:

My user ID and password is correct: can not log in to Ubuntu 12.04

Unable to log in to my account

Login fails after crash

and I tried solutions suggested for them but nothing worked.

This page (https://help.ubuntu.com/community/LostPassword) and this page (https://wiki.ubuntu.com/RecoveryMode) seems to provide some solutions but I could not bring up the GRUB menu by pressing the SHIFT key or the ESC key. While booting, I kept pressing the keys (I tried both the keys separately) but it would land straight onto the screen displaying user accounts.

I logged into the Guest user and changed my administrator account to standard one. I have no way to know what the root password is.

I opened the Terminal in the Guest account and entered sudo passwd root. It returned the following:

sudo: unable to change sudoers gid: Operation not permitted
sudo: setresuid() [0, 0, 0] -> [128, -1, -1]: Operation not permitted

Now I can not access any of my files or folders. Are there any possible solutions to my problem without re-installing the OS? Is there any way to reset all the User accounts and regain access to my account?

  • If you boot from an Ubuntu live CD/DVD or live USB (like what you probably used to install Ubuntu originally), you should be able to access your files by opening up a folder window and selecting it under Places on the left. If you have trouble with that, please feel free to post a new question or to expand this one (depending on whether or not you think the issues you've presented here are central to the problem). As for resetting your password, you can do that from the live environment as well. – Eliah Kagan Jul 14 '13 at 7:17
  • Reboot the system and hold down the SHIFT key before the system boots into Ubuntu.
  • Choose the Recovery Mode using Arrow keys and press ENTER.
  • Choose 'root' from the list that appears. It will bring up the command line interface.
  • Type rm ~/.Xauthority and hit ENTER.
  • Type rm -rf ~/.config/autostart and hit ENTER.
  • Type shutdown -r now to reboot the system.

What this does is that it just deletes a couple of configuration files (nothing to worry).

  • is your question solved now? – Projjol Jul 14 '13 at 11:42
  • Yes, I have solved it. Thanks for your concern. – TheLoneKing Jul 14 '13 at 11:43
  • cheers man, glad it worked! – Projjol Jul 14 '13 at 11:44

You can try changing your password, there's a simple way to do it.

  1. Boot your machine and on the GRUB screen choose the 'Recovery Mode' option.

  2. Once you've done that, choose the 'Drop to root shell prompt option'

  3. Next, you'll have a command prompt setup for you, over there enter the command


4.You'll be asked to enter your password, followed by a confirmation prompt.

5.Now type sync and hit return.

6.Type reboot -f and hit return, your password should be changed successfully and you can use it to log into your system.

  • I tried your suggestion but still no improvement. Could you please provide a method to reset all my configuration files? – TheLoneKing Jul 14 '13 at 7:46

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