Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am the administrator and original user of our 11.04 server with GUI. (my name, my password were all given when installing). But it frequently rejects my password (and every other user's password) for running certain programs. For instance, I tried opening synaptic package manager. I wasn't allowed to. I tried installing updates through update manager. It refused my password. In both cases, my name was not shown as the user. However after refusing my password 3 times, I tried update manager once again, and this time my name as user showed up, and my password was accepted.

Is this a bug? Am I doing something wrong? It was asking for the root password, but by default root password is not set (source: https://help.ubuntu.com/community/RootSudo#Re-disabling%20your%20root%20account) and my user password (as admin) should work. Help?

share|improve this question

marked as duplicate by Eliah Kagan, Seth, Nathan Osman, Amith KK, Stephen Myall Feb 15 '13 at 9:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
This sounds like a bug (which is off-topic). I would suggest you report a bug on launchpad.net. Since it is unclear what the package is, you can just go ahead and file a general bug against Ubuntu, and then they will walk you through finding the right information. –  RolandiXor Feb 8 '12 at 15:27
5  
Did you use characters that are not in the ASCII table in your password? –  Rinzwind Feb 8 '12 at 16:10
2  
You're right, by default the root password isn't set. BUT if it is, gksu has to choose which to call: su or sudo. If it chooses su and there is a password set for root it'll expect that. –  charlesbridge Feb 8 '12 at 19:41
    
FYI: Linux is not Windows; Windows has an administrator, Linux has root. So saying you are the administrator is not meaningful. You may be in a group called administrator, or something similar, but this is not meaningful to sudo, gksu, gksudo, or su. Also, I don't think it's correct that root password is not set; I believe it is indeed set, but set to a random UUID, which is very long and unknown. If it wasn't set, it would be dangerous. But there needs to be a root user, so it has to be set to something. –  Marty Fried Mar 2 '12 at 5:54

5 Answers 5

The clues:

  • At first your name is NOT shown, and your password is rejected 3 times
  • Next time your name is shown, and your password works

It is common practice with authentication mechanisms to give you 3 attempts before falling back to the next mechanism.

It looks like that first root authentication is attempted (your name is not shown), and when that fails, the systems falls back to the next mechanism (sudo with your administrator account).

This sounds like a bug, the tool should be asking your administrator password, not the root password. You write this happens frequently. Do you mean that sometimes there is no problem ? (i.e. your name is shown and your administrator password is asked and it succeeds?) In that case it would be helpful to know the sequence of actions that result in the two different cases.

As a remedy, you can set a root password with sudo passwd. If you set it the same as your administrator account's password then you can "cover up" the real problem and make your life easier, but that is obviously not a solution.

share|improve this answer

Reset password using Grub

Restart your computer, and hold down the Shift during bootup to get into the grub menu.

If you have a dual-boot machine and you choose at boot time which operating system to boot into, the grub menu should appear without the need to hold down the Shift key.

If you are unable to get into the Grub boot menu, and therefore cannot choose to boot into recovery mode, you can use a live CD to reset your user password.

Press the down arrow on your keyboard to highlight the line that ends with the words 'recovery mode', then press Enter.

Your computer will now begin the boot process. After a few moments, a Recovery Menu will appear. Use your down arrow key to highlight root and press Enter.

At the # symbol, type:

passwd username, where username is the username of the account you're changing the password for.

You will be prompted to enter a new UNIX password, and to confirm the new password.

Then type:

reboot now


otherwise, Reset password using a Live CD or USB. Boot the Live CD or USB.

Mount your drive.

Press Alt+F2 to get the Run Application dialog.

Type gksu nautilus to launch the file manager with system-wide privileges.

Within the drive you just mounted, you can check that it is the right drive by clicking home and then your username.

Go to the top-level directory of the mounted drive. Then go into the etc directory.

Locate the 'shadow' file and make a backup copy:

Right-click on the shadow file and select copy.

Then right-click in the empty space and select paste.

Rename the backup "shadow.bak".

Edit the original "shadow" file with a text editor.

Find your username for which you have forgotten the password. It should look something like this (the characters after the colon will be different):

username:$1$2abCd0E or

username:$1$2abCd0E:13721a:0:99999:7:::

Delete the characters after the first colon and before the second colon. This will remove the password for the account.

Save the file, exit out of everything and reboot your computer without the live CD or USB.

When you boot back into your installation, click your name in the panel. Open About Me and change your password.

For Current password do not enter anything, as your current password is blank. Just click Authenticate and enter a new password.

After you successfully log in, you will not be able to access your keyring (since you don't remember the old password). This means that all your saved passwords for wireless networks, jabber accounts, etc. will no longer be accessible. You will need to delete the old keyring and start a new one.


Even if that doesn't work, Get Rid of the Keyring Manager.

This will delete all your saved passwords for wireless networks, instant messaging accounts, etc. Only do this if you can't remember the password you used for your keyring.

Go to your Home folder by typing 'home' in the Activities overview.

Press Ctrl+h (or click View ▸ Show Hidden Files.)

Double click on the folder .gnome2

Double click on the folder called keyrings.

Delete any files you find in the keyrings folder.

Restart the computer.

After you restart and log in you will be asked to enter your wireless networks password.

For more information,go to https://help.ubuntu.com/11.04/ubuntu-help/user-accounts.html#passwords

share|improve this answer

A couple things need to be working together here. The administrator account is called root (as Marty pointed out) so lets use that.

You should be able to sudo to become root, open a terminal window and try the command "sudo bash". The response is a will be like "[sudo] password for nathan" and you will need to type YOUR password.

If this fails, you nathan account is not allowed to use sudo. You need to add your account to the adm (admin) group.

If you have a password for root, you will need to manually edit the /etc/group file but that requires VERY CAREFUL editing as mistakes can cause big problems.

Once you are able to "sudo bash" successfully, you should exit that bash shell and then disable the root account "sudo passwd -dl root".

That should get your commands, like running package manager, working correctly.

share|improve this answer

A file /etc/mysql/debian.cnf is automatically generated for debian versions which contains a debian-sys-maint account with password which is used for managing all users and all settings as high privileged user

try it to create new accounts / reset any passwords /reset any settings

share|improve this answer

If you have more than one admin account I would try the passwords to those other accounts. If not there is probably a bug which I had and was cleared up by re installing.

share|improve this answer

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